lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 0401064 02/16: Set multiple variables


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 0401064 02/16: Set multiple variables
Date: Sat, 18 May 2019 20:53:35 -0400 (EDT)

branch: master
commit 0401064d7b120447d22a58068dc9a54fcc21eeec
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Set multiple variables
    
    Test thus, e.g.:
      $export LMI_IN=G; LANG=fr_CA make -f parent.make all
    It is important to make sure that multiple variables are set correctly.
---
 gwc/child.make  |  3 ++-
 gwc/parent.make | 11 +++++++----
 gwc/set.sh      |  9 ++++++---
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/gwc/child.make b/gwc/child.make
index 3c05987..431a1fb 100644
--- a/gwc/child.make
+++ b/gwc/child.make
@@ -1,4 +1,5 @@
 .PHONY: all
 all:
        @echo "LMI_IN in 'child.make': $$LMI_IN"
-       @echo "LMI_OUT in 'child.make': $$LMI_OUT"
+       @echo "LMI_OUT1 in 'child.make': $$LMI_OUT1"
+       @echo "LMI_OUT2 in 'child.make': $$LMI_OUT2"
diff --git a/gwc/parent.make b/gwc/parent.make
index e382efa..bc28e01 100644
--- a/gwc/parent.make
+++ b/gwc/parent.make
@@ -33,7 +33,8 @@ parent.make parent.make:: env.make ;
 # $(eval include) here is necessary and sufficient.
        $(eval include env.make)
        @echo "eval: LMI_IN in 'parent.make': $$LMI_IN"
-       @echo "eval: LMI_OUT in 'parent.make': $$LMI_OUT"
+       @echo "eval: LMI_OUT1 in 'parent.make': $$LMI_OUT1"
+       @echo "eval: LMI_OUT2 in 'parent.make': $$LMI_OUT2"
 
 # Doesn't execute recipe without ".PHONY":
 .PHONY: env.make
@@ -41,12 +42,14 @@ parent.make parent.make:: env.make ;
 #env.make: set.sh
 env.make:
        @echo "Sourcing 'set.sh'"
-       . ./set.sh ; echo "export LMI_OUT := $$LMI_OUT" > env.make
+       . ./set.sh ; echo "export LMI_OUT1 := $$LMI_OUT1\\nexport LMI_OUT2 := 
$$LMI_OUT2" > env.make
        @echo "target: LMI_IN in 'parent.make': $$LMI_IN"
-       @echo "target: LMI_OUT in 'parent.make': $$LMI_OUT ...but wait..."
+       @echo "target: LMI_OUT1 in 'parent.make': $$LMI_OUT1 ...but wait..."
+       @echo "target: LMI_OUT2 in 'parent.make': $$LMI_OUT2 ...but wait..."
 
 all:
-       @echo "LMI_OUT for targets in 'parent.make': $$LMI_OUT"
+       @echo "LMI_OUT1 for targets in 'parent.make': $$LMI_OUT1"
+       @echo "LMI_OUT2 for targets in 'parent.make': $$LMI_OUT2"
        $(MAKE) --no-print-directory -f child.make
 
 # Obviously one could simply write a cover script to replace direct
diff --git a/gwc/set.sh b/gwc/set.sh
index e6ece61..5333d8d 100755
--- a/gwc/set.sh
+++ b/gwc/set.sh
@@ -3,9 +3,12 @@
 foo()
 {
 echo "LMI_IN in 'set.sh': $LMI_IN"
-echo "LMI_OUT entering 'set.sh': $LMI_OUT"
-export LMI_OUT="$LMI_IN"
-echo "LMI_OUT leaving 'set.sh': $LMI_OUT"
+echo "LMI_OUT1 entering 'set.sh': $LMI_OUT1"
+echo "LMI_OUT2 entering 'set.sh': $LMI_OUT2"
+export LMI_OUT1="$LMI_IN"
+export LMI_OUT2="$LANG"
+echo "LMI_OUT1 leaving 'set.sh': $LMI_OUT1"
+echo "LMI_OUT2 leaving 'set.sh': $LMI_OUT2"
 }
 
 foo



reply via email to

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