summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
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);