[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/source_script_in_makefile 929fccb 2/2: Improve e
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/source_script_in_makefile 929fccb 2/2: Improve encapsulation |
Date: |
Fri, 17 May 2019 14:30:36 -0400 (EDT) |
branch: odd/source_script_in_makefile
commit 929fccbbcf65d3b3a7fbe7fee0bc66421d217c54
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Improve encapsulation
The list of environment variables may change over time. Maintenance is
easier if this list appears in one file rather than two.
It is also nicer to write shell code in scripts than in makefiles where
dollar signs must be doubled.
---
parent.make | 2 +-
set.sh | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/parent.make b/parent.make
index bc28e01..09eefce 100644
--- a/parent.make
+++ b/parent.make
@@ -42,7 +42,7 @@ parent.make parent.make:: env.make ;
#env.make: set.sh
env.make:
@echo "Sourcing 'set.sh'"
- . ./set.sh ; echo "export LMI_OUT1 := $$LMI_OUT1\\nexport LMI_OUT2 :=
$$LMI_OUT2" > env.make
+ . ./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..."
diff --git a/set.sh b/set.sh
index 5333d8d..8ae899a 100755
--- a/set.sh
+++ b/set.sh
@@ -9,6 +9,10 @@ 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"
+{
+ echo "export LMI_OUT1 := $LMI_OUT1"
+ echo "export LMI_OUT2 := $LMI_OUT2"
+} > env.make
}
foo