Module Name:    src
Committed By:   sjg
Date:           Fri Apr 20 05:33:42 UTC 2012

Modified Files:
        src/usr.bin/make: make.1 parse.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.202 -r1.203 src/usr.bin/make/make.1
cvs rdiff -u -r1.182 -r1.183 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.202 src/usr.bin/make/make.1:1.203
--- src/usr.bin/make/make.1:1.202	Sun Apr  8 22:00:39 2012
+++ src/usr.bin/make/make.1	Fri Apr 20 05:33:41 2012
@@ -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 @@ will look for.
 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

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.182 src/usr.bin/make/parse.c:1.183
--- src/usr.bin/make/parse.c:1.182	Sat Mar 31 00:12:24 2012
+++ src/usr.bin/make/parse.c	Fri Apr 20 05:33:42 2012
@@ -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 @@ ParseSetParseFile(const char *filename)
     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 @@ Parse_SetInput(const char *name, int lin
     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 @@ ParseTraditionalInclude(char *line)
 }
 #endif
 
-#ifdef SYSVINCLUDE
+#ifdef GMAKEEXPORT
 /*-
  *---------------------------------------------------------------------
  * ParseGmakeExport  --
@@ -2427,7 +2397,7 @@ ParseGmakeExport(char *line)
     char	  *value;
 
     if (DEBUG(PARSE)) {
-	    fprintf(debug_file, "ParseTraditionalInclude: %s\n", variable);
+	    fprintf(debug_file, "ParseGmakeExport: %s\n", variable);
     }
 
     /*
@@ -2441,13 +2411,12 @@ ParseGmakeExport(char *line)
 
     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 @@ Parse_File(const char *name, int fd)
 		isspace((unsigned char) line[6]) &&
 		strchr(line, ':') == NULL) {
 		/*
-		 * It's an Gmake"export".
+		 * It's a Gmake "export".
 		 */
 		ParseGmakeExport(line);
 		continue;

Reply via email to