1# 2# arch/arm/boot/Makefile 3# 4# This file is included by the global makefile so that you can add your own 5# architecture-specific flags and dependencies. 6# 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 14ifneq ($(MACHINE),) 15include $(srctree)/$(MACHINE)/Makefile.boot 16endif 17 18# Note: the following conditions must always be true: 19# ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET) 20# PARAMS_PHYS must be within 4MB of ZRELADDR 21# INITRD_PHYS must be in RAM 22ZRELADDR := $(zreladdr-y) 23PARAMS_PHYS := $(params_phys-y) 24INITRD_PHYS := $(initrd_phys-y) 25 26export ZRELADDR INITRD_PHYS PARAMS_PHYS 27 28targets := Image zImage xipImage bootpImage uImage 29 30DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES)) 31ifneq ($(DTB_NAMES),) 32DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES)) 33else 34DTB_LIST := $(dtb-y) 35endif 36DTB_OBJS := $(addprefix $(obj)/,$(DTB_LIST)) 37 38ifeq ($(CONFIG_XIP_KERNEL),y) 39 40$(obj)/xipImage: vmlinux FORCE 41 $(call if_changed,objcopy) 42 @echo ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))' 43 44$(obj)/Image $(obj)/zImage: FORCE 45 @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)' 46 @echo 'Only the xipImage target is available in this case' 47 @false 48 49else 50 51$(obj)/xipImage: FORCE 52 @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)' 53 @false 54 55$(obj)/Image: vmlinux FORCE 56 $(call if_changed,objcopy) 57 @echo ' Kernel: $@ is ready' 58 59$(obj)/compressed/vmlinux: $(obj)/Image FORCE 60 $(Q)$(MAKE) $(build)=$(obj)/compressed $@ 61 62$(obj)/zImage: $(obj)/compressed/vmlinux FORCE 63 $(call if_changed,objcopy) 64 @echo ' Kernel: $@ is ready' 65 66$(obj)/zImage-dtb: $(obj)/zImage $(DTB_OBJS) FORCE 67 $(call if_changed,cat) 68 @echo ' Kernel: $@ is ready' 69 70endif 71 72targets += $(DTB_LIST) 73 74# Rule to build device tree blobs 75$(obj)/%.dtb: $(src)/dts/%.dts FORCE 76 $(call if_changed_dep,dtc) 77 78$(obj)/dtbs: $(DTB_OBJS) 79 80clean-files := *.dtb 81 82ifneq ($(LOADADDR),) 83 UIMAGE_LOADADDR=$(LOADADDR) 84else 85 ifeq ($(CONFIG_ZBOOT_ROM),y) 86 UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT) 87 else 88 UIMAGE_LOADADDR=$(ZRELADDR) 89 endif 90endif 91 92check_for_multiple_loadaddr = \ 93if [ $(words $(UIMAGE_LOADADDR)) -gt 1 ]; then \ 94 echo 'multiple load addresses: $(UIMAGE_LOADADDR)'; \ 95 echo 'This is incompatible with uImages'; \ 96 echo 'Specify LOADADDR on the commandline to build an uImage'; \ 97 false; \ 98fi 99 100$(obj)/uImage: $(obj)/zImage FORCE 101 @$(check_for_multiple_loadaddr) 102 $(call if_changed,uimage) 103 @echo ' Image $@ is ready' 104 105$(obj)/bootp/bootp: $(obj)/zImage initrd FORCE 106 $(Q)$(MAKE) $(build)=$(obj)/bootp $@ 107 @: 108 109$(obj)/bootpImage: $(obj)/bootp/bootp FORCE 110 $(call if_changed,objcopy) 111 @echo ' Kernel: $@ is ready' 112 113PHONY += initrd FORCE 114initrd: 115 @test "$(INITRD_PHYS)" != "" || \ 116 (echo This machine does not support INITRD; exit -1) 117 @test "$(INITRD)" != "" || \ 118 (echo You must specify INITRD; exit -1) 119 120install: $(obj)/Image 121 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ 122 $(obj)/Image System.map "$(INSTALL_PATH)" 123 124zinstall: $(obj)/zImage 125 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ 126 $(obj)/zImage System.map "$(INSTALL_PATH)" 127 128uinstall: $(obj)/uImage 129 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ 130 $(obj)/uImage System.map "$(INSTALL_PATH)" 131 132zi: 133 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ 134 $(obj)/zImage System.map "$(INSTALL_PATH)" 135 136i: 137 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ 138 $(obj)/Image System.map "$(INSTALL_PATH)" 139 140subdir- := bootp compressed 141