[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master b4dd6ce 06/16: Resolve an open issue
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master b4dd6ce 06/16: Resolve an open issue |
Date: |
Sat, 18 May 2019 20:53:36 -0400 (EDT) |
branch: master
commit b4dd6ce30a44878bf7f85e1c68d9cf9a412c3060
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Resolve an open issue
---
gwc/parent.make | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/gwc/parent.make b/gwc/parent.make
index 9440c07..4059652 100644
--- a/gwc/parent.make
+++ b/gwc/parent.make
@@ -1,15 +1,9 @@
-# IMPORTANT: the former 'env.make' has been replaced by
-# env.$(LMI_TIMESTAMP).eraseme
-# in the non-commented-out code, but not in any comments.
-# Yet 'env.make' remains as a target; is that target's name
-# actually arbitrary?
-
# This demonstration shows a way to source a script in a makefile,
# and export environment variables set by that script to make's
# environment, thus:
-# - add an 'env.make' prerequisite for the top-level makefile,
-# with recipe "$(eval include env.make)"
-# - add a phony target for 'env.make' that sources the script,
+# - add a 'source_env_vars' prerequisite for the top-level makefile,
+# with recipe "$(eval include <tmpfile-name>)"
+# - add a phony target for 'source_env_vars' that sources the script,
# then writes 'make' assignments like "export foo := bar"
# for each desired environment variable
# To test:
@@ -19,7 +13,7 @@
export LMI_TIMESTAMP := $(shell date -u +'%s.%N')
-parent.make parent.make:: env.make ;
+parent.make parent.make:: source_env_vars ;
$(eval include env.$(LMI_TIMESTAMP).eraseme)
@echo "eval: LMI_IN in 'parent.make': $$LMI_IN"
@echo "eval: LMI_OUT1 in 'parent.make': $$LMI_OUT1"
@@ -27,8 +21,8 @@ parent.make parent.make:: env.make ;
# '--force': the file won't be there when this makefile is remade
rm --force env.$(LMI_TIMESTAMP).eraseme
-.PHONY: env.make
-env.make:
+.PHONY: source_env_vars
+source_env_vars:
@echo "Sourcing 'set.sh'"
. ./set.sh
@echo "target: LMI_IN in 'parent.make': $$LMI_IN"
- [lmi-commits] [lmi] master 3ff6c00 16/16: Rewrite for clarity, (continued)
- [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, 2019/05/18
- [lmi-commits] [lmi] master b4dd6ce 06/16: Resolve an open issue,
Greg Chicares <=
- [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