diff options
| author | reinoud <reinoud@NetBSD.org> | 2002-01-24 01:39:03 +0000 |
|---|---|---|
| committer | reinoud <reinoud@NetBSD.org> | 2002-01-24 01:39:03 +0000 |
| commit | 45e2e07bcf93fd5567e3e31c6972f6438f953fb8 (patch) | |
| tree | 8a46c1a2ef407353dd30d2505fba5ca6cd45464a /usr.bin/make/parse.c | |
| parent | 25cdf6cf5b2add7892f29eb4f95e4a325e90bea2 (diff) | |
Small update to make(1) to let it follow more its own guidelines ! ... This
patch makes sure that files included using ".include <bsd.own.mk>" are
really looked for in the system make file directory or in the specified -m
paths instead of allways looking in the other -I and .PATH specified paths
... This speeds up the make a few procents at times for all the system make
files are now found directly instead of searching several paths, saving a
lot of stat() calls.
The number of stat calls is still exorbirant hight though... 910 or so for
making `make' alone ....
Diffstat (limited to 'usr.bin/make/parse.c')
| -rw-r--r-- | usr.bin/make/parse.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 2e99ebf1b77..b5786c7a5f5 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.75 2001/10/31 03:59:42 tv Exp $ */ +/* $NetBSD: parse.c,v 1.76 2002/01/24 01:39:03 reinoud Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -39,14 +39,14 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: parse.c,v 1.75 2001/10/31 03:59:42 tv Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.76 2002/01/24 01:39:03 reinoud 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.75 2001/10/31 03:59:42 tv Exp $"); +__RCSID("$NetBSD: parse.c,v 1.76 2002/01/24 01:39:03 reinoud Exp $"); #endif #endif /* not lint */ #endif @@ -1771,6 +1771,8 @@ ParseDoInclude (line) * find the durn thing. A return of NULL indicates the file don't * exist. */ + fullname = (char *)NULL; + if (!isSystem) { /* * Include files contained in double-quotes are first searched for @@ -1803,27 +1805,24 @@ ParseDoInclude (line) fullname = (char *)NULL; } free (Fname); - } else { - fullname = (char *)NULL; - } - - if (fullname == (char *)NULL) { - /* - * System makefile or makefile wasn't found in same directory as - * included makefile. Search for it first on the -I search path, - * then on the .PATH search path, if not found in a -I directory. - * XXX: Suffix specific? - */ - fullname = Dir_FindFile (file, parseIncPath); - if (fullname == (char *)NULL) { - fullname = Dir_FindFile(file, dirSearchPath); - } + if (fullname == (char *)NULL) { + /* + * Makefile wasn't found in same directory as included makefile. + * Search for it first on the -I search path, + * then on the .PATH search path, if not found in a -I directory. + * XXX: Suffix specific? + */ + fullname = Dir_FindFile (file, parseIncPath); + if (fullname == (char *)NULL) { + fullname = Dir_FindFile(file, dirSearchPath); + } + } } + /* Looking for a system file or file still not found */ if (fullname == (char *)NULL) { /* - * Still haven't found the makefile. Look for it on the system - * path as a last resort. + * Look for it on the system path */ fullname = Dir_FindFile(file, Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath); } |
