blob: 53e4178711e6952a4709ba01e6db8534489c9213 [file] [log] [blame]
Chris Zankel4bedea92005-06-23 22:01:12 -07001#
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
Milton Miller437374e2007-10-20 03:58:03 -050011# KBUILD_CFLAGS used when building rest of boot (takes effect recursively)
12KBUILD_CFLAGS += -fno-builtin -Iarch/$(ARCH)/boot/include
Chris Zankel4bedea92005-06-23 22:01:12 -070013HOSTFLAGS += -Iarch/$(ARCH)/boot/include
14
Max Filippov123f15e2013-08-22 18:09:47 +040015BIG_ENDIAN := $(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#")
Chris Zankel4bedea92005-06-23 22:01:12 -070016
matt mooney3996eab2011-01-14 06:12:34 -080017export ccflags-y
Chris Zankel4bedea92005-06-23 22:01:12 -070018export BIG_ENDIAN
19
Chris Zankele7d163f2005-06-30 02:58:59 -070020subdir-y := lib
21
Chris Zankel4bedea92005-06-23 22:01:12 -070022# Subdirs for the boot loader(s)
23
Max Filippov9a736fc2016-12-25 04:58:57 -080024boot-$(CONFIG_XTENSA_PLATFORM_ISS) += Image
25boot-$(CONFIG_XTENSA_PLATFORM_XT2000) += Image zImage uImage
26boot-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += Image zImage uImage
Chris Zankel4bedea92005-06-23 22:01:12 -070027
Max Filippov9a736fc2016-12-25 04:58:57 -080028all: $(boot-y)
29Image: boot-elf
30zImage: boot-redboot
31uImage: $(obj)/uImage
Chris Zankel4bedea92005-06-23 22:01:12 -070032
Max Filippov9a736fc2016-12-25 04:58:57 -080033boot-elf boot-redboot: $(addprefix $(obj)/,$(subdir-y)) \
34 $(addprefix $(obj)/,$(host-progs))
Chris Zankel4bedea92005-06-23 22:01:12 -070035 $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
36
Max Filippov3f5ec292012-11-05 09:10:00 +040037OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary
38
39vmlinux.bin: vmlinux FORCE
40 $(call if_changed,objcopy)
41
42vmlinux.bin.gz: vmlinux.bin FORCE
43 $(call if_changed,gzip)
44
45boot-elf: vmlinux.bin
46boot-redboot: vmlinux.bin.gz
Max Filippov9a736fc2016-12-25 04:58:57 -080047
48UIMAGE_LOADADDR = $(CONFIG_KERNEL_LOAD_ADDRESS)
49UIMAGE_COMPRESSION = gzip
50
51$(obj)/uImage: vmlinux.bin.gz FORCE
52 $(call if_changed,uimage)
53 $(Q)$(kecho) ' Kernel: $@ is ready'