Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | # |
| 2 | # arch/arm/boot/Makefile |
| 3 | # |
Paul Smith | 4f19336 | 2006-03-05 17:14:10 -0500 | [diff] [blame] | 4 | # This file is included by the global makefile so that you can add your own |
| 5 | # architecture-specific flags and dependencies. |
| 6 | # |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | # 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 | |
Mark Rutland | 3cb5958 | 2016-07-19 11:23:37 +0100 | [diff] [blame] | 14 | OBJCOPYFLAGS :=-O binary -R .comment -S |
| 15 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | ifneq ($(MACHINE),) |
Masahiro Yamada | 7aacad5 | 2015-03-27 20:43:35 +0900 | [diff] [blame] | 17 | include $(MACHINE)/Makefile.boot |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | endif |
Benoit Goby | c792cb6 | 2013-11-08 15:24:19 -0800 | [diff] [blame] | 19 | include $(srctree)/arch/arm/boot/dts/Makefile |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | |
| 21 | # Note: the following conditions must always be true: |
Russell King | 9e84ed6 | 2010-09-09 22:39:41 +0100 | [diff] [blame] | 22 | # ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | # PARAMS_PHYS must be within 4MB of ZRELADDR |
| 24 | # INITRD_PHYS must be in RAM |
Russell King | 9e84ed6 | 2010-09-09 22:39:41 +0100 | [diff] [blame] | 25 | ZRELADDR := $(zreladdr-y) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | PARAMS_PHYS := $(params_phys-y) |
| 27 | INITRD_PHYS := $(initrd_phys-y) |
| 28 | |
Russell King | 9e84ed6 | 2010-09-09 22:39:41 +0100 | [diff] [blame] | 29 | export ZRELADDR INITRD_PHYS PARAMS_PHYS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | |
| 31 | targets := Image zImage xipImage bootpImage uImage |
| 32 | |
Colin Cross | ccd6cd3 | 2013-04-17 16:58:36 -0700 | [diff] [blame] | 33 | DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES)) |
| 34 | ifneq ($(DTB_NAMES),) |
| 35 | DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES)) |
| 36 | else |
| 37 | DTB_LIST := $(dtb-y) |
| 38 | endif |
| 39 | DTB_OBJS := $(addprefix $(obj)/dts/,$(DTB_LIST)) |
| 40 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | ifeq ($(CONFIG_XIP_KERNEL),y) |
| 42 | |
| 43 | $(obj)/xipImage: vmlinux FORCE |
| 44 | $(call if_changed,objcopy) |
Masahiro Yamada | c6bbfbb7 | 2016-05-30 03:01:23 +0100 | [diff] [blame] | 45 | @$(kecho) ' Physical Address of xipImage: $(CONFIG_XIP_PHYS_ADDR)' |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | |
| 47 | $(obj)/Image $(obj)/zImage: FORCE |
| 48 | @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)' |
| 49 | @echo 'Only the xipImage target is available in this case' |
| 50 | @false |
| 51 | |
| 52 | else |
| 53 | |
| 54 | $(obj)/xipImage: FORCE |
| 55 | @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)' |
| 56 | @false |
| 57 | |
| 58 | $(obj)/Image: vmlinux FORCE |
| 59 | $(call if_changed,objcopy) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | |
| 61 | $(obj)/compressed/vmlinux: $(obj)/Image FORCE |
| 62 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ |
| 63 | |
| 64 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE |
| 65 | $(call if_changed,objcopy) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | |
Colin Cross | ccd6cd3 | 2013-04-17 16:58:36 -0700 | [diff] [blame] | 67 | $(obj)/zImage-dtb: $(obj)/zImage $(DTB_OBJS) FORCE |
| 68 | $(call if_changed,cat) |
| 69 | @echo ' Kernel: $@ is ready' |
| 70 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | endif |
| 72 | |
Stephen Warren | e339364 | 2012-03-16 15:03:55 -0600 | [diff] [blame] | 73 | ifneq ($(LOADADDR),) |
| 74 | UIMAGE_LOADADDR=$(LOADADDR) |
Uwe Kleine-König | 0f98014 | 2008-03-06 16:22:33 +0100 | [diff] [blame] | 75 | else |
Stephen Warren | e339364 | 2012-03-16 15:03:55 -0600 | [diff] [blame] | 76 | ifeq ($(CONFIG_ZBOOT_ROM),y) |
| 77 | UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT) |
| 78 | else |
| 79 | UIMAGE_LOADADDR=$(ZRELADDR) |
| 80 | endif |
Uwe Kleine-König | 0f98014 | 2008-03-06 16:22:33 +0100 | [diff] [blame] | 81 | endif |
| 82 | |
Sascha Hauer | cd227fb | 2011-08-17 14:23:46 +0100 | [diff] [blame] | 83 | check_for_multiple_loadaddr = \ |
Olof Johansson | 938f94c | 2013-02-23 08:02:24 +0100 | [diff] [blame] | 84 | if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \ |
| 85 | echo 'multiple (or no) load addresses: $(UIMAGE_LOADADDR)'; \ |
Sascha Hauer | cd227fb | 2011-08-17 14:23:46 +0100 | [diff] [blame] | 86 | echo 'This is incompatible with uImages'; \ |
| 87 | echo 'Specify LOADADDR on the commandline to build an uImage'; \ |
| 88 | false; \ |
| 89 | fi |
| 90 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | $(obj)/uImage: $(obj)/zImage FORCE |
Sascha Hauer | cd227fb | 2011-08-17 14:23:46 +0100 | [diff] [blame] | 92 | @$(check_for_multiple_loadaddr) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | $(call if_changed,uimage) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | |
| 95 | $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE |
| 96 | $(Q)$(MAKE) $(build)=$(obj)/bootp $@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | |
| 98 | $(obj)/bootpImage: $(obj)/bootp/bootp FORCE |
| 99 | $(call if_changed,objcopy) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | |
Masahiro Yamada | bc5ce15 | 2016-04-05 03:08:26 +0100 | [diff] [blame] | 101 | PHONY += initrd install zinstall uinstall |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | initrd: |
| 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 | |
Robert Richter | 19514fc | 2013-07-17 18:05:06 +0200 | [diff] [blame] | 108 | install: |
| 109 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | $(obj)/Image System.map "$(INSTALL_PATH)" |
| 111 | |
Robert Richter | 19514fc | 2013-07-17 18:05:06 +0200 | [diff] [blame] | 112 | zinstall: |
| 113 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | $(obj)/zImage System.map "$(INSTALL_PATH)" |
| 115 | |
Robert Richter | 19514fc | 2013-07-17 18:05:06 +0200 | [diff] [blame] | 116 | uinstall: |
| 117 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \ |
Russell King | a65d292 | 2011-01-08 16:18:51 +0000 | [diff] [blame] | 118 | $(obj)/uImage System.map "$(INSTALL_PATH)" |
| 119 | |
Nishanth Menon | 9e25fe6 | 2013-01-22 15:27:29 -0600 | [diff] [blame] | 120 | subdir- := bootp compressed dts |