Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Milton Miller and committed by
Paul Mackerras
9da82a6d 5d7960ff

+24 -43
+24 -43
arch/powerpc/boot/Makefile
··· 116 116 endif 117 117 endif 118 118 119 + # args (to if_changed): 1 = (this rule), 2 = platform, 3 = dts 4=dtb 5=initrd 119 120 quiet_cmd_wrap = WRAP $@ 120 - cmd_wrap =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) vmlinux 121 - quiet_cmd_wrap_initrd = WRAP $@ 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) 121 + cmd_wrap =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \ 122 + $(if $3, -s $3)$(if $4, -d $4)$(if $5, -i $5) vmlinux 163 123 164 124 image-$(CONFIG_PPC_PSERIES) += zImage.pseries 165 125 image-$(CONFIG_PPC_MAPLE) += zImage.pseries ··· 139 179 140 180 initrd- := $(patsubst zImage%, zImage.initrd%, $(image-n) $(image-)) 141 181 initrd-y := $(patsubst zImage%, zImage.initrd%, $(image-y)) 182 + initrd-y := $(filter-out $(image-y), $(initrd-y)) 142 183 targets += $(image-y) $(initrd-y) 184 + 185 + $(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz 186 + 187 + # Don't put the ramdisk on the pattern rule; when its missing make will try 188 + # the pattern rule with less dependencies that also matches (even with the 189 + # hard dependency listed). 190 + $(obj)/zImage.initrd.%: vmlinux $(wrapperbits) 191 + $(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz) 192 + 193 + $(obj)/zImage.%: vmlinux $(wrapperbits) 194 + $(call if_changed,wrap,$*) 195 + 196 + $(obj)/zImage.ps3: vmlinux 197 + $(STRIP) -s -R .comment $< -o $@ 198 + 199 + $(obj)/zImage.initrd.ps3: vmlinux 200 + @echo " WARNING zImage.initrd.ps3 not supported (yet)" 201 + 202 + $(obj)/uImage: vmlinux $(wrapperbits) 203 + $(call if_changed,wrap,uboot) 143 204 144 205 $(obj)/zImage: $(addprefix $(obj)/, $(image-y)) 145 206 @rm -f $@; ln $< $@