blob: c877087d2000cf054be2c086f3de957555f46066 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#
2# arch/arm/boot/Makefile
3#
Paul Smith4f193362006-03-05 17:14:10 -05004# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies.
6#
Linus Torvalds1da177e2005-04-16 15:20:36 -07007# This file is subject to the terms and conditions of the GNU General Public
8# License. See the file "COPYING" in the main directory of this archive
9# for more details.
10#
11# Copyright (C) 1995-2002 Russell King
12#
13
Linus Torvalds1da177e2005-04-16 15:20:36 -070014ifneq ($(MACHINE),)
Russell King9e84ed62010-09-09 22:39:41 +010015include $(srctree)/$(MACHINE)/Makefile.boot
Linus Torvalds1da177e2005-04-16 15:20:36 -070016endif
17
18# Note: the following conditions must always be true:
Russell King9e84ed62010-09-09 22:39:41 +010019# ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
Linus Torvalds1da177e2005-04-16 15:20:36 -070020# PARAMS_PHYS must be within 4MB of ZRELADDR
21# INITRD_PHYS must be in RAM
Russell King9e84ed62010-09-09 22:39:41 +010022ZRELADDR := $(zreladdr-y)
Linus Torvalds1da177e2005-04-16 15:20:36 -070023PARAMS_PHYS := $(params_phys-y)
24INITRD_PHYS := $(initrd_phys-y)
25
Russell King9e84ed62010-09-09 22:39:41 +010026export ZRELADDR INITRD_PHYS PARAMS_PHYS
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
28targets := Image zImage xipImage bootpImage uImage
29
30ifeq ($(CONFIG_XIP_KERNEL),y)
31
32$(obj)/xipImage: vmlinux FORCE
33 $(call if_changed,objcopy)
34 @echo ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))'
35
36$(obj)/Image $(obj)/zImage: FORCE
37 @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
38 @echo 'Only the xipImage target is available in this case'
39 @false
40
41else
42
43$(obj)/xipImage: FORCE
44 @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)'
45 @false
46
47$(obj)/Image: vmlinux FORCE
48 $(call if_changed,objcopy)
49 @echo ' Kernel: $@ is ready'
50
51$(obj)/compressed/vmlinux: $(obj)/Image FORCE
52 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
53
54$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
55 $(call if_changed,objcopy)
56 @echo ' Kernel: $@ is ready'
57
58endif
59
Stephen Warren7c431852012-01-09 11:38:15 -070060targets += $(dtb-y)
61
Rob Herring5fd1a2e2011-07-25 09:52:12 -060062# Rule to build device tree blobs
Stephen Warren7c431852012-01-09 11:38:15 -070063$(obj)/%.dtb: $(src)/dts/%.dts FORCE
64 $(call if_changed_dep,dtc)
Rob Herring5fd1a2e2011-07-25 09:52:12 -060065
66$(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))
67
Dirk B5f300ac2011-11-08 18:16:39 +010068clean-files := *.dtb
69
Stephen Warrene3393642012-03-16 15:03:55 -060070ifneq ($(LOADADDR),)
71 UIMAGE_LOADADDR=$(LOADADDR)
Uwe Kleine-König0f980142008-03-06 16:22:33 +010072else
Stephen Warrene3393642012-03-16 15:03:55 -060073 ifeq ($(CONFIG_ZBOOT_ROM),y)
74 UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
75 else
76 UIMAGE_LOADADDR=$(ZRELADDR)
77 endif
Uwe Kleine-König0f980142008-03-06 16:22:33 +010078endif
79
Sascha Hauercd227fb2011-08-17 14:23:46 +010080check_for_multiple_loadaddr = \
Stephen Warrene3393642012-03-16 15:03:55 -060081if [ $(words $(UIMAGE_LOADADDR)) -gt 1 ]; then \
82 echo 'multiple load addresses: $(UIMAGE_LOADADDR)'; \
Sascha Hauercd227fb2011-08-17 14:23:46 +010083 echo 'This is incompatible with uImages'; \
84 echo 'Specify LOADADDR on the commandline to build an uImage'; \
85 false; \
86fi
87
Linus Torvalds1da177e2005-04-16 15:20:36 -070088$(obj)/uImage: $(obj)/zImage FORCE
Sascha Hauercd227fb2011-08-17 14:23:46 +010089 @$(check_for_multiple_loadaddr)
Linus Torvalds1da177e2005-04-16 15:20:36 -070090 $(call if_changed,uimage)
91 @echo ' Image $@ is ready'
92
93$(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
94 $(Q)$(MAKE) $(build)=$(obj)/bootp $@
95 @:
96
97$(obj)/bootpImage: $(obj)/bootp/bootp FORCE
98 $(call if_changed,objcopy)
99 @echo ' Kernel: $@ is ready'
100
Paul Smith4f193362006-03-05 17:14:10 -0500101PHONY += initrd FORCE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102initrd:
103 @test "$(INITRD_PHYS)" != "" || \
104 (echo This machine does not support INITRD; exit -1)
105 @test "$(INITRD)" != "" || \
106 (echo You must specify INITRD; exit -1)
107
108install: $(obj)/Image
109 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
110 $(obj)/Image System.map "$(INSTALL_PATH)"
111
112zinstall: $(obj)/zImage
113 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
114 $(obj)/zImage System.map "$(INSTALL_PATH)"
115
Russell Kinga65d2922011-01-08 16:18:51 +0000116uinstall: $(obj)/uImage
117 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
118 $(obj)/uImage System.map "$(INSTALL_PATH)"
119
Russell King13d5fad2007-07-20 10:36:05 +0100120zi:
121 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
122 $(obj)/zImage System.map "$(INSTALL_PATH)"
123
124i:
125 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
126 $(obj)/Image System.map "$(INSTALL_PATH)"
127
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128subdir- := bootp compressed