[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/source_script_in_makefile 3722813 3/8: Resolve a
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/source_script_in_makefile 3722813 3/8: Resolve an open issue |
Date: |
Fri, 17 May 2019 21:31:38 -0400 (EDT) |
branch: odd/source_script_in_makefile
commit 372281317c0456e77adf2424956be94341d33d78
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Resolve an open issue
---
parent.make | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/parent.make b/parent.make
index 9440c07..4059652 100644
--- a/parent.make
+++ b/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] odd/source_script_in_makefile updated (929fccb -> dcfc8bb), Greg Chicares, 2019/05/17
- [lmi-commits] [lmi] odd/source_script_in_makefile fc9727f 1/8: Construct a unique temporary filename to avoid collisions, Greg Chicares, 2019/05/17
- [lmi-commits] [lmi] odd/source_script_in_makefile 3722813 3/8: Resolve an open issue,
Greg Chicares <=
- [lmi-commits] [lmi] odd/source_script_in_makefile 2b6d26d 6/8: Don't write env file if its name is empty or unset, Greg Chicares, 2019/05/17
- [lmi-commits] [lmi] odd/source_script_in_makefile 20d830d 4/8: Name temporary environment-variables file OAOO, Greg Chicares, 2019/05/17
- [lmi-commits] [lmi] odd/source_script_in_makefile 2bf1d5d 7/8: Remove duplicated target name; improve documentation, Greg Chicares, 2019/05/17
- [lmi-commits] [lmi] odd/source_script_in_makefile dcfc8bb 8/8: Improve and compress output trace, Greg Chicares, 2019/05/17
- [lmi-commits] [lmi] odd/source_script_in_makefile 42d1373 2/8: Remove obsolete commentary, Greg Chicares, 2019/05/17
- [lmi-commits] [lmi] odd/source_script_in_makefile 23a86bd 5/8: Actually perform some work in the script, Greg Chicares, 2019/05/17