[asterisk-commits] trunk r37744 - /trunk/Makefile.rules

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Jul 16 15:24:39 MST 2006


Author: rizzo
Date: Sun Jul 16 17:24:39 2006
New Revision: 37744

URL: http://svn.digium.com/view/asterisk?rev=37744&view=rev
Log:
use a couple of variables to remove duplicate definitions
of the various rules for the NOISY/!NOISY cases.

Approved by: kevin


Modified:
    trunk/Makefile.rules

Modified: trunk/Makefile.rules
URL: http://svn.digium.com/view/asterisk/trunk/Makefile.rules?rev=37744&r1=37743&r2=37744&view=diff
==============================================================================
--- trunk/Makefile.rules (original)
+++ trunk/Makefile.rules Sun Jul 16 17:24:39 2006
@@ -11,112 +11,72 @@
 # the GNU General Public License
 #
 
+# Each command is preceded by a short comment on what to do.
+# Prefixing one or the other with @\# or @ or nothing makes the desired
+# behaviour. ECHO_PREFIX prefixes the comment, CMD_PREFIX prefixes the command.
+
 ifeq ($(NOISY_BUILD),)
+   ECHO_PREFIX=@
+   CMD_PREFIX=@
+else
+   ECHO_PREFIX=@\# 
+   CMD_PREFIX=
+endif
 
 define ast_make_o_c
 $(1): $(2)
-	@echo "   [CC] $$< -> $$@"
-	@$$(CC) -o $$@ -c $$< $$(CFLAGS)
+	$(ECHO_PREFIX) echo "   [CC] $$< -> $$@"
+	$(CMD_PREFIX) $$(CC) -o $$@ -c $$< $$(CFLAGS)
 endef
 
 define ast_make_oo_cc
 $(1): $(2)
-	@echo "   [CXX] $$< -> $$@"
-	@$$(CXX) -o $$@ -c $$< $$(CFLAGS)
+	$(ECHO_PREFIX) echo "   [CXX] $$< -> $$@"
+	$(CMD_PREFIX) $$(CXX) -o $$@ -c $$< $$(CFLAGS)
 endef
 
 define ast_make_c_y
 $(1): $(2)
-	@echo "   [BISON] $$< -> $$@"
-	@bison -o $$@ -d --name-prefix=ast_yy $$<
+	$(ECHO_PREFIX) echo "   [BISON] $$< -> $$@"
+	$(CMD_PREFIX) bison -o $$@ -d --name-prefix=ast_yy $$<
 endef
 
 define ast_make_c_fl
 $(1): $(2)
-	@echo "   [FLEX] $$< -> $$@"
-	@flex -o $$@ --full $$<
+	$(ECHO_PREFIX) echo "   [FLEX] $$< -> $$@"
+	$(CMD_PREFIX) flex -o $$@ --full $$<
 endef
 
 define ast_make_so_o
 $(1): $(2)
-	@echo "   [LD] $$^ -> $$@"
-	@$$(CC) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
+	$(ECHO_PREFIX) echo "   [LD] $$^ -> $$@"
+	$(CMD_PREFIX) $$(CC) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
 endef
 
 define ast_make_so_oo
 $(1): $(2)
-	@echo "   [LDXX] $$^ -> $$@"
-	@$$(CXX) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
+	$(ECHO_PREFIX) echo "   [LDXX] $$^ -> $$@"
+	$(CMD_PREFIX) $$(CXX) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
 endef
 
 define ast_make_a_o
 $(1): $(2)
-	@echo "   [AR] $$^ -> $$@"
-	@$$(AR) cr $$@ $$^
-	@$$(RANLIB) $$@
+	$(ECHO_PREFIX) echo "   [AR] $$^ -> $$@"
+	$(CMD_PREFIX) $$(AR) cr $$@ $$^
+	$(CMD_PREFIX) $$(RANLIB) $$@
 endef
 
 define ast_make_final
 $(1): $(2)
-	@echo "   [LD] $$^ -> $$@"
-	@$$(CC) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
+	$(ECHO_PREFIX) echo "   [LD] $$^ -> $$@"
+	$(CMD_PREFIX) $$(CC) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
 endef
 
 define ast_make_final_host
 $(1): $(2)
-	@echo "   [LD] $$^ -> $$@"
-	@$$(HOST_CC) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
+	$(ECHO_PREFIX) echo "   [LD] $$^ -> $$@"
+	$(CMD_PREFIX) $$(HOST_CC) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
 endef
-
-else	# noisy build
-
-define ast_make_o_c
-$(1): $(2)
-	$$(CC) -o $$@ -c $$< $$(CFLAGS)
-endef
-
-define ast_make_oo_cc
-$(1): $(2)
-	$$(CXX) -o $$@ -c $$< $$(CFLAGS)
-endef
-
-define ast_make_c_y
-$(1): $(2)
-	bison -o $$@ -d --name-prefix=ast_yy $$<
-endef
-
-define ast_make_c_fl
-$(1): $(2)
-	flex -o $$@ --full $$<
-endef
-
-define ast_make_so_o
-$(1): $(2)
-	$$(CC) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
-endef
-
-define ast_make_so_oo
-$(1): $(2)
-	$$(CXX) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
-endef
-
-define ast_make_a_o
-$(1): $(2)
-	$$(AR) cr $$@ $$^
-	$$(RANLIB) $$@
-endef
-
-define ast_make_final
-$(1): $(2)
-	$$(CC) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
-endef
-
-define ast_make_final_host
-$(1): $(2)
-	$$(HOST_CC) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
-endef
-
-endif
 
 $(eval $(call ast_make_o_c,%.o,%.c))
 



More information about the asterisk-commits mailing list