Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make PrintOnError: run .ERROR last, so even if it ca...



details:   https://anonhg.NetBSD.org/src/rev/77580f0c2d32
branches:  trunk
changeset: 754731:77580f0c2d32
user:      sjg <sjg%NetBSD.org@localhost>
date:      Mon May 10 15:54:21 2010 +0000

description:
PrintOnError: run .ERROR last, so even if it causes problems we
still print MAKE_PRINT_VAR_ON_ERROR.

diffstat:

 usr.bin/make/main.c |  25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diffs (60 lines):

diff -r 24db9fb5135f -r 77580f0c2d32 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Mon May 10 15:45:22 2010 +0000
+++ b/usr.bin/make/main.c       Mon May 10 15:54:21 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.185 2010/05/05 14:10:39 christos Exp $      */
+/*     $NetBSD: main.c,v 1.186 2010/05/10 15:54:21 sjg Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.185 2010/05/05 14:10:39 christos Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.186 2010/05/10 15:54:21 sjg 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.185 2010/05/05 14:10:39 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.186 2010/05/10 15:54:21 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1902,23 +1902,22 @@
         */
        Var_Set(".ERROR_TARGET", gn->name, VAR_GLOBAL, 0);
     }
+    strncpy(tmp, "${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'\n@}",
+           sizeof(tmp) - 1);
+    cp = Var_Subst(NULL, tmp, VAR_GLOBAL, 0);
+    if (cp) {
+       if (*cp)
+           printf("%s", cp);
+       free(cp);
+    }
     /*
-     * See if there is a .ERROR target, and run it if so.
+     * Finally, see if there is a .ERROR target, and run it if so.
      */
     en = Targ_FindNode(".ERROR", TARG_NOCREATE);
     if (en) {
        en->type |= OP_SPECIAL;
        Compat_Make(en, en);
     }
-    
-    strncpy(tmp, "${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'\n@}",
-           sizeof(tmp) - 1);
-    cp = Var_Subst(NULL, tmp, VAR_GLOBAL, 0);
-    if (cp) {
-           if (*cp)
-                   printf("%s", cp);
-           free(cp);
-    }
 }
 
 void



Home | Main Index | Thread Index | Old Index