summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2020-11-28 12:30:08 -0500
committerPaul Smith <psmith@gnu.org>2020-11-29 17:57:33 -0500
commit2dc0280d82dd11bc6bb06363f27dd7739ee8a371 (patch)
tree017b43eac595635e7a3de307a5886adf6489a57b /doc
parent90959b8b70be9d81bb559f51a3a894d80dc5d469 (diff)
downloadmake-git-2dc0280d82dd11bc6bb06363f27dd7739ee8a371.tar.gz
Support "unexport" in target-specific variables.
Rewrite the environment variable algorithm to correctly inherit export settings from parent variable sets. The new algorithm for computing the table of environment variables is: - Start with the most local variable set and proceed to global. - If the variable already exists in the table and we don't know its export status, update it with the current variable's status. - If the variable is not in the table and it's not global, add it regardless of its status so if it's unexported we remember that. - If the variable is not in the table and is global, check its export status and don't add it if we won't export it. Then when generating the environment variables, check the export status of each variable in case it was a target-specific variable and we have determined it should not be exported. Rework SHELL handling to check at the end whether we added it or not and if we didn't, add the value from the environment. * NEWS: Announce support for target-specific "unexport"." * doc/make.texi (Target-specific): Document the support. * src/variable.h (enum variable_export): Make into a global type. * src/read.c (struct vmodifiers): Use enum variable_export rather than individual booleans. (parse_var_assignment): Parse the "unexport" keyword. (eval): Remember the vmodifier value in the variable. (record_target_var): Ditto. * src/variable.c (should_export): Check if the variable should be exported. (target_environment): Implement the above algorithm. * tests/scripts/features/export: Test export/unexport with variable assignments on the same line. * tests/scripts/features/targetvars: Add a comprehensive suite of tests for different types of target-specific export / unexport. * tests/scripts/variables/SHELL: Update the comment.
Diffstat (limited to 'doc')
-rw-r--r--doc/make.texi5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/make.texi b/doc/make.texi
index 8bf3a469..45b51002 100644
--- a/doc/make.texi
+++ b/doc/make.texi
@@ -6283,8 +6283,9 @@ Set a target-specific variable value like this:
@end example
Target-specific variable assignments can be prefixed with any or all of the
-special keywords @code{export}, @code{override}, or @code{private};
-these apply their normal behavior to this instance of the variable only.
+special keywords @code{export}, @code{unexport}, @code{override}, or
+@code{private}; these apply their normal behavior to this instance of the
+variable only.
Multiple @var{target} values create a target-specific variable value for
each member of the target list individually.