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