xref: /linux/arch/xtensa/boot/Makefile (revision 65898b375659f2556da9ac22ea5649407f6f6447)
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
15123f15e6SMax FilippovBIG_ENDIAN	:= $(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#")
164bedea94SChris Zankel
174bedea94SChris Zankelexport BIG_ENDIAN
184bedea94SChris Zankel
19e7d163f7SChris Zankelsubdir-y	:= lib
20*65898b37SMax Filippovtargets		+= vmlinux.bin vmlinux.bin.gz
21e7d163f7SChris Zankel
224bedea94SChris Zankel# Subdirs for the boot loader(s)
234bedea94SChris Zankel
249a736fcbSMax Filippovboot-$(CONFIG_XTENSA_PLATFORM_ISS)    += Image
259a736fcbSMax Filippovboot-$(CONFIG_XTENSA_PLATFORM_XT2000) += Image zImage uImage
269a736fcbSMax Filippovboot-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += Image zImage uImage
274bedea94SChris Zankel
289a736fcbSMax Filippovall: $(boot-y)
299a736fcbSMax FilippovImage: boot-elf
309a736fcbSMax FilippovzImage: boot-redboot
319a736fcbSMax FilippovuImage: $(obj)/uImage
327af710d9SMax FilippovxipImage: $(obj)/xipImage
334bedea94SChris Zankel
34d6c6ab93SMasahiro Yamadaboot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y))
354bedea94SChris Zankel	$(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
364bedea94SChris Zankel
374119ba21SMax FilippovOBJCOPYFLAGS = --strip-all -R .comment -R .notes -O binary
383f5ec298SMax Filippov
39*65898b37SMax Filippov$(obj)/vmlinux.bin: vmlinux FORCE
403f5ec298SMax Filippov	$(call if_changed,objcopy)
413f5ec298SMax Filippov
42*65898b37SMax Filippov$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
433f5ec298SMax Filippov	$(call if_changed,gzip)
443f5ec298SMax Filippov
45*65898b37SMax Filippovboot-elf: $(obj)/vmlinux.bin
46*65898b37SMax Filippovboot-redboot: $(obj)/vmlinux.bin.gz
479a736fcbSMax Filippov
489a736fcbSMax FilippovUIMAGE_LOADADDR = $(CONFIG_KERNEL_LOAD_ADDRESS)
499a736fcbSMax FilippovUIMAGE_COMPRESSION = gzip
509a736fcbSMax Filippov
51*65898b37SMax Filippov$(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
529a736fcbSMax Filippov	$(call if_changed,uimage)
539a736fcbSMax Filippov	$(Q)$(kecho) '  Kernel: $@ is ready'
547af710d9SMax Filippov
557af710d9SMax Filippov$(obj)/xipImage: vmlinux FORCE
567af710d9SMax Filippov	$(call if_changed,objcopy)
577af710d9SMax Filippov	$(Q)$(kecho) '  Kernel: $@ is ready'
58