Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.5.30 /Rules.make

Filename:/Rules.make
Lines Added:19
Lines Deleted:0
Also changed in: (Previous) 2.5.25  2.5.24  2.5.23  2.5.22  2.5.21  2.5.20 
(Following) 2.5.35  2.5.40  2.5.40-ac1  2.5.40-ac2  2.5.40-ac3  2.5.40-ac4 

Location
[  2.5.30
   o  Rules.make

Patch

diff -Nru a/Rules.make b/Rules.make
--- a/Rules.make   Thu Aug  1 14:17:40 2002
+++ b/Rules.make   Thu Aug  1 14:17:40 2002
@@ -553,3 +553,22 @@
 # If quiet is set, only print short version of command
 
 cmd = @$(if $($(quiet)cmd_$(1)),echo '  $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
+
+# do_cmd is a shorthand used to support both compressed, verbose
+# and silent output in a single line.
+# Compared to cmd described avobe, do_cmd does no rely on any variables 
+# previously assigned a value.
+#
+# Usage $(call do_cmd,CMD   $@,cmd_to_execute bla bla)
+# Example:
+# $(call do_cmd,CP $@,cp -b $< $@)
+# make -s => nothing will be printed
+# make KBUILD_VERBOSE=1 => cp -b path/to/src.file path/to/dest.file
+# make KBUILD_VERBOSE=0 =>   CP path/to/dest.file
+define do_cmd
+        @$(if $(filter quiet_,$(quiet)), echo '  $(1)' &&,
+           $(if $(filter silent_,$(quiet)),,
+             echo "$(2)" &&)) \
+        $(2)
+endef
+


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.