diff options
-rw-r--r-- | clean.mk | 2 | ||||
-rw-r--r-- | dist.mk | 2 | ||||
-rw-r--r-- | install.mk | 6 | ||||
-rw-r--r-- | jars.mk | 4 | ||||
-rw-r--r-- | lib.mk | 2 | ||||
-rw-r--r-- | libraries.mk | 6 | ||||
-rw-r--r-- | patterns.mk | 6 | ||||
-rw-r--r-- | programs.mk | 4 | ||||
-rw-r--r-- | templates.mk | 2 | ||||
-rw-r--r-- | tracing.mk | 16 |
10 files changed, 33 insertions, 17 deletions
@@ -1,7 +1,7 @@ clean_files := clean: - $(QUIET) rm -fv -- $(clean_files) + $(suppress) rm -fv -- $(clean_files) dryclean: @for i in $(clean_files); do if [ -e $$i ]; then echo $$i; fi; done | sort @@ -7,7 +7,7 @@ dist_files := dist: $(dist_name).tar.bz2 $(dist_name).tar.bz2: $(dist_files) - $(QUIET) tar cvfj $@ $(dist_files) --transform 's,^,$(dist_name)/,' + $(suppress) tar cvfj $@ $(dist_files) --transform 's,^,$(dist_name)/,' clean_files += $(dist_name).tar.bz2 diff --git a/install.mk b/install.mk index c5eb8eb37..aee4bf38b 100644 --- a/install.mk +++ b/install.mk @@ -4,7 +4,7 @@ define create-dir = ifndef $(1)_SEEN $(1)_SEEN = 1 $(1): - $(QUIET) install -d $(1) + $$(trace-install) install -d $(1) endif endef @@ -18,7 +18,7 @@ define install-file-as = $$(eval $$(call create-dir,$$(dir $(2)))) $(2): $(1) | $$(dir $(2)) - $(QUIET) install -m $(3) $(1) $(2) + $$(trace-install) install -m $(3) $(1) $(2) endef @@ -48,6 +48,6 @@ define install-symlink = $$(eval $$(call create-dir,$$(dir $(2)))) $(2): | $$(dir $(2)) - $(QUIET) ln -sfn $(1) $(2) + $$(trace-install) ln -sfn $(1) $(2) endef @@ -10,8 +10,8 @@ define build-jar = $$($(1)_PATH): $$($(1)_SOURCES) @rm -rf $$($(1)_TMPDIR) @mkdir -p $$($(1)_TMPDIR) - $(QUIET) javac $(GLOBAL_JAVACFLAGS) $$($(1)_JAVACFLAGS) -d $$($(1)_TMPDIR) $$($(1)_SOURCES) - $(QUIET) jar cf $$($(1)_PATH) -C $$($(1)_TMPDIR) . + $$(trace-javac) javac $(GLOBAL_JAVACFLAGS) $$($(1)_JAVACFLAGS) -d $$($(1)_TMPDIR) $$($(1)_SOURCES) + $$(trace-jar) jar cf $$($(1)_PATH) -C $$($(1)_TMPDIR) . @rm -rf $$($(1)_TMPDIR) $(1)_INSTALL_DIR ?= $$(libdir)/java @@ -6,7 +6,6 @@ default: all # Initialise some variables. -QUIET = @ bin_SCRIPTS := noinst_SCRIPTS := OS = $(shell uname -s) @@ -49,6 +48,7 @@ endif rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d)) +include mk/tracing.mk include mk/clean.mk include mk/dist.mk include mk/install.mk diff --git a/libraries.mk b/libraries.mk index 818c3d217..1e0fe49a5 100644 --- a/libraries.mk +++ b/libraries.mk @@ -65,7 +65,7 @@ define build-library = $(1)_PATH := $$(_d)/$$($(1)_NAME).$(SO_EXT) $$($(1)_PATH): $$($(1)_OBJS) $$(_libs) - $(QUIET) $(CXX) -o $$@ -shared $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$($(1)_LDFLAGS_PROPAGATED) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE)) + $$(trace-ld) $(CXX) -o $$@ -shared $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$($(1)_LDFLAGS_PROPAGATED) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE)) $(1)_LDFLAGS_USE += -L$$(_d) -Wl,-rpath,$$(abspath $$(_d)) -l$$(patsubst lib%,%,$$(strip $$($(1)_NAME))) @@ -76,7 +76,7 @@ define build-library = $$(eval $$(call create-dir,$$($(1)_INSTALL_DIR))) $$($(1)_INSTALL_PATH): $$($(1)_OBJS) $$(_libs_final) | $$($(1)_INSTALL_DIR) - $(QUIET) $(CXX) -o $$@ -shared $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$($(1)_LDFLAGS_PROPAGATED) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE_INSTALLED)) + $$(trace-ld) $(CXX) -o $$@ -shared $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$($(1)_LDFLAGS_PROPAGATED) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE_INSTALLED)) $(1)_LDFLAGS_USE_INSTALLED += -L$$($(1)_INSTALL_DIR) -Wl,-rpath,$$($(1)_INSTALL_DIR) -l$$(patsubst lib%,%,$$(strip $$($(1)_NAME))) @@ -89,7 +89,7 @@ define build-library = $(1)_PATH := $$(_d)/$$($(1)_NAME).a $$($(1)_PATH): $$($(1)_OBJS) - $(QUIET) ar crs $$@ $$? + $(trace-ar) ar crs $$@ $$? $(1)_LDFLAGS_USE += $$($(1)_PATH) $$($(1)_LDFLAGS) diff --git a/patterns.mk b/patterns.mk index 77e172136..91a758f33 100644 --- a/patterns.mk +++ b/patterns.mk @@ -1,8 +1,8 @@ %.o: %.cc - $(QUIET) $(CXX) -o $@ -c $< $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(basename $@).dep -MP + $(trace-cxx) $(CXX) -o $@ -c $< $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(basename $@).dep -MP %.o: %.cpp - $(QUIET) $(CXX) -o $@ -c $< $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(basename $@).dep -MP + $(trace-cxx) $(CXX) -o $@ -c $< $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(basename $@).dep -MP %.o: %.c - $(QUIET) $(CC) -o $@ -c $< $(GLOBAL_CFLAGS) $(CFLAGS) $($@_CFLAGS) -MMD -MF $(basename $@).dep -MP + $(trace-cc) $(CC) -o $@ -c $< $(GLOBAL_CFLAGS) $(CFLAGS) $($@_CFLAGS) -MMD -MF $(basename $@).dep -MP diff --git a/programs.mk b/programs.mk index a97a51635..c608a6f25 100644 --- a/programs.mk +++ b/programs.mk @@ -23,7 +23,7 @@ define build-program = $(1)_PATH := $$(_d)/$(1) $$($(1)_PATH): $$($(1)_OBJS) $$(_libs) - $(QUIET) $(CXX) -o $$@ $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE)) + $$(trace-ld) $(CXX) -o $$@ $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE)) $(1)_INSTALL_DIR ?= $$(bindir) $(1)_INSTALL_PATH := $$($(1)_INSTALL_DIR)/$(1) @@ -37,7 +37,7 @@ define build-program = _libs_final := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_INSTALL_PATH)) $$($(1)_INSTALL_PATH): $$($(1)_OBJS) $$(_libs_final) | $$($(1)_INSTALL_DIR) - $(QUIET) $(CXX) -o $$@ $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE_INSTALLED)) + $$(trace-ld) $(CXX) -o $$@ $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE_INSTALLED)) else diff --git a/templates.mk b/templates.mk index 01b9d9d74..82f9d6025 100644 --- a/templates.mk +++ b/templates.mk @@ -9,4 +9,4 @@ define instantiate-template = endef %: %.in - $(QUIET) ./config.status --quiet --file $@ + $(trace-gen) ./config.status --quiet --file $@ diff --git a/tracing.mk b/tracing.mk new file mode 100644 index 000000000..08c4ec106 --- /dev/null +++ b/tracing.mk @@ -0,0 +1,16 @@ +V ?= 0 + +ifeq ($(V), 0) + + trace-gen = @echo " GEN " $@; + trace-cc = @echo " CC " $@; + trace-cxx = @echo " CXX " $@; + trace-ld = @echo " LD " $@; + trace-ar = @echo " AR " $@; + trace-install = @echo " INST " $@; + trace-javac = @echo " JAVAC " $@; + trace-jar = @echo " JAR " $@; + + suppress = @ + +endif |