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
commit415840be4dc756e11dcd308cb88b807f0044d5b6 (patch)
treefda9c6a2c91276cc5a847a1c9eeded682002a29a /main.c
parent2759bfc91b69186d478142cf7b4df38b716bf321 (diff)
downloadmake-415840be4dc756e11dcd308cb88b807f0044d5b6.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 776ba7ce..13ded20c 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);