From 543521cd475e7182e30a17bd032b9fe2bb740bcb Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 29 Sep 2013 13:15:00 -0400 Subject: 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. --- main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'main.c') 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); -- cgit v1.2.3