[PATCH] Fix Make warning about zImage multiple dependencies
Geoff Levand
geoffrey.levand at am.sony.com
Sat Sep 24 06:13:57 EST 2005
Paul,
This is against the current in kernel.org's ppc64-2.6.git.
It fixes the minor problem below and adds better multi-platform
image build support. Please apply.
Jimi Xenidis wrote:
> The patch from
> http://patchwork.ozlabs.org/linuxppc64/patch?id=2022
>
> Causes a make warning if multiple CONFIG_PPC_* cause zImage to be in
> the dependency line more than once.
>
> The following patch fixes it in a way that avoids complex if's, tho it
> may be a little obscure :)
>
I took Jimi's idea and did some more rework to better handle when
multiple CONFIG_PPC_ options are selected. Now it is possible to
build a multi-platform image and specify which platform to install:
$ make INSTALL_MOD_PATH=/target/g5 INSTALL_PATH=/target/g5/boot install-zImage.vmode
$ make INSTALL_MOD_PATH=/target/pseries INSTALL_PATH=/target/pseries/boot install-zImage
I also added some descriptive comments and lines for 'make help'.
-Geoff
Parts-by: Jimi Xenidis <jimix at watson.ibm.com>
Signed-off-by: Geoff Levand <geoffrey.levand at am.sony.com>
Index: ppc64-2.6.git.makefile/arch/ppc64/Makefile
===================================================================
--- ppc64-2.6.git.makefile.orig/arch/ppc64/Makefile 2005-09-23 12:29:57.000000000 -0700
+++ ppc64-2.6.git.makefile/arch/ppc64/Makefile 2005-09-23 13:06:21.000000000 -0700
@@ -89,29 +89,46 @@
boot := arch/ppc64/boot
-boottargets-$(CONFIG_PPC_PSERIES) += zImage zImage.initrd
-boottargets-$(CONFIG_PPC_PMAC) += zImage.vmode zImage.initrd.vmode
-boottargets-$(CONFIG_PPC_MAPLE) += zImage zImage.initrd
-boottargets-$(CONFIG_PPC_ISERIES) += vmlinux.sminitrd vmlinux.initrd vmlinux.sm
-boottargets-$(CONFIG_PPC_BPA) += zImage zImage.initrd
-$(boottargets-y): vmlinux
- $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
+# To assure a usable image is built these should accend in order
+# of dependence.
+defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
+defaultimage-$(CONFIG_PPC_PMAC) := vmlinux
+defaultimage-$(CONFIG_PPC_PSERIES) := zImage
+defaultimage-$(CONFIG_PPC_MAPLE) := zImage
+KBUILD_IMAGE := $(defaultimage-y)
+all: vmlinux $(KBUILD_IMAGE)
+# Note that there is a problem with this target when multiple
+# CONFIG_PPC_ options are selected.
+bootimage-$(CONFIG_PPC_BPA) := $(boot)/zImage
bootimage-$(CONFIG_PPC_PSERIES) := $(boot)/zImage
-bootimage-$(CONFIG_PPC_PMAC) := vmlinux
+bootimage-$(CONFIG_PPC_PMAC) := $(boot)/zImage.vmode
bootimage-$(CONFIG_PPC_MAPLE) := $(boot)/zImage
-bootimage-$(CONFIG_PPC_BPA) := zImage
bootimage-$(CONFIG_PPC_ISERIES) := vmlinux
BOOTIMAGE := $(bootimage-y)
install: vmlinux
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
-defaultimage-$(CONFIG_PPC_PSERIES) := zImage
-defaultimage-$(CONFIG_PPC_PMAC) := vmlinux
-defaultimage-$(CONFIG_PPC_MAPLE) := zImage
-defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
-KBUILD_IMAGE := $(defaultimage-y)
-all: $(KBUILD_IMAGE)
+# These targets handle build and install when multiple CONFIG_PPC_
+# options are selected.
+make-zImage-$(CONFIG_PPC_PSERIES) = y
+make-zImage-$(CONFIG_PPC_MAPLE) = y
+make-zImage-$(CONFIG_PPC_BPA) = y
+make-vmode-$(CONFIG_PPC_PMAC) = y
+make-vmlinux.sm-$(CONFIG_PPC_ISERIES) = y
+
+boottargets-$(make-vmlinux.sm-y) += vmlinux.sminitrd vmlinux.initrd vmlinux.sm
+boottargets-$(make-vmode-y) += zImage.vmode zImage.initrd.vmode
+boottargets-$(make-zImage-y) += zImage zImage.initrd
+
+$(boottargets-y): vmlinux
+ $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
+
+install-vmlinux: vmlinux
+ $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=vmlinux install
+
+$(patsubst %,install-%,$(boottargets-y)): vmlinux
+ $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(boot)/$(subst install-,,$@) install
archclean:
$(Q)$(MAKE) $(clean)=$(boot)
@@ -126,10 +143,16 @@
$(Q)ln -fsn $(srctree)/include/asm-powerpc arch/$(ARCH)/include/asm
define archhelp
- echo ' zImage.vmode - Compressed kernel image (arch/$(ARCH)/boot/zImage.vmode)'
- echo ' zImage.initrd.vmode - Compressed kernel image with initrd attached,'
- echo ' sourced from arch/$(ARCH)/boot/ramdisk.image.gz'
- echo ' (arch/$(ARCH)/boot/zImage.initrd.vmode)'
- echo ' zImage - zImage for pSeries machines'
- echo ' zImage.initrd - zImage with initrd for pSeries machines'
+ echo ' zImage.vmode - Compressed kernel image suitable for PowerMac'
+ echo ' machines ($(boot)/zImage.vmode)'
+ echo ' zImage.initrd.vmode - Compressed kernel image with initrd attached,'
+ echo ' sourced from $(boot)/ramdisk.image.gz'
+ echo ' ($(boot)/zImage.initrd.vmode)'
+ echo ' zImage - zImage for pSeries machines'
+ echo ' zImage.initrd - zImage with initrd for pSeries machines'
+ echo ''
+ echo ' install-zImage.vmode - Install $(boot)/zImage.vmode'
+ echo ' install-zImage.initrd.vmode - Install $(boot)/zImage.initrd.vmode'
+ echo ' install-zImage - Install $(boot)/zImage'
+ echo ' install-zImage.initrd - Install $(boot)/zImage.initrd'
endef
More information about the Linuxppc64-dev
mailing list