Merge branch 'linux-linaro-lsk-v3.10' into linux-linaro-lsk-v3.10-android
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / Makefile
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
14 ifneq ($(MACHINE),)
15 include $(srctree)/$(MACHINE)/Makefile.boot
16 endif
17 include $(srctree)/arch/arm/boot/dts/Makefile
18
19 # Note: the following conditions must always be true:
20 #   ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
21 #   PARAMS_PHYS must be within 4MB of ZRELADDR
22 #   INITRD_PHYS must be in RAM
23 ZRELADDR    := $(zreladdr-y)
24 PARAMS_PHYS := $(params_phys-y)
25 INITRD_PHYS := $(initrd_phys-y)
26
27 export ZRELADDR INITRD_PHYS PARAMS_PHYS
28
29 targets := Image zImage xipImage bootpImage uImage
30
31 ifeq ($(CONFIG_XIP_KERNEL),y)
32
33 $(obj)/xipImage: vmlinux FORCE
34         $(call if_changed,objcopy)
35         @$(kecho) '  Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))'
36
37 $(obj)/Image $(obj)/zImage: FORCE
38         @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
39         @echo 'Only the xipImage target is available in this case'
40         @false
41
42 else
43
44 $(obj)/xipImage: FORCE
45         @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)'
46         @false
47
48 $(obj)/Image: vmlinux FORCE
49         $(call if_changed,objcopy)
50         @$(kecho) '  Kernel: $@ is ready'
51
52 $(obj)/compressed/vmlinux: $(obj)/Image FORCE
53         $(Q)$(MAKE) $(build)=$(obj)/compressed $@
54
55 $(obj)/zImage:  $(obj)/compressed/vmlinux FORCE
56         $(call if_changed,objcopy)
57         @$(kecho) '  Kernel: $@ is ready'
58
59 endif
60
61 ifneq ($(LOADADDR),)
62   UIMAGE_LOADADDR=$(LOADADDR)
63 else
64   ifeq ($(CONFIG_ZBOOT_ROM),y)
65     UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
66   else
67     UIMAGE_LOADADDR=$(ZRELADDR)
68   endif
69 endif
70
71 check_for_multiple_loadaddr = \
72 if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \
73         echo 'multiple (or no) load addresses: $(UIMAGE_LOADADDR)'; \
74         echo 'This is incompatible with uImages'; \
75         echo 'Specify LOADADDR on the commandline to build an uImage'; \
76         false; \
77 fi
78
79 $(obj)/uImage:  $(obj)/zImage FORCE
80         @$(check_for_multiple_loadaddr)
81         $(call if_changed,uimage)
82         @$(kecho) '  Image $@ is ready'
83
84 $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
85         $(Q)$(MAKE) $(build)=$(obj)/bootp $@
86         @:
87
88 $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
89         $(call if_changed,objcopy)
90         @$(kecho) '  Kernel: $@ is ready'
91
92 PHONY += initrd FORCE
93 initrd:
94         @test "$(INITRD_PHYS)" != "" || \
95         (echo This machine does not support INITRD; exit -1)
96         @test "$(INITRD)" != "" || \
97         (echo You must specify INITRD; exit -1)
98
99 install: $(obj)/Image
100         $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
101         $(obj)/Image System.map "$(INSTALL_PATH)"
102
103 zinstall: $(obj)/zImage
104         $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
105         $(obj)/zImage System.map "$(INSTALL_PATH)"
106
107 uinstall: $(obj)/uImage
108         $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
109         $(obj)/uImage System.map "$(INSTALL_PATH)"
110
111 zi:
112         $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
113         $(obj)/zImage System.map "$(INSTALL_PATH)"
114
115 i:
116         $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
117         $(obj)/Image System.map "$(INSTALL_PATH)"
118
119 subdir-     := bootp compressed dts