xref: /linux/arch/xtensa/boot/Makefile (revision 0d456bad36d42d16022be045c8a53ddbb59ee478)
14bedea94SChris Zankel#
24bedea94SChris Zankel# arch/xtensa/boot/Makefile
34bedea94SChris Zankel#
44bedea94SChris Zankel# This file is subject to the terms and conditions of the GNU General Public
54bedea94SChris Zankel# License.  See the file "COPYING" in the main directory of this archive
64bedea94SChris Zankel# for more details.
74bedea94SChris Zankel#
84bedea94SChris Zankel#
94bedea94SChris Zankel
104bedea94SChris Zankel
11437374e9SMilton Miller# KBUILD_CFLAGS used when building rest of boot (takes effect recursively)
12437374e9SMilton MillerKBUILD_CFLAGS	+= -fno-builtin -Iarch/$(ARCH)/boot/include
134bedea94SChris ZankelHOSTFLAGS	+= -Iarch/$(ARCH)/boot/include
144bedea94SChris Zankel
15e7d163f7SChris ZankelBIG_ENDIAN	:= $(shell echo -e __XTENSA_EB__ | $(CC) -E - | grep -v "\#")
164bedea94SChris Zankel
173996eabbSmatt mooneyexport ccflags-y
184bedea94SChris Zankelexport BIG_ENDIAN
194bedea94SChris Zankel
20e7d163f7SChris Zankelsubdir-y	:= lib
21e7d163f7SChris Zankel
224bedea94SChris Zankel# Subdirs for the boot loader(s)
234bedea94SChris Zankel
244bedea94SChris Zankelbootdir-$(CONFIG_XTENSA_PLATFORM_ISS)	 += boot-elf
250322cabdSMax Filippovbootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf boot-uboot
26*0d456badSMax Filippovbootdir-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += boot-redboot boot-elf boot-uboot
274bedea94SChris Zankel
284bedea94SChris Zankel
29da844a81SMax FilippovBUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB)).dtb.o
30da844a81SMax Filippovifneq ($(CONFIG_BUILTIN_DTB),"")
31da844a81SMax Filippovobj-y += $(BUILTIN_DTB)
32da844a81SMax Filippovendif
33da844a81SMax Filippov
34da844a81SMax Filippov# Rule to build device tree blobs
35da844a81SMax Filippov$(obj)/%.dtb: $(src)/dts/%.dts FORCE
36da844a81SMax Filippov	$(call if_changed_dep,dtc)
37da844a81SMax Filippov
38da844a81SMax Filippovclean-files := *.dtb.S
39da844a81SMax Filippov
409ad79b58SMax FilippovzImage Image: $(bootdir-y)
414bedea94SChris Zankel
424bedea94SChris Zankel$(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
434bedea94SChris Zankel	      $(addprefix $(obj)/,$(host-progs))
444bedea94SChris Zankel	$(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
454bedea94SChris Zankel
463f5ec298SMax FilippovOBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary
473f5ec298SMax Filippov
483f5ec298SMax Filippovvmlinux.bin: vmlinux FORCE
493f5ec298SMax Filippov	$(call if_changed,objcopy)
503f5ec298SMax Filippov
513f5ec298SMax Filippovvmlinux.bin.gz: vmlinux.bin FORCE
523f5ec298SMax Filippov	$(call if_changed,gzip)
533f5ec298SMax Filippov
543f5ec298SMax Filippovboot-elf: vmlinux.bin
553f5ec298SMax Filippovboot-redboot: vmlinux.bin.gz
560322cabdSMax Filippovboot-uboot: vmlinux.bin.gz
57