Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Fix some typos in/around ParseGmakeExport.



details:   https://anonhg.NetBSD.org/src/rev/07bbc1e58ffe
branches:  trunk
changeset: 778917:07bbc1e58ffe
user:      sjg <sjg%NetBSD.org@localhost>
date:      Fri Apr 20 05:33:41 2012 +0000

description:
Fix some typos in/around ParseGmakeExport.
Remove the suppresssion of duplicate entries in .MAKE.MAKEFILES

diffstat:

 usr.bin/make/make.1  |   5 ++---
 usr.bin/make/parse.c |  49 +++++++++----------------------------------------
 2 files changed, 11 insertions(+), 43 deletions(-)

diffs (141 lines):

diff -r 8c12f8641dc0 -r 07bbc1e58ffe usr.bin/make/make.1
--- a/usr.bin/make/make.1       Fri Apr 20 05:15:11 2012 +0000
+++ b/usr.bin/make/make.1       Fri Apr 20 05:33:41 2012 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: make.1,v 1.202 2012/04/08 22:00:39 wiz Exp $
+.\"    $NetBSD: make.1,v 1.203 2012/04/20 05:33:41 sjg Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"    from: @(#)make.1        8.4 (Berkeley) 3/19/94
 .\"
-.Dd March 31, 2012
+.Dd April 20, 2012
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -735,7 +735,6 @@
 The list of makefiles read by
 .Nm ,
 which is useful for tracking dependencies.
-Each makefile is recorded only once, regardless of the number of times read.
 .It Va .MAKE.MODE
 Processed after reading all makefiles.
 Can affect the mode that
diff -r 8c12f8641dc0 -r 07bbc1e58ffe usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Fri Apr 20 05:15:11 2012 +0000
+++ b/usr.bin/make/parse.c      Fri Apr 20 05:33:41 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.182 2012/03/31 00:12:24 christos Exp $     */
+/*     $NetBSD: parse.c,v 1.183 2012/04/20 05:33:42 sjg Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.182 2012/03/31 00:12:24 christos Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.183 2012/04/20 05:33:42 sjg 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.182 2012/03/31 00:12:24 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.183 2012/04/20 05:33:42 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2239,36 +2239,6 @@
     free(dirname);
 }
 
-/*
- * Track the makefiles we read - so makefiles can
- * set dependencies on them.
- * Avoid adding anything more than once.
- */
-
-static void
-ParseTrackInput(const char *name)
-{
-    char *old;
-    char *fp = NULL;
-    size_t name_len = strlen(name);
-    
-    old = Var_Value(MAKE_MAKEFILES, VAR_GLOBAL, &fp);
-    if (old) {
-       /* does it contain name? */
-       for (; old != NULL; old = strchr(old, ' ')) {
-           if (*old == ' ')
-               old++;
-           if (memcmp(old, name, name_len) == 0
-                   && (old[name_len] == 0 || old[name_len] == ' '))
-               goto cleanup;
-       }
-    }
-    Var_Append (MAKE_MAKEFILES, name, VAR_GLOBAL);
- cleanup:
-    if (fp) {
-       free(fp);
-    }
-}
 
 
 /*-
@@ -2294,7 +2264,7 @@
     if (name == NULL)
        name = curFile->fname;
     else
-       ParseTrackInput(name);
+       Var_Append(MAKE_MAKEFILES, name, VAR_GLOBAL);
 
     if (DEBUG(PARSE))
        fprintf(debug_file, "Parse_SetInput: file %s, line %d, fd %d, nextbuf %p, arg %p\n",
@@ -2405,7 +2375,7 @@
 }
 #endif
 
-#ifdef SYSVINCLUDE
+#ifdef GMAKEEXPORT
 /*-
  *---------------------------------------------------------------------
  * ParseGmakeExport  --
@@ -2427,7 +2397,7 @@
     char         *value;
 
     if (DEBUG(PARSE)) {
-           fprintf(debug_file, "ParseTraditionalInclude: %s\n", variable);
+           fprintf(debug_file, "ParseGmakeExport: %s\n", variable);
     }
 
     /*
@@ -2441,13 +2411,12 @@
 
     if (*value != '=') {
        Parse_Error(PARSE_FATAL,
-                    "Variable/Value missing from \"include\"");
+                    "Variable/Value missing from \"export\"");
        return;
     }
 
     /*
-     * Substitute for any variables in the file name before trying to
-     * find the thing.
+     * Expand the value before putting it in the environment.
      */
     value = Var_Subst(NULL, value, VAR_CMD, FALSE);
     setenv(variable, value, 1);
@@ -2908,7 +2877,7 @@
                isspace((unsigned char) line[6]) &&
                strchr(line, ':') == NULL) {
                /*
-                * It's an Gmake"export".
+                * It's a Gmake "export".
                 */
                ParseGmakeExport(line);
                continue;



Home | Main Index | Thread Index | Old Index