diff options
author | Paul Smith <psmith@gnu.org> | 2013-09-29 13:15:00 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2013-09-29 13:15:00 -0400 |
commit | 543521cd475e7182e30a17bd032b9fe2bb740bcb (patch) | |
tree | fda9c6a2c91276cc5a847a1c9eeded682002a29a /main.c | |
parent | e8122ecb5d726e8b805a7854f844d9a4222f1564 (diff) | |
download | gunmake-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.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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); |