diff options
Diffstat (limited to 'arch/powerpc/boot/Makefile')
-rw-r--r-- | arch/powerpc/boot/Makefile | 81 |
1 files changed, 35 insertions, 46 deletions
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index ff2701949ee1..61a6f34ca5ed 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
@@ -43,10 +43,11 @@ $(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \ | |||
43 | 43 | ||
44 | src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ | 44 | src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ |
45 | ns16550.c serial.c simple_alloc.c div64.S util.S \ | 45 | ns16550.c serial.c simple_alloc.c div64.S util.S \ |
46 | gunzip_util.c elf_util.c $(zlib) devtree.c \ | 46 | gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \ |
47 | 44x.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c | 47 | 44x.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c |
48 | src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \ | 48 | src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \ |
49 | cuboot-ebony.c treeboot-ebony.c prpmc2800.c | 49 | cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ |
50 | ps3-head.S ps3-hvcall.S ps3.c | ||
50 | src-boot := $(src-wlib) $(src-plat) empty.c | 51 | src-boot := $(src-wlib) $(src-plat) empty.c |
51 | 52 | ||
52 | src-boot := $(addprefix $(obj)/, $(src-boot)) | 53 | src-boot := $(addprefix $(obj)/, $(src-boot)) |
@@ -75,11 +76,11 @@ $(addprefix $(obj)/,$(zliblinuxheader)): $(obj)/%: $(srctree)/include/linux/% | |||
75 | $(obj)/empty.c: | 76 | $(obj)/empty.c: |
76 | @touch $@ | 77 | @touch $@ |
77 | 78 | ||
78 | $(obj)/zImage.lds $(obj)/zImage.coff.lds: $(obj)/%: $(srctree)/$(src)/%.S | 79 | $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds: $(obj)/%: $(srctree)/$(src)/%.S |
79 | @cp $< $@ | 80 | @cp $< $@ |
80 | 81 | ||
81 | clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \ | 82 | clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \ |
82 | empty.c zImage.coff.lds zImage.lds | 83 | empty.c zImage zImage.coff.lds zImage.ps3.lds zImage.lds |
83 | 84 | ||
84 | quiet_cmd_bootcc = BOOTCC $@ | 85 | quiet_cmd_bootcc = BOOTCC $@ |
85 | cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $< | 86 | cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $< |
@@ -102,7 +103,7 @@ hostprogs-y := addnote addRamDisk hack-coff mktree | |||
102 | 103 | ||
103 | targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) | 104 | targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) |
104 | extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ | 105 | extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ |
105 | $(obj)/zImage.lds $(obj)/zImage.coff.lds | 106 | $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds |
106 | 107 | ||
107 | wrapper :=$(srctree)/$(src)/wrapper | 108 | wrapper :=$(srctree)/$(src)/wrapper |
108 | wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \ | 109 | wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \ |
@@ -132,7 +133,7 @@ image-$(CONFIG_PPC_CELLEB) += zImage.pseries | |||
132 | image-$(CONFIG_PPC_CHRP) += zImage.chrp | 133 | image-$(CONFIG_PPC_CHRP) += zImage.chrp |
133 | image-$(CONFIG_PPC_EFIKA) += zImage.chrp | 134 | image-$(CONFIG_PPC_EFIKA) += zImage.chrp |
134 | image-$(CONFIG_PPC_PMAC) += zImage.pmac | 135 | image-$(CONFIG_PPC_PMAC) += zImage.pmac |
135 | image-$(CONFIG_PPC_HOLLY) += zImage.holly-elf | 136 | image-$(CONFIG_PPC_HOLLY) += zImage.holly |
136 | image-$(CONFIG_PPC_PRPMC2800) += zImage.prpmc2800 | 137 | image-$(CONFIG_PPC_PRPMC2800) += zImage.prpmc2800 |
137 | image-$(CONFIG_PPC_ISERIES) += zImage.iseries | 138 | image-$(CONFIG_PPC_ISERIES) += zImage.iseries |
138 | image-$(CONFIG_DEFAULT_UIMAGE) += uImage | 139 | image-$(CONFIG_DEFAULT_UIMAGE) += uImage |
@@ -157,55 +158,43 @@ targets += $(image-y) $(initrd-y) | |||
157 | 158 | ||
158 | $(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz | 159 | $(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz |
159 | 160 | ||
160 | dts- := $(patsubst zImage%, zImage.dts%, $(image-n) $(image-)) | 161 | # If CONFIG_WANT_DEVICE_TREE is set and CONFIG_DEVICE_TREE isn't an |
161 | dts-y := $(patsubst zImage%, zImage.dts%, $(image-y)) | 162 | # empty string, define 'dts' to be path to the dts |
162 | dts-y := $(filter-out $(image-y), $(dts-y)) | 163 | # CONFIG_DEVICE_TREE will have "" around it, make sure to strip them |
163 | targets += $(image-y) $(dts-y) | 164 | ifeq ($(CONFIG_WANT_DEVICE_TREE),y) |
164 | 165 | ifneq ($(CONFIG_DEVICE_TREE),"") | |
165 | dts_initrd- := $(patsubst zImage%, zImage.dts_initrd%, $(image-n) $(image-)) | 166 | dts = $(if $(shell echo $(CONFIG_DEVICE_TREE) | grep '^/'),\ |
166 | dts_initrd-y := $(patsubst zImage%, zImage.dts_initrd%, $(image-y)) | 167 | ,$(srctree)/$(src)/dts/)$(CONFIG_DEVICE_TREE:"%"=%) |
167 | dts_initrd-y := $(filter-out $(image-y), $(dts_initrd-y)) | 168 | endif |
168 | targets += $(image-y) $(dts_initrd-y) | 169 | endif |
169 | |||
170 | $(addprefix $(obj)/, $(dts_initrd-y)): $(obj)/ramdisk.image.gz | ||
171 | 170 | ||
172 | # Don't put the ramdisk on the pattern rule; when its missing make will try | 171 | # Don't put the ramdisk on the pattern rule; when its missing make will try |
173 | # the pattern rule with less dependencies that also matches (even with the | 172 | # the pattern rule with less dependencies that also matches (even with the |
174 | # hard dependency listed). | 173 | # hard dependency listed). |
175 | $(obj)/zImage.dts_initrd.%: vmlinux $(wrapperbits) $(dts) $(obj)/ramdisk.image.gz | 174 | $(obj)/zImage.initrd.%: vmlinux $(wrapperbits) $(dts) |
176 | $(call if_changed,wrap,$*,$(dts),,$(obj)/ramdisk.image.gz) | 175 | $(call if_changed,wrap,$*,$(dts),,$(obj)/ramdisk.image.gz) |
177 | 176 | ||
178 | $(obj)/zImage.dts.%: vmlinux $(wrapperbits) $(dts) | 177 | $(obj)/zImage.%: vmlinux $(wrapperbits) $(dts) |
179 | $(call if_changed,wrap,$*,$(dts)) | 178 | $(call if_changed,wrap,$*,$(dts)) |
180 | 179 | ||
181 | $(obj)/zImage.initrd.%: vmlinux $(wrapperbits) | 180 | # This cannot be in the root of $(src) as the zImage rule always adds a $(obj) |
182 | $(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz) | 181 | # prefix |
183 | 182 | $(obj)/vmlinux.strip: vmlinux | |
184 | $(obj)/zImage.%: vmlinux $(wrapperbits) | ||
185 | $(call if_changed,wrap,$*) | ||
186 | |||
187 | $(obj)/zImage.iseries: vmlinux | ||
188 | $(STRIP) -s -R .comment $< -o $@ | 183 | $(STRIP) -s -R .comment $< -o $@ |
189 | 184 | ||
190 | $(obj)/zImage.ps3: vmlinux | 185 | $(obj)/zImage.iseries: vmlinux |
191 | $(STRIP) -s -R .comment $< -o $@ | 186 | $(STRIP) -s -R .comment $< -o $@ |
192 | 187 | ||
193 | $(obj)/zImage.initrd.ps3: vmlinux | 188 | $(obj)/zImage.ps3: vmlinux $(wrapper) $(wrapperbits) $(srctree)/$(src)/dts/ps3.dts |
194 | @echo " WARNING zImage.initrd.ps3 not supported (yet)" | 189 | $(STRIP) -s -R .comment $< -o vmlinux.strip |
195 | 190 | $(call cmd,wrap,ps3,$(srctree)/$(src)/dts/ps3.dts,,) | |
196 | $(obj)/zImage.holly-elf: vmlinux $(wrapperbits) | ||
197 | $(call if_changed,wrap,holly,$(obj)/dts/holly.dts,,) | ||
198 | 191 | ||
199 | $(obj)/zImage.initrd.holly-elf: vmlinux $(wrapperbits) $(obj)/ramdisk.image.gz | 192 | $(obj)/zImage.initrd.ps3: vmlinux $(wrapper) $(wrapperbits) $(srctree)/$(src)/dts/ps3.dts $(obj)/ramdisk.image.gz |
200 | $(call if_changed,wrap,holly,$(obj)/dts/holly.dts,,$(obj)/ramdisk.image.gz) | 193 | $(call cmd,wrap,ps3,$(srctree)/$(src)/dts/ps3.dts,,$(obj)/ramdisk.image.gz) |
201 | 194 | ||
202 | $(obj)/uImage: vmlinux $(wrapperbits) | 195 | $(obj)/uImage: vmlinux $(wrapperbits) |
203 | $(call if_changed,wrap,uboot) | 196 | $(call if_changed,wrap,uboot) |
204 | 197 | ||
205 | # CONFIG_DEVICE_TREE will have "" around it, make sure to strip them | ||
206 | dts = $(if $(shell echo $(CONFIG_DEVICE_TREE) | grep '^/'),\ | ||
207 | ,$(srctree)/$(src)/dts/)$(CONFIG_DEVICE_TREE:"%"=%) | ||
208 | |||
209 | $(obj)/cuImage.%: vmlinux $(dts) $(wrapperbits) | 198 | $(obj)/cuImage.%: vmlinux $(dts) $(wrapperbits) |
210 | $(call if_changed,wrap,cuboot-$*,$(dts)) | 199 | $(call if_changed,wrap,cuboot-$*,$(dts)) |
211 | 200 | ||
@@ -215,22 +204,22 @@ $(obj)/treeImage.initrd.%: vmlinux $(dts) $(wrapperbits) | |||
215 | $(obj)/treeImage.%: vmlinux $(dts) $(wrapperbits) | 204 | $(obj)/treeImage.%: vmlinux $(dts) $(wrapperbits) |
216 | $(call if_changed,wrap,treeboot-$*,$(dts)) | 205 | $(call if_changed,wrap,treeboot-$*,$(dts)) |
217 | 206 | ||
207 | # If there isn't a platform selected then just strip the vmlinux. | ||
208 | ifeq (,$(image-y)) | ||
209 | image-y := vmlinux.strip | ||
210 | endif | ||
211 | |||
218 | $(obj)/zImage: $(addprefix $(obj)/, $(image-y)) | 212 | $(obj)/zImage: $(addprefix $(obj)/, $(image-y)) |
219 | @rm -f $@; ln $< $@ | 213 | @rm -f $@; ln $< $@ |
220 | $(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y)) | 214 | $(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y)) |
221 | @rm -f $@; ln $< $@ | 215 | @rm -f $@; ln $< $@ |
222 | $(obj)/zImage.dts: $(addprefix $(obj)/, $(dts-y)) | ||
223 | @rm -f $@; ln $< $@ | ||
224 | $(obj)/zImage.dts_initrd: $(addprefix $(obj)/, $(dts_initrd-y)) | ||
225 | @rm -f $@; ln $< $@ | ||
226 | |||
227 | 216 | ||
228 | install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y)) | 217 | install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y)) |
229 | sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $< | 218 | sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $< |
230 | 219 | ||
231 | # anything not in $(targets) | 220 | # anything not in $(targets) |
232 | clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.* \ | 221 | clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.* treeImage.* \ |
233 | treeImage.* zImage.dts zImage.dts_initrd | 222 | otheros.bld |
234 | 223 | ||
235 | # clean up files cached by wrapper | 224 | # clean up files cached by wrapper |
236 | clean-kernel := vmlinux.strip vmlinux.bin | 225 | clean-kernel := vmlinux.strip vmlinux.bin |