[PATCH 2/2] ppc64: makefile cleanup

Geoff Levand geoffrey.levand at am.sony.com
Thu Aug 11 10:57:42 EST 2005


Please consider for inclusion in the post 2.6.13 patches.

-Geoff



This patch cleans up the output generated by ppc64 builds.

Signed-off-by: Geoff Levand <geoffrey.levand at am.sony.com>


Index: linux-2.6.13-rc6.ppc64-makefile/arch/ppc64/boot/Makefile
===================================================================
--- linux-2.6.13-rc6.ppc64-makefile.orig/arch/ppc64/boot/Makefile	2005-08-10 17:34:01.000000000 -0700
+++ linux-2.6.13-rc6.ppc64-makefile/arch/ppc64/boot/Makefile	2005-08-10 17:34:09.000000000 -0700
@@ -66,7 +66,7 @@
 quiet_cmd_ramdisk = RAMDISK $@
       cmd_ramdisk = $(obj)/addRamDisk $(obj)/ramdisk.image.gz $< $@
 
-quiet_cmd_stripvm = STRIP $@
+quiet_cmd_stripvm = STRIP   $@
       cmd_stripvm = $(STRIP) -s $< -o $@
 
 vmlinux.strip: vmlinux FORCE
@@ -74,9 +74,17 @@
 $(obj)/vmlinux.initrd: vmlinux.strip $(obj)/addRamDisk $(obj)/ramdisk.image.gz FORCE
 	$(call if_changed,ramdisk)
 
-addsection = $(CROSS32OBJCOPY) $(1) \
-		--add-section=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $(1)))=$(patsubst %.o,%.gz, $(1)) \
-		--set-section-flags=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $(1)))=$(OBJCOPYFLAGS)
+quiet_cmd_addsection = ADDSEC  $@
+      cmd_addsection = $(CROSS32OBJCOPY) $@ \
+		--add-section=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $@))=$(patsubst %.o,%.gz, $@) \
+		--set-section-flags=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $@))=$(OBJCOPYFLAGS)
+
+quiet_cmd_imagesize = GENSIZE $@
+      cmd_imagesize = ls -l vmlinux.strip | \
+		awk '{printf "/* generated -- do not edit! */\n" "unsigned long vmlinux_filesize = %d;\n", $$5}' \
+		> $(obj)/imagesize.c && \
+		$(CROSS_COMPILE)nm -n vmlinux | tail -n 1 | \
+		awk '{printf "unsigned long vmlinux_memsize = 0x%s;\n", substr($$1,8)}' >> $(obj)/imagesize.c
 
 quiet_cmd_addnote = ADDNOTE $@
       cmd_addnote = $(obj)/addnote $@
@@ -88,11 +96,11 @@
 	cp -f $(obj)/ramdisk.image.gz $@
 
 $(call src-sec, $(required) $(initrd)): $(obj)/kernel-%.c: $(obj)/kernel-%.gz FORCE
-	touch $@
+	@touch $@
 
 $(call obj-sec, $(required) $(initrd)): $(obj)/kernel-%.o: $(obj)/kernel-%.c FORCE
 	$(call if_changed_dep,bootcc)
-	$(call addsection, $@)
+	$(call cmd,addsection)
 
 $(obj)/zImage: obj-boot += $(call obj-sec, $(required))
 $(obj)/zImage: $(call obj-sec, $(required)) $(obj-boot) FORCE
@@ -111,13 +119,7 @@
 	$(call if_changed,addnote)
 
 $(obj)/imagesize.c: vmlinux.strip
-	@echo Generating $@
-	ls -l vmlinux.strip | \
-	awk '{printf "/* generated -- do not edit! */\n" \
-		"unsigned long vmlinux_filesize = %d;\n", $$5}' > $(obj)/imagesize.c
-	$(CROSS_COMPILE)nm -n vmlinux | tail -n 1 | \
-	awk '{printf "unsigned long vmlinux_memsize = 0x%s;\n", substr($$1,8)}' \
-		>> $(obj)/imagesize.c
+	$(call cmd,imagesize)
 
 install: $(CONFIGURE) $(BOOTIMAGE)
 	sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" "$(BOOTIMAGE)"




More information about the Linuxppc64-dev mailing list