Trivial build cleanup

Adam Litke agl at us.ibm.com
Wed Nov 5 11:24:23 EST 2003


I was getting annoyed with all the junk printed when generating the
zImage so I converted the noisy commands over to the kbuild quiet_cmd
framework.  I was able to suppress the output of the imagesize.c target
but not in the normal way due to shell escaping issues.  Comments?

diff -purN linux-anton2/arch/ppc64/boot/Makefile linux-kbuild/arch/ppc64/boot/Makefile
--- linux-anton2/arch/ppc64/boot/Makefile	2003-09-01 17:57:59.000000000 -0700
+++ linux-kbuild/arch/ppc64/boot/Makefile	2003-11-04 16:02:24.000000000 -0800
@@ -98,12 +98,16 @@ $(call gz-sec, $(required)): $(obj)/kern
 $(obj)/kernel-initrd.gz: $(obj)/ramdisk.image.gz
 	cp -f $(obj)/ramdisk.image.gz $@

+quiet_cmd_touch = TOUCH   $@
+      cmd_touch = touch $@
 $(call src-sec, $(required) $(initrd)): $(obj)/kernel-%.c: $(obj)/kernel-%.gz FORCE
-	touch $@
+	$(call cmd,touch)

+quiet_cmd_addsect = OBJCOPY $@
+      cmd_addsect = $(call addsection, $@)
 $(call obj-sec, $(required) $(initrd)): $(obj)/kernel-%.o: $(obj)/kernel-%.c FORCE
 	$(call if_changed_dep,bootcc)
-	$(call addsection, $@)
+	$(call cmd,addsect)

 $(obj)/zImage: obj-boot += $(call obj-sec, $(required))
 $(obj)/zImage: $(call obj-sec, $(required)) $(obj-boot) $(obj)/addnote FORCE
@@ -113,14 +117,17 @@ $(obj)/zImage.initrd: obj-boot += $(call
 $(obj)/zImage.initrd: $(call obj-sec, $(required) $(initrd)) $(obj-boot) $(obj)/addnote FORCE
 	$(call if_changed,addnote)

-$(obj)/imagesize.c: vmlinux
-	@echo Generating $@
+define mkimgsize
 	ls -l vmlinux | \
 	awk '{printf "/* generated -- do not edit! */\n" \
-		"unsigned long vmlinux_filesize = %d;\n", $$5}' > $(obj)/imagesize.c
+		"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
+endef
+$(obj)/imagesize.c: vmlinux
+	@echo '  GEN     $@'
+	$(shell $(mkimgsize))

 install: $(CONFIGURE) $(obj)/$(BOOTIMAGE)
 	sh -x $(src)/install.sh "$(KERNELRELEASE)" "$(obj)/$(BOOTIMAGE)" "$(TOPDIR)/System.map" "$(INSTALL_PATH)"
--
Adam Litke (agl at us.ibm.com)
IBM Linux Technology Center
(503) 578 - 3283 t/l 775 - 3283


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list