[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 315d415 03/16: Improve encapsulation
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 315d415 03/16: Improve encapsulation |
Date: |
Sat, 18 May 2019 20:53:35 -0400 (EDT) |
branch: master
commit 315d415d7d88df1da059bb419a1c07fd43336525
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.
---
gwc/parent.make | 2 +-
gwc/set.sh | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gwc/parent.make b/gwc/parent.make
index bc28e01..09eefce 100644
--- a/gwc/parent.make
+++ b/gwc/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/gwc/set.sh b/gwc/set.sh
index 5333d8d..8ae899a 100755
--- a/gwc/set.sh
+++ b/gwc/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
- [lmi-commits] [lmi] master 8b0a768 14/16: Invoke 'rm' without '--force', (continued)
- [lmi-commits] [lmi] master 8b0a768 14/16: Invoke 'rm' without '--force', Greg Chicares, 2019/05/18
- [lmi-commits] [lmi] master 3ff6c00 16/16: Rewrite for clarity, Greg Chicares, 2019/05/18
- [lmi-commits] [lmi] master fa96c05 13/16: Make tracing information easier to follow, Greg Chicares, 2019/05/18
- [lmi-commits] [lmi] master f8d4676 11/16: Improve and compress output trace, Greg Chicares, 2019/05/18
- [lmi-commits] [lmi] master b00ad83 10/16: Remove duplicated target name; improve documentation, Greg Chicares, 2019/05/18
- [lmi-commits] [lmi] master 0ca7d61 09/16: Don't write env file if its name is empty or unset, Greg Chicares, 2019/05/18
- [lmi-commits] [lmi] master 294f232 12/16: Improve documentation, Greg Chicares, 2019/05/18
- [lmi-commits] [lmi] master c10b229 08/16: Actually perform some work in the script, Greg Chicares, 2019/05/18
- [lmi-commits] [lmi] master a87426e 07/16: Name temporary environment-variables file OAOO, Greg Chicares, 2019/05/18
- [lmi-commits] [lmi] master 01aee1e 04/16: Construct a unique temporary filename to avoid collisions, Greg Chicares, 2019/05/18
- [lmi-commits] [lmi] master 315d415 03/16: Improve encapsulation,
Greg Chicares <=
- [lmi-commits] [lmi] master b4dd6ce 06/16: Resolve an open issue, Greg Chicares, 2019/05/18
- [lmi-commits] [lmi] master 65cbb2f 05/16: Remove obsolete commentary, Greg Chicares, 2019/05/18
- [lmi-commits] [lmi] master 6eace72 01/16: Source a shell script in a makefile, Greg Chicares, 2019/05/18
- [lmi-commits] [lmi] master 0401064 02/16: Set multiple variables, Greg Chicares, 2019/05/18