aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/Makefile
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2007-03-21 11:03:23 -0400
committerPaul Mackerras <paulus@samba.org>2007-03-26 01:11:20 -0400
commit9da82a6dee9db4cd5ae7a74ab4f51afb52b6efb9 (patch)
tree0ad8283a5c7da95aee75185da5d5c1a7d65a9522 /arch/powerpc/boot/Makefile
parent5d7960ffb8157acdf92223e32d34da504578aca0 (diff)
[POWERPC] boot: Use a common zImage rule
Before the plethora of platforms gets any worse, establish a common rule to invoke the wrapper for any platform. Add arguments to the rule for initrd, dts, dtb, etc. Show example usage with initrd. Create default rules for zImage, and zImage.initrd. initrd targets depend on the ramdisk file. Don't consider targets for zImage.initrd that are targets for zImage. This means uImage is no longer considered a target for zImage.initrd. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot/Makefile')
-rw-r--r--arch/powerpc/boot/Makefile67
1 files changed, 24 insertions, 43 deletions
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 1dc7f2bb2b96..de80e47d1171 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -116,50 +116,10 @@ CROSSWRAP := -C "$(CROSS_COMPILE)"
116endif 116endif
117endif 117endif
118 118
119# args (to if_changed): 1 = (this rule), 2 = platform, 3 = dts 4=dtb 5=initrd
119quiet_cmd_wrap = WRAP $@ 120quiet_cmd_wrap = WRAP $@
120 cmd_wrap =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) vmlinux 121 cmd_wrap =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \
121quiet_cmd_wrap_initrd = WRAP $@ 122 $(if $3, -s $3)$(if $4, -d $4)$(if $5, -i $5) vmlinux
122 cmd_wrap_initrd =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \
123 -i $(obj)/ramdisk.image.gz vmlinux
124
125$(obj)/zImage.chrp: vmlinux $(wrapperbits)
126 $(call if_changed,wrap,chrp)
127
128$(obj)/zImage.initrd.chrp: vmlinux $(wrapperbits)
129 $(call if_changed,wrap_initrd,chrp)
130
131$(obj)/zImage.pseries: vmlinux $(wrapperbits)
132 $(call if_changed,wrap,pseries)
133
134$(obj)/zImage.initrd.pseries: vmlinux $(wrapperbits)
135 $(call if_changed,wrap_initrd,pseries)
136
137$(obj)/zImage.pmac: vmlinux $(wrapperbits)
138 $(call if_changed,wrap,pmac)
139
140$(obj)/zImage.initrd.pmac: vmlinux $(wrapperbits)
141 $(call if_changed,wrap_initrd,pmac)
142
143$(obj)/zImage.coff: vmlinux $(wrapperbits)
144 $(call if_changed,wrap,pmaccoff)
145
146$(obj)/zImage.initrd.coff: vmlinux $(wrapperbits)
147 $(call if_changed,wrap_initrd,pmaccoff)
148
149$(obj)/zImage.miboot: vmlinux $(wrapperbits)
150 $(call if_changed,wrap,miboot)
151
152$(obj)/zImage.initrd.miboot: vmlinux $(wrapperbits)
153 $(call if_changed,wrap_initrd,miboot)
154
155$(obj)/zImage.ps3: vmlinux
156 $(STRIP) -s -R .comment $< -o $@
157
158$(obj)/zImage.initrd.ps3: vmlinux
159 @echo " WARNING zImage.initrd.ps3 not supported (yet)"
160
161$(obj)/uImage: vmlinux $(wrapperbits)
162 $(call if_changed,wrap,uboot)
163 123
164image-$(CONFIG_PPC_PSERIES) += zImage.pseries 124image-$(CONFIG_PPC_PSERIES) += zImage.pseries
165image-$(CONFIG_PPC_MAPLE) += zImage.pseries 125image-$(CONFIG_PPC_MAPLE) += zImage.pseries
@@ -179,8 +139,29 @@ endif
179 139
180initrd- := $(patsubst zImage%, zImage.initrd%, $(image-n) $(image-)) 140initrd- := $(patsubst zImage%, zImage.initrd%, $(image-n) $(image-))
181initrd-y := $(patsubst zImage%, zImage.initrd%, $(image-y)) 141initrd-y := $(patsubst zImage%, zImage.initrd%, $(image-y))
142initrd-y := $(filter-out $(image-y), $(initrd-y))
182targets += $(image-y) $(initrd-y) 143targets += $(image-y) $(initrd-y)
183 144
145$(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz
146
147# Don't put the ramdisk on the pattern rule; when its missing make will try
148# the pattern rule with less dependencies that also matches (even with the
149# hard dependency listed).
150$(obj)/zImage.initrd.%: vmlinux $(wrapperbits)
151 $(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz)
152
153$(obj)/zImage.%: vmlinux $(wrapperbits)
154 $(call if_changed,wrap,$*)
155
156$(obj)/zImage.ps3: vmlinux
157 $(STRIP) -s -R .comment $< -o $@
158
159$(obj)/zImage.initrd.ps3: vmlinux
160 @echo " WARNING zImage.initrd.ps3 not supported (yet)"
161
162$(obj)/uImage: vmlinux $(wrapperbits)
163 $(call if_changed,wrap,uboot)
164
184$(obj)/zImage: $(addprefix $(obj)/, $(image-y)) 165$(obj)/zImage: $(addprefix $(obj)/, $(image-y))
185 @rm -f $@; ln $< $@ 166 @rm -f $@; ln $< $@
186$(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y)) 167$(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y))