[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] odd/source_script_in_makefile dcfc8bb 8/8: Improve a

From: Greg Chicares
Subject: [lmi-commits] [lmi] odd/source_script_in_makefile dcfc8bb 8/8: Improve and compress output trace
Date: Fri, 17 May 2019 21:31:39 -0400 (EDT)

branch: odd/source_script_in_makefile
commit dcfc8bb4d3236b00aeb315b81655d2b979d0d746
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Improve and compress output trace
    Made the 'source_env_vars' recipe a single statement so that sourced
    values are displayed. Consolidated other display statements for brevity.
    For production use, of course, such statements are to be removed.
 child.make  |  4 +---
 parent.make | 15 +++++----------
 set.sh      |  7 ++-----
 3 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/child.make b/child.make
index 431a1fb..81fe44e 100644
--- a/child.make
+++ b/child.make
@@ -1,5 +1,3 @@
 .PHONY: all
-       @echo "LMI_IN in 'child.make': $$LMI_IN"
-       @echo "LMI_OUT1 in 'child.make': $$LMI_OUT1"
-       @echo "LMI_OUT2 in 'child.make': $$LMI_OUT2"
+       @echo "targets in 'child.make': LMI_IN $$LMI_IN; LMI_OUT1 $$LMI_OUT1; 
diff --git a/parent.make b/parent.make
index 13c03cc..4ac8d4d 100644
--- a/parent.make
+++ b/parent.make
@@ -16,23 +16,18 @@ export LMI_ENV_FILE := env_$(shell date -u +'%s_%N').eraseme
 parent.make:: source_env_vars ;
        $(eval include $(LMI_ENV_FILE))
-       @echo "eval: LMI_IN in 'parent.make': $$LMI_IN"
-       @echo "eval: LMI_OUT1 in 'parent.make': $$LMI_OUT1"
-       @echo "eval: LMI_OUT2 in 'parent.make': $$LMI_OUT2"
+       @echo "eval in 'parent.make': LMI_IN $$LMI_IN; LMI_OUT1 $$LMI_OUT1; 
 # '--force': the file won't be there when this makefile is remade
        rm --force $(LMI_ENV_FILE)
 .PHONY: source_env_vars
-       @echo "Sourcing 'set.sh'"
-       . ./set.sh
-       @echo "target: LMI_IN in 'parent.make': $$LMI_IN"
-       @echo "target: LMI_OUT1 in 'parent.make': $$LMI_OUT1 ...but wait..."
-       @echo "target: LMI_OUT2 in 'parent.make': $$LMI_OUT2 ...but wait..."
+       @echo "Sourcing 'set.sh'"; \
+       . ./set.sh ; \
+       echo "sourced in 'parent.make': LMI_IN $$LMI_IN; LMI_OUT1 $$LMI_OUT1; 
-       @echo "LMI_OUT1 for targets in 'parent.make': $$LMI_OUT1"
-       @echo "LMI_OUT2 for targets in 'parent.make': $$LMI_OUT2"
+       @echo "targets in 'parent.make': LMI_IN $$LMI_IN; LMI_OUT1 $$LMI_OUT1; 
        $(MAKE) --no-print-directory -f child.make
 # Obviously one could simply write a cover script to replace direct
diff --git a/set.sh b/set.sh
index 73e2f1d..9229288 100755
--- a/set.sh
+++ b/set.sh
@@ -5,9 +5,7 @@ foo()
 # $LMI_ENV_FILE is defined by the makefile that sources this script.
 # shellcheck disable=SC2154
 echo "LMI_ENV_FILE in 'set.sh': $LMI_ENV_FILE"
-echo "LMI_IN in 'set.sh': $LMI_IN"
-echo "LMI_OUT1 entering 'set.sh': $LMI_OUT1"
-echo "LMI_OUT2 entering 'set.sh': $LMI_OUT2"
+echo "entering 'set.sh': LMI_IN $LMI_IN; LMI_OUT1 $LMI_OUT1; LMI_OUT2 
 export LMI_OUT1="$LMI_IN"
 export LMI_OUT2="$LANG"
@@ -17,8 +15,7 @@ case "$LMI_IN" in
     (*) ;;
-echo "LMI_OUT1 leaving 'set.sh': $LMI_OUT1"
-echo "LMI_OUT2 leaving 'set.sh': $LMI_OUT2"
+echo "leaving 'set.sh': LMI_IN $LMI_IN; LMI_OUT1 $LMI_OUT1; LMI_OUT2 $LMI_OUT2"
 if [ -n "$LMI_ENV_FILE" ]; then
     echo "export LMI_OUT1 := $LMI_OUT1"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]