xref: /OK3568_Linux_fs/kernel/arch/xtensa/boot/Makefile (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun#
2*4882a593Smuzhiyun# arch/xtensa/boot/Makefile
3*4882a593Smuzhiyun#
4*4882a593Smuzhiyun# This file is subject to the terms and conditions of the GNU General Public
5*4882a593Smuzhiyun# License.  See the file "COPYING" in the main directory of this archive
6*4882a593Smuzhiyun# for more details.
7*4882a593Smuzhiyun#
8*4882a593Smuzhiyun#
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun# KBUILD_CFLAGS used when building rest of boot (takes effect recursively)
12*4882a593SmuzhiyunKBUILD_CFLAGS	+= -fno-builtin -Iarch/$(ARCH)/boot/include
13*4882a593SmuzhiyunHOSTFLAGS	+= -Iarch/$(ARCH)/boot/include
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunBIG_ENDIAN	:= $(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#")
16*4882a593Smuzhiyun
17*4882a593Smuzhiyunexport BIG_ENDIAN
18*4882a593Smuzhiyun
19*4882a593Smuzhiyunsubdir-y	:= lib
20*4882a593Smuzhiyuntargets		+= vmlinux.bin vmlinux.bin.gz
21*4882a593Smuzhiyuntargets		+= uImage xipImage
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun# Subdirs for the boot loader(s)
24*4882a593Smuzhiyun
25*4882a593Smuzhiyunboot-$(CONFIG_XTENSA_PLATFORM_ISS)    += Image
26*4882a593Smuzhiyunboot-$(CONFIG_XTENSA_PLATFORM_XT2000) += Image zImage uImage
27*4882a593Smuzhiyunboot-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += Image zImage uImage
28*4882a593Smuzhiyun
29*4882a593Smuzhiyunall: $(boot-y)
30*4882a593SmuzhiyunImage: boot-elf
31*4882a593SmuzhiyunzImage: boot-redboot
32*4882a593SmuzhiyunuImage: $(obj)/uImage
33*4882a593SmuzhiyunxipImage: $(obj)/xipImage
34*4882a593Smuzhiyun
35*4882a593Smuzhiyunboot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y))
36*4882a593Smuzhiyun	$(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
37*4882a593Smuzhiyun
38*4882a593SmuzhiyunOBJCOPYFLAGS = --strip-all -R .comment -R .notes -O binary
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun$(obj)/vmlinux.bin: vmlinux FORCE
41*4882a593Smuzhiyun	$(call if_changed,objcopy)
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
44*4882a593Smuzhiyun	$(call if_changed,gzip)
45*4882a593Smuzhiyun
46*4882a593Smuzhiyunboot-elf: $(obj)/vmlinux.bin
47*4882a593Smuzhiyunboot-redboot: $(obj)/vmlinux.bin.gz
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunUIMAGE_LOADADDR = $(CONFIG_KERNEL_LOAD_ADDRESS)
50*4882a593SmuzhiyunUIMAGE_COMPRESSION = gzip
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun$(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
53*4882a593Smuzhiyun	$(call if_changed,uimage)
54*4882a593Smuzhiyun	$(Q)$(kecho) '  Kernel: $@ is ready'
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun$(obj)/xipImage: vmlinux FORCE
57*4882a593Smuzhiyun	$(call if_changed,objcopy)
58*4882a593Smuzhiyun	$(Q)$(kecho) '  Kernel: $@ is ready'
59