summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1993-12-16 20:10:36 +0000
committerRoland McGrath <roland@redhat.com>1993-12-16 20:10:36 +0000
commit65b80562036bd9e72cdecf3c4c63d16d92cacee3 (patch)
tree92e92f2d472c92c7e09647ea2dd4a5c48531c27b /main.c
parent4f752036acd358448667df93950af4a02650fce5 (diff)
downloadmake-65b80562036bd9e72cdecf3c4c63d16d92cacee3.tar.gz
Formerly main.c.~103~
Diffstat (limited to 'main.c')
-rw-r--r--main.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/main.c b/main.c
index 8d91af1..992b45b 100644
--- a/main.c
+++ b/main.c
@@ -1493,6 +1493,7 @@ define_makeflags (all, makefile)
{
register const struct command_switch *cs;
char *flagstring;
+ struct variable *v;
/* We will construct a linked list of `struct flag's describing
all the flags which need to go in MAKEFLAGS. Then, once we
@@ -1662,22 +1663,25 @@ define_makeflags (all, makefile)
*p = '\0';
}
- define_variable ("MAKEFLAGS", 9,
- /* On Sun, the value of MFLAGS starts with a `-' but
- the value of MAKEFLAGS lacks the `-'.
- Be compatible with this unless FLAGSTRING starts
- with a long option `--foo', since removing the
- first dash would result in the bogus `-foo'. */
- flagstring[1] == '-' ? flagstring : &flagstring[1],
- /* This used to use o_env, but that lost when a
- makefile defined MAKEFLAGS. Makefiles set
- MAKEFLAGS to add switches, but we still want
- to redefine its value with the full set of
- switches. Of course, an override or command
- definition will still take precedence. */
- o_file, 0)
- /* Always export MAKEFLAGS. */
- ->export = v_export;
+ v = define_variable ("MAKEFLAGS", 9,
+ /* On Sun, the value of MFLAGS starts with a `-' but
+ the value of MAKEFLAGS lacks the `-'.
+ Be compatible with this unless FLAGSTRING starts
+ with a long option `--foo', since removing the
+ first dash would result in the bogus `-foo'. */
+ flagstring[1] == '-' ? flagstring : &flagstring[1],
+ /* This used to use o_env, but that lost when a
+ makefile defined MAKEFLAGS. Makefiles set
+ MAKEFLAGS to add switches, but we still want
+ to redefine its value with the full set of
+ switches. Of course, an override or command
+ definition will still take precedence. */
+ o_file, 0);
+ if (! all)
+ /* The first time we are called, set MAKEFLAGS to always be exported.
+ 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, 0);