blob: 196bc3c967af21e6ae2502ee7c298c0d08554caa [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
Chris Zankele7d163f2005-06-30 02:58:59 -070015BIG_ENDIAN := $(shell echo -e __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
24bootdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf
Max Filippov0322cab2012-11-05 07:36:00 +040025bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf boot-uboot
Max Filippov0d456ba2012-11-05 07:37:14 +040026bootdir-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += boot-redboot boot-elf boot-uboot
Chris Zankel4bedea92005-06-23 22:01:12 -070027
Chris Zankel4bedea92005-06-23 22:01:12 -070028
Max Filippovda844a82012-11-04 00:30:13 +040029BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB)).dtb.o
30ifneq ($(CONFIG_BUILTIN_DTB),"")
31obj-y += $(BUILTIN_DTB)
32endif
33
34# Rule to build device tree blobs
35$(obj)/%.dtb: $(src)/dts/%.dts FORCE
36 $(call if_changed_dep,dtc)
37
38clean-files := *.dtb.S
39
Max Filippov9ad79b52012-09-17 05:44:50 +040040zImage Image: $(bootdir-y)
Chris Zankel4bedea92005-06-23 22:01:12 -070041
42$(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
43 $(addprefix $(obj)/,$(host-progs))
44 $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
45
Max Filippov3f5ec292012-11-05 09:10:00 +040046OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary
47
48vmlinux.bin: vmlinux FORCE
49 $(call if_changed,objcopy)
50
51vmlinux.bin.gz: vmlinux.bin FORCE
52 $(call if_changed,gzip)
53
54boot-elf: vmlinux.bin
55boot-redboot: vmlinux.bin.gz
Max Filippov0322cab2012-11-05 07:36:00 +040056boot-uboot: vmlinux.bin.gz