diff options
| author | tv <tv@NetBSD.org> | 2001-10-31 01:15:57 +0000 |
|---|---|---|
| committer | tv <tv@NetBSD.org> | 2001-10-31 01:15:57 +0000 |
| commit | 41783071dac241e7ee972e4e6257d17797fd923b (patch) | |
| tree | c6e7a2945f6c902cd012a030edd9ac450b039485 /usr.bin/make/parse.c | |
| parent | 3d76fbc53faa5973fa8003c3ef9a623d2d531e7d (diff) | |
Allow "-m" to be used in a .MAKEFLAGS: special target and get it to work.
(This splits out the "default system include paths" into its own Lst
variable, and uses it only if sysIncPath is empty. This allows sysIncPath
to be filled in by the Makefile itself.)
Diffstat (limited to 'usr.bin/make/parse.c')
| -rw-r--r-- | usr.bin/make/parse.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index bccad6e6e99..d83415096f7 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.73 2001/09/24 13:22:35 wiz Exp $ */ +/* $NetBSD: parse.c,v 1.74 2001/10/31 01:15:57 tv Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -39,14 +39,14 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: parse.c,v 1.73 2001/09/24 13:22:35 wiz Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.74 2001/10/31 01:15:57 tv Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.73 2001/09/24 13:22:35 wiz Exp $"); +__RCSID("$NetBSD: parse.c,v 1.74 2001/10/31 01:15:57 tv Exp $"); #endif #endif /* not lint */ #endif @@ -151,6 +151,7 @@ static Lst includes; /* stack of IFiles generated by * #includes */ Lst parseIncPath; /* list of directories for "..." includes */ Lst sysIncPath; /* list of directories for <...> includes */ +Lst defIncPath; /* default directories for <...> includes */ /*- * specType contains the SPECial TYPE of the current target. It is @@ -1587,7 +1588,7 @@ Parse_DoVar (line, ctxt) Var_Set(line, cp, ctxt, 0); } if (strcmp(line, MAKEOVERRIDES) == 0) - ExportMAKEFLAGS(0); /* re-export MAKEFLAGS */ + Main_ExportMAKEFLAGS(FALSE); /* re-export MAKEFLAGS */ } @@ -1816,7 +1817,7 @@ ParseDoInclude (line) * Still haven't found the makefile. Look for it on the system * path as a last resort. */ - fullname = Dir_FindFile(file, sysIncPath); + fullname = Dir_FindFile(file, Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath); } if (fullname == (char *) NULL) { @@ -2046,7 +2047,8 @@ ParseTraditionalInclude (line) * Still haven't found the makefile. Look for it on the system * path as a last resort. */ - fullname = Dir_FindFile(file, sysIncPath); + fullname = Dir_FindFile(file, + Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath); } if (fullname == NULL) { @@ -2748,6 +2750,7 @@ Parse_Init () mainNode = NILGNODE; parseIncPath = Lst_Init (FALSE); sysIncPath = Lst_Init (FALSE); + defIncPath = Lst_Init (FALSE); includes = Lst_Init (FALSE); #ifdef CLEANUP targCmds = Lst_Init (FALSE); @@ -2761,6 +2764,7 @@ Parse_End() Lst_Destroy(targCmds, (void (*) __P((ClientData))) free); if (targets) Lst_Destroy(targets, NOFREE); + Lst_Destroy(defIncPath, Dir_Destroy); Lst_Destroy(sysIncPath, Dir_Destroy); Lst_Destroy(parseIncPath, Dir_Destroy); Lst_Destroy(includes, NOFREE); /* Should be empty now */ |
