summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1995-08-10 23:58:12 +0000
committerRoland McGrath <roland@redhat.com>1995-08-10 23:58:12 +0000
commit78ac5bd9c71414cad7248943f28d964a63529ec3 (patch)
treefe25c93e7a80ccbe078adc282227812683571dc8 /main.c
parent030d31ba93c25ff635290e02ee16a1da3dd977bf (diff)
downloadgunmake-78ac5bd9c71414cad7248943f28d964a63529ec3.tar.gz
(define_makeflags): Omit command line variable definitions from MFLAGS
value.
Diffstat (limited to 'main.c')
-rw-r--r--main.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/main.c b/main.c
index 2c92793..4cfb4d7 100644
--- a/main.c
+++ b/main.c
@@ -1778,6 +1778,24 @@ define_makeflags (all, makefile)
flags = flags->next;
}
+
+ /* Define MFLAGS before appending variable definitions. */
+
+ if (p == &flagstring[1])
+ /* No flags. */
+ flagstring[0] = '\0';
+ else if (p[-1] == '-')
+ /* Kill the final space and dash. */
+ p[-2] = '\0';
+ else
+ /* Terminate the string. */
+ *p = '\0';
+
+ /* Since MFLAGS is not parsed for flags, there is no reason to
+ override any makefile redefinition. */
+ (void) define_variable ("MFLAGS", 6, flagstring, o_env, 1);
+
+
if (all && command_variables != 0)
{
/* Now write a reference to $(MAKEOVERRIDES), which contains all the
@@ -1842,9 +1860,6 @@ define_makeflags (all, makefile)
We should not do this again on the second call, because that is
after reading makefiles which might have done `unexport MAKEFLAGS'. */
v->export = v_export;
- /* Since MFLAGS is not parsed for flags, there is no reason to
- override any makefile redefinition. */
- (void) define_variable ("MFLAGS", 6, flagstring, o_env, 1);
}
/* Print version information. */