blob: 84aa2caf07ed203fb810220258401a1b51f7cab3 [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)
Fabio Estevam2d4d07b2012-10-24 16:37:28 -020034 @$(kecho) ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))'
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
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)
Fabio Estevam2d4d07b2012-10-24 16:37:28 -020049 @$(kecho) ' Kernel: $@ is ready'
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
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)
Fabio Estevam2d4d07b2012-10-24 16:37:28 -020056 @$(kecho) ' Kernel: $@ is ready'
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
58endif
59
Stephen Warrene3393642012-03-16 15:03:55 -060060ifneq ($(LOADADDR),)
61 UIMAGE_LOADADDR=$(LOADADDR)
Uwe Kleine-König0f980142008-03-06 16:22:33 +010062else
Stephen Warrene3393642012-03-16 15:03:55 -060063 ifeq ($(CONFIG_ZBOOT_ROM),y)
64 UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
65 else
66 UIMAGE_LOADADDR=$(ZRELADDR)
67 endif
Uwe Kleine-König0f980142008-03-06 16:22:33 +010068endif
69
Sascha Hauercd227fb2011-08-17 14:23:46 +010070check_for_multiple_loadaddr = \
Olof Johansson938f94c2013-02-23 08:02:24 +010071if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \
72 echo 'multiple (or no) load addresses: $(UIMAGE_LOADADDR)'; \
Sascha Hauercd227fb2011-08-17 14:23:46 +010073 echo 'This is incompatible with uImages'; \
74 echo 'Specify LOADADDR on the commandline to build an uImage'; \
75 false; \
76fi
77
Linus Torvalds1da177e2005-04-16 15:20:36 -070078$(obj)/uImage: $(obj)/zImage FORCE
Sascha Hauercd227fb2011-08-17 14:23:46 +010079 @$(check_for_multiple_loadaddr)
Linus Torvalds1da177e2005-04-16 15:20:36 -070080 $(call if_changed,uimage)
Fabio Estevam2d4d07b2012-10-24 16:37:28 -020081 @$(kecho) ' Image $@ is ready'
Linus Torvalds1da177e2005-04-16 15:20:36 -070082
83$(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
84 $(Q)$(MAKE) $(build)=$(obj)/bootp $@
85 @:
86
87$(obj)/bootpImage: $(obj)/bootp/bootp FORCE
88 $(call if_changed,objcopy)
Fabio Estevam2d4d07b2012-10-24 16:37:28 -020089 @$(kecho) ' Kernel: $@ is ready'
Linus Torvalds1da177e2005-04-16 15:20:36 -070090
Paul Smith4f193362006-03-05 17:14:10 -050091PHONY += initrd FORCE
Linus Torvalds1da177e2005-04-16 15:20:36 -070092initrd:
93 @test "$(INITRD_PHYS)" != "" || \
94 (echo This machine does not support INITRD; exit -1)
95 @test "$(INITRD)" != "" || \
96 (echo You must specify INITRD; exit -1)
97
98install: $(obj)/Image
99 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
100 $(obj)/Image System.map "$(INSTALL_PATH)"
101
102zinstall: $(obj)/zImage
103 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
104 $(obj)/zImage System.map "$(INSTALL_PATH)"
105
Russell Kinga65d2922011-01-08 16:18:51 +0000106uinstall: $(obj)/uImage
107 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
108 $(obj)/uImage System.map "$(INSTALL_PATH)"
109
Russell King13d5fad2007-07-20 10:36:05 +0100110zi:
111 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
112 $(obj)/zImage System.map "$(INSTALL_PATH)"
113
114i:
115 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
116 $(obj)/Image System.map "$(INSTALL_PATH)"
117
Nishanth Menon9e25fe62013-01-22 15:27:29 -0600118subdir- := bootp compressed dts