Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Make this work again like gmake. sjg: see the t...



details:   https://anonhg.NetBSD.org/src/rev/49386ee3d10c
branches:  trunk
changeset: 787935:49386ee3d10c
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jul 15 20:33:11 2013 +0000

description:
Make this work again like gmake. sjg: see the test program.

diffstat:

 usr.bin/make/main.c |   8 ++++----
 usr.bin/make/var.c  |  16 +++++-----------
 2 files changed, 9 insertions(+), 15 deletions(-)

diffs (79 lines):

diff -r e93b7281672a -r 49386ee3d10c usr.bin/make/main.c
--- a/usr.bin/make/main.c       Mon Jul 15 18:46:47 2013 +0000
+++ b/usr.bin/make/main.c       Mon Jul 15 20:33:11 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.218 2013/07/09 18:44:41 sjg Exp $   */
+/*     $NetBSD: main.c,v 1.219 2013/07/15 20:33:11 christos Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.218 2013/07/09 18:44:41 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.219 2013/07/15 20:33:11 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
@@ -81,7 +81,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.218 2013/07/09 18:44:41 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.219 2013/07/15 20:33:11 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -942,7 +942,7 @@
            char tmp[64], *ep;
 
            snprintf(tmp, sizeof(tmp), "%d",
-               ((ep = getenv(MAKE_LEVEL_ENV)) && *ep) ? atoi(ep) : 0);
+               ((ep = getenv(MAKE_LEVEL_ENV)) && *ep) ? atoi(ep) + 1 : 0);
            Var_Set(MAKE_LEVEL, tmp, VAR_GLOBAL, 0);
            snprintf(tmp, sizeof(tmp), "%u", myPid);
            Var_Set(".MAKE.PID", tmp, VAR_GLOBAL, 0);
diff -r e93b7281672a -r 49386ee3d10c usr.bin/make/var.c
--- a/usr.bin/make/var.c        Mon Jul 15 18:46:47 2013 +0000
+++ b/usr.bin/make/var.c        Mon Jul 15 20:33:11 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.180 2013/07/06 18:19:17 sjg Exp $    */
+/*     $NetBSD: var.c,v 1.181 2013/07/15 20:33:11 christos Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.180 2013/07/06 18:19:17 sjg Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.181 2013/07/15 20:33:11 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c      8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.180 2013/07/06 18:19:17 sjg Exp $");
+__RCSID("$NetBSD: var.c,v 1.181 2013/07/15 20:33:11 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -960,14 +960,8 @@
      * We allow the makefiles to update .MAKE.LEVEL and ensure
      * children see a correctly incremented value.
      */
-    if (ctxt == VAR_GLOBAL && strcmp(MAKE_LEVEL, name) == 0) {
-       char tmp[64];
-       int level;
-
-       level = atoi(val);
-       snprintf(tmp, sizeof(tmp), "%u", level + 1);
-       setenv(MAKE_LEVEL_ENV, tmp, 1);
-    }
+    if (ctxt == VAR_GLOBAL && strcmp(MAKE_LEVEL, name) == 0)
+       setenv(MAKE_LEVEL_ENV, val, 1);
        
  out:
     if (expanded_name != NULL)



Home | Main Index | Thread Index | Old Index