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