Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make Bring down the number of stat(2) system calls f...



details:   https://anonhg.NetBSD.org/src/rev/4efcc32b36c2
branches:  trunk
changeset: 521700:4efcc32b36c2
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Feb 03 21:41:44 2002 +0000

description:
Bring down the number of stat(2) system calls from 682 to 294. This change
adds a .NOSUFF directive that has been applied to targets that have been
already made, and are not supposed to have suffix rules applied to them.

diffstat:

 usr.bin/make/make.h  |   5 +++--
 usr.bin/make/parse.c |   8 +++++---
 usr.bin/make/suff.c  |  10 +++++-----
 3 files changed, 13 insertions(+), 10 deletions(-)

diffs (112 lines):

diff -r 2fd99174f9a0 -r 4efcc32b36c2 usr.bin/make/make.h
--- a/usr.bin/make/make.h       Sun Feb 03 21:40:14 2002 +0000
+++ b/usr.bin/make/make.h       Sun Feb 03 21:41:44 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.39 2001/10/31 03:59:42 tv Exp $     */
+/*     $NetBSD: make.h,v 1.40 2002/02/03 21:41:44 christos Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -207,7 +207,7 @@
 #define OP_PRECIOUS    0x00000080  /* Don't remove the target when
                                     * interrupted */
 #define OP_SILENT      0x00000100  /* Don't echo commands when executed */
-#define OP_MAKE                0x00000200  /* Target is a recurrsive make so its
+#define OP_MAKE                0x00000200  /* Target is a recursive make so its
                                     * commands should always be executed when
                                     * it is out of date, regardless of the
                                     * state of the -n or -t flags */
@@ -223,6 +223,7 @@
                                     * target' processing in parse.c */
 #define OP_PHONY       0x00010000  /* Not a file target; run always */
 #define OP_NOPATH      0x00020000  /* Don't search for file in the path */
+#define OP_NOSUFF      0x00040000  /* Don't apply suffix rules to it */
 /* Attributes applied by PMake */
 #define OP_TRANSFORM   0x80000000  /* The node is a transformation rule */
 #define OP_MEMBER      0x40000000  /* Target is a member of an archive */
diff -r 2fd99174f9a0 -r 4efcc32b36c2 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sun Feb 03 21:40:14 2002 +0000
+++ b/usr.bin/make/parse.c      Sun Feb 03 21:41:44 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.78 2002/01/27 01:50:55 reinoud Exp $       */
+/*     $NetBSD: parse.c,v 1.79 2002/02/03 21:41:44 christos Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -39,14 +39,14 @@
  */
 
 #ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: parse.c,v 1.78 2002/01/27 01:50:55 reinoud Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.79 2002/02/03 21:41:44 christos 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.78 2002/01/27 01:50:55 reinoud Exp $");
+__RCSID("$NetBSD: parse.c,v 1.79 2002/02/03 21:41:44 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -172,6 +172,7 @@
                     * make */
     NoExport,      /* .NOEXPORT */
     NoPath,        /* .NOPATH */
+    NoSuff,        /* .NOSUFF */
     Not,           /* Not special */
     NotParallel,    /* .NOTPARALLEL */
     Null,          /* .NULL */
@@ -231,6 +232,7 @@
 { ".MAKEFLAGS",          MFlags,       0 },
 { ".MFLAGS",     MFlags,       0 },
 { ".NOPATH",     NoPath,       OP_NOPATH },
+{ ".NOSUFF",     NoSuff,       OP_NOSUFF },
 { ".NOTMAIN",    Attribute,    OP_NOTMAIN },
 { ".NOTPARALLEL", NotParallel, 0 },
 { ".NO_PARALLEL", NotParallel, 0 },
diff -r 2fd99174f9a0 -r 4efcc32b36c2 usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Sun Feb 03 21:40:14 2002 +0000
+++ b/usr.bin/make/suff.c       Sun Feb 03 21:41:44 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.36 2002/01/27 01:50:55 reinoud Exp $        */
+/*     $NetBSD: suff.c,v 1.37 2002/02/03 21:41:44 christos Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -39,14 +39,14 @@
  */
 
 #ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: suff.c,v 1.36 2002/01/27 01:50:55 reinoud Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.37 2002/02/03 21:41:44 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)suff.c     8.4 (Berkeley) 3/21/94";
 #else
-__RCSID("$NetBSD: suff.c,v 1.36 2002/01/27 01:50:55 reinoud Exp $");
+__RCSID("$NetBSD: suff.c,v 1.37 2002/02/03 21:41:44 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2095,7 +2095,7 @@
         * on the lhs of a dependency operator or [XXX] it has neither
         * children or commands) as the old pmake did.
         */
-       if ((gn->type & (OP_PHONY|OP_NOPATH)) == 0) {
+       if ((gn->type & (OP_PHONY|OP_NOPATH|OP_NOSUFF)) == 0) {
            free(gn->path);
            gn->path = Dir_FindFile(gn->name,
                                    (targ == NULL ? dirSearchPath :
@@ -2301,7 +2301,7 @@
     GNode         *gn;         /* node we're dealing with */
     Lst                  slst;
 {
-    if (gn->type & (OP_DEPS_FOUND|OP_PHONY)) {
+    if (gn->type & (OP_DEPS_FOUND|OP_PHONY|OP_NOSUFF)) {
        /*
         * If dependencies already found, no need to do it again...
         * If this is a .PHONY target, we do not apply suffix rules.



Home | Main Index | Thread Index | Old Index