Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/config Simplify generated `Makefile' by calculating ...



details:   https://anonhg.NetBSD.org/src/rev/b67a2ee98133
branches:  trunk
changeset: 340379:b67a2ee98133
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Wed Sep 02 13:06:06 2015 +0000

description:
Simplify generated `Makefile' by calculating ${OBJS} from merging ${CFILES},
${SFILES}, and ${OFILES} except swap<kernel>.o excluded.

diffstat:

 usr.bin/config/mkmakefile.c |  21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diffs (42 lines):

diff -r 83e4369aa032 -r b67a2ee98133 usr.bin/config/mkmakefile.c
--- a/usr.bin/config/mkmakefile.c       Wed Sep 02 12:38:48 2015 +0000
+++ b/usr.bin/config/mkmakefile.c       Wed Sep 02 13:06:06 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mkmakefile.c,v 1.56 2015/09/01 20:18:41 uebayasi Exp $ */
+/*     $NetBSD: mkmakefile.c,v 1.57 2015/09/02 13:06:06 uebayasi Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: mkmakefile.c,v 1.56 2015/09/01 20:18:41 uebayasi Exp $");
+__RCSID("$NetBSD: mkmakefile.c,v 1.57 2015/09/02 13:06:06 uebayasi Exp $");
 
 #include <sys/param.h>
 #include <ctype.h>
@@ -323,17 +323,12 @@
        struct files *fi;
 
        fputs("OBJS= \\\n", fp);
-       TAILQ_FOREACH(fi, &allfiles, fi_next) {
-               prologue = prefix = sep = "";
-               if ((fi->fi_flags & FI_SEL) == 0)
-                       continue;
-               if (fi->fi_buildprefix != NULL) {
-                       prefix = fi->fi_buildprefix;
-                       sep = "/";
-               }
-               fprintf(fp, "\t%s%s%s%s.o \\\n", prologue, prefix, sep,
-                   fi->fi_base);
-       }
+       fprintf(fp, "\t${CFILES:T:R:C|$|.o|:Nswapnetbsd*} \\\n");
+       fprintf(fp, "\t${SFILES:T:R:C|$|.o|} \\\n");
+       fprintf(fp, "\t${OFILES} \\\n");
+       putc('\n', fp);
+
+       fputs("OFILES= \\\n", fp);
        TAILQ_FOREACH(fi, &allofiles, fi_snext) {
                if ((fi->fi_flags & FI_SEL) == 0)
                        continue;



Home | Main Index | Thread Index | Old Index