common/makefiles/MakeBase.gmk
changeset 18425 768f15fff30a
parent 17661 55c5e0f7b9cc
child 20363 fa7663fc5d50
--- a/common/makefiles/MakeBase.gmk	Fri Jun 28 12:00:03 2013 +0200
+++ b/common/makefiles/MakeBase.gmk	Fri Jun 28 12:02:37 2013 +0200
@@ -332,9 +332,11 @@
         # Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
         # For each target executed, will print
         # Building <TARGET> (from <FIRST PREREQUISITE>) (<ALL NEWER PREREQUISITES> newer)
-        # but with a limit of 20 on <ALL NEWER PREREQUISITES>, to avoid cluttering logs too much (and causing a crash on Cygwin).
-        OLD_SHELL:=$$(SHELL)
-        WRAPPER_SHELL:=$$(OLD_SHELL) $$(SRC_ROOT)/common/bin/shell-tracer.sh $$(if $$(TIME),$$(TIME),-) $$(OUTPUT_ROOT)/build-trace-time.log $$(OLD_SHELL)
+        # but with a limit of 20 on <ALL NEWER PREREQUISITES>, to avoid cluttering logs too much 
+        # (and causing a crash on Cygwin).
+        # Default shell seems to always be /bin/sh. Must override with bash to get this to work on Solaris.
+        # Only use time if it's GNU time which supports format and output file.
+        WRAPPER_SHELL:=/bin/bash $$(SRC_ROOT)/common/bin/shell-tracer.sh $$(if $$(findstring yes,$$(IS_GNU_TIME)),$$(TIME),-) $$(OUTPUT_ROOT)/build-trace-time.log /bin/bash
         SHELL=$$(warning $$(if $$@,Building $$@,Running shell command) $$(if $$<, (from $$<))$$(if $$?, ($$(wordlist 1, 20, $$?) $$(if $$(wordlist 21, 22, $$?), ... [in total $$(words $$?) files]) newer)))$$(WRAPPER_SHELL)
     endif
     # Never remove warning messages; this is just for completeness