changeset 876:fa0dd2f5cda5 trunk

[svn] - rule reduction - add SHOW_CFLAGS option to show the CFLAGS used to compile each source unit
author nenolod
date Fri, 24 Mar 2006 14:20:04 -0800
parents c4240e36806f
children 82a978e884af
files mk/objective.mk
diffstat 1 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/mk/objective.mk	Fri Mar 24 13:31:38 2006 -0800
+++ b/mk/objective.mk	Fri Mar 24 14:20:04 2006 -0800
@@ -9,6 +9,7 @@
 SUBDIRS = none
 HEADERS = none
 VERBOSITY = 0
+SHOW_CFLAGS = 0
 
 LIBDIR = $(libdir)
 BINDIR = $(bindir)
@@ -158,19 +159,19 @@
 	fi
 
 .c.o:
-	printf "%10s     %-20s\n" CC $<
+	if test $(SHOW_CFLAGS) -eq 1; then	\
+		printf "%10s     %-20s (%s)\n" CC $< "${CFLAGS}";	\
+	else \
+		printf "%10s     %-20s\n" CC $<;	\
+	fi;
 	$(CC) $(CFLAGS) -c $< -o $@
 
-.cc.o:
-	printf "%10s     %-20s\n" CXX $<;
-	$(CXX) $(CXXFLAGS) -c $< -o $@
-
-.cpp.o:
-	printf "%10s     %-20s\n" CXX $<;
-	$(CXX) $(CXXFLAGS) -c $< -o $@
-
-.cxx.o:
-	printf "%10s     %-20s\n" CXX $<;
+.cc.o .cpp.o .cxx.o:
+	if test $(SHOW_CFLAGS) -eq 1; then	\
+		printf "%10s     %-20s (%s)\n" CXX $< "${CXXFLAGS}";	\
+	else \
+		printf "%10s     %-20s\n" CXX $<;	\
+	fi;
 	$(CXX) $(CXXFLAGS) -c $< -o $@
 
 %.so: $(OBJECTS)