[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/source_script_in_makefile 2bf1d5d 7/8: Remove du
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/source_script_in_makefile 2bf1d5d 7/8: Remove duplicated target name; improve documentation |
Date: |
Fri, 17 May 2019 21:31:39 -0400 (EDT) |
branch: odd/source_script_in_makefile
commit 2bf1d5d48d908d4a55fa93b1ba21c2b2c4e59048
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Remove duplicated target name; improve documentation
---
parent.make | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/parent.make b/parent.make
index df0414d..13c03cc 100644
--- a/parent.make
+++ b/parent.make
@@ -1,19 +1,20 @@
# 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:
+# environment:
+# - form a unique name $LMI_ENV_FILE for a file to hold the value
# - 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,
+# with recipe "$(eval include $LMI_ENV_FILE)"
+# - add a phony 'source_env_vars' target that sources the script,
# then writes 'make' assignments like "export foo := bar"
# for each desired environment variable
# To test:
-# $export LMI_IN=Russia; make -f parent.make all
+# $export LMI_IN=Russia; make -f parent.make all
# $export LMI_IN=Mongolia; make -f parent.make all
# and check what appears on stdout.
export LMI_ENV_FILE := env_$(shell date -u +'%s_%N').eraseme
-parent.make parent.make:: source_env_vars ;
+parent.make:: source_env_vars ;
$(eval include $(LMI_ENV_FILE))
@echo "eval: LMI_IN in 'parent.make': $$LMI_IN"
@echo "eval: LMI_OUT1 in 'parent.make': $$LMI_OUT1"
- [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, 2019/05/17
- [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 <=
- [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