xref: /linux/arch/xtensa/boot/Makefile (revision 9a736fcb096b43b68af8329eb12abc8256dceaba)
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
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
24*9a736fcbSMax Filippovboot-$(CONFIG_XTENSA_PLATFORM_ISS)    += Image
25*9a736fcbSMax Filippovboot-$(CONFIG_XTENSA_PLATFORM_XT2000) += Image zImage uImage
26*9a736fcbSMax Filippovboot-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += Image zImage uImage
274bedea94SChris Zankel
28*9a736fcbSMax Filippovall: $(boot-y)
29*9a736fcbSMax FilippovImage: boot-elf
30*9a736fcbSMax FilippovzImage: boot-redboot
31*9a736fcbSMax FilippovuImage: $(obj)/uImage
324bedea94SChris Zankel
33*9a736fcbSMax Filippovboot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y)) \
344bedea94SChris Zankel		       $(addprefix $(obj)/,$(host-progs))
354bedea94SChris Zankel	$(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
364bedea94SChris Zankel
373f5ec298SMax FilippovOBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary
383f5ec298SMax Filippov
393f5ec298SMax Filippovvmlinux.bin: vmlinux FORCE
403f5ec298SMax Filippov	$(call if_changed,objcopy)
413f5ec298SMax Filippov
423f5ec298SMax Filippovvmlinux.bin.gz: vmlinux.bin FORCE
433f5ec298SMax Filippov	$(call if_changed,gzip)
443f5ec298SMax Filippov
453f5ec298SMax Filippovboot-elf: vmlinux.bin
463f5ec298SMax Filippovboot-redboot: vmlinux.bin.gz
47*9a736fcbSMax Filippov
48*9a736fcbSMax FilippovUIMAGE_LOADADDR = $(CONFIG_KERNEL_LOAD_ADDRESS)
49*9a736fcbSMax FilippovUIMAGE_COMPRESSION = gzip
50*9a736fcbSMax Filippov
51*9a736fcbSMax Filippov$(obj)/uImage: vmlinux.bin.gz FORCE
52*9a736fcbSMax Filippov	$(call if_changed,uimage)
53*9a736fcbSMax Filippov	$(Q)$(kecho) '  Kernel: $@ is ready'
54