summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-09-29 13:15:00 -0400
committerPaul Smith <psmith@gnu.org>2013-09-29 13:15:00 -0400
commit543521cd475e7182e30a17bd032b9fe2bb740bcb (patch)
treefda9c6a2c91276cc5a847a1c9eeded682002a29a /main.c
parente8122ecb5d726e8b805a7854f844d9a4222f1564 (diff)
downloadgunmake-543521cd475e7182e30a17bd032b9fe2bb740bcb.tar.gz
Reset GNUMAKEFLAGS after parsing.
If we don't do this we'll continually add flags on recursion. This is mainly for users to set in their environment before invoking make.
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/main.c b/main.c
index 776ba7c..13ded20 100644
--- a/main.c
+++ b/main.c
@@ -1396,6 +1396,10 @@ main (int argc, char **argv, char **envp)
/* Decode the switches. */
decode_env_switches (STRING_SIZE_TUPLE ("GNUMAKEFLAGS"));
+
+ /* Clear GNUMAKEFLAGS to avoid duplication. */
+ define_variable_cname ("GNUMAKEFLAGS", "", o_env, 0);
+
decode_env_switches (STRING_SIZE_TUPLE ("MAKEFLAGS"));
/* In output sync mode we need to sync any output generated by reading the
@@ -1931,12 +1935,16 @@ main (int argc, char **argv, char **envp)
/* Decode switches again, for variables set by the makefile. */
decode_env_switches (STRING_SIZE_TUPLE ("GNUMAKEFLAGS"));
+
+ /* Clear GNUMAKEFLAGS to avoid duplication. */
+ define_variable_cname ("GNUMAKEFLAGS", "", o_override, 0);
+
decode_env_switches (STRING_SIZE_TUPLE ("MAKEFLAGS"));
#if 0
decode_env_switches (STRING_SIZE_TUPLE ("MFLAGS"));
#endif
- /* Reset in case the switches changed our minds. */
+ /* Reset in case the switches changed our mind. */
syncing = (output_sync == OUTPUT_SYNC_LINE
|| output_sync == OUTPUT_SYNC_TARGET);