Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/config Now Makefile.kern.inc handles swap<kernel>.c ...



details:   https://anonhg.NetBSD.org/src/rev/eeaa68f80967
branches:  trunk
changeset: 340419:eeaa68f80967
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Fri Sep 04 05:13:32 2015 +0000

description:
Now Makefile.kern.inc handles swap<kernel>.c compiling/linking nicely,
config(1) can become less hackish.

diffstat:

 usr.bin/config/files.c      |  21 +++++++++------------
 usr.bin/config/mkmakefile.c |  23 ++---------------------
 2 files changed, 11 insertions(+), 33 deletions(-)

diffs (97 lines):

diff -r 2685911fc9ac -r eeaa68f80967 usr.bin/config/files.c
--- a/usr.bin/config/files.c    Fri Sep 04 01:24:01 2015 +0000
+++ b/usr.bin/config/files.c    Fri Sep 04 05:13:32 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: files.c,v 1.30 2015/09/04 01:24:01 uebayasi Exp $      */
+/*     $NetBSD: files.c,v 1.31 2015/09/04 05:13:32 uebayasi Exp $      */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: files.c,v 1.30 2015/09/04 01:24:01 uebayasi Exp $");
+__RCSID("$NetBSD: files.c,v 1.31 2015/09/04 05:13:32 uebayasi Exp $");
 
 #include <sys/param.h>
 #include <errno.h>
@@ -274,20 +274,17 @@
        struct files *fi, *ofi;
        struct nvlist *flathead, **flatp;
        int err, sel;
+       struct config *cf;
+       char swapname[100];
 
        addfile("devsw.c", NULL, 0, NULL);
        addfile("ioconf.c", NULL, 0, NULL);
 
-       if (Sflag) {
-               struct config *cf;
-               char swapname[100];
-
-               TAILQ_FOREACH(cf, &allcf, cf_next) {
-                       (void)snprintf(swapname, sizeof(swapname), "swap%s.c",
-                           cf->cf_name);
-                       addfile(intern(swapname), NULL, 0, NULL);
-               }
-       }
+       TAILQ_FOREACH(cf, &allcf, cf_next) {
+               (void)snprintf(swapname, sizeof(swapname), "swap%s.c",
+                   cf->cf_name);
+               addfile(intern(swapname), NULL, 0, NULL);
+       }
 
        err = 0;
        TAILQ_FOREACH(fi, &allfiles, fi_next) {
diff -r 2685911fc9ac -r eeaa68f80967 usr.bin/config/mkmakefile.c
--- a/usr.bin/config/mkmakefile.c       Fri Sep 04 01:24:01 2015 +0000
+++ b/usr.bin/config/mkmakefile.c       Fri Sep 04 05:13:32 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mkmakefile.c,v 1.64 2015/09/04 01:24:01 uebayasi Exp $ */
+/*     $NetBSD: mkmakefile.c,v 1.65 2015/09/04 05:13:32 uebayasi Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: mkmakefile.c,v 1.64 2015/09/04 01:24:01 uebayasi Exp $");
+__RCSID("$NetBSD: mkmakefile.c,v 1.65 2015/09/04 05:13:32 uebayasi Exp $");
 
 #include <sys/param.h>
 #include <ctype.h>
@@ -466,8 +466,6 @@
 emitfiles(FILE *fp, struct filelist *filelist, int suffix)
 {
        struct files *fi;
-       struct config *cf;
-       char swapname[100];
        int found = 0;
 
        TAILQ_FOREACH(fi, filelist, fi_snext) {
@@ -479,23 +477,6 @@
                emitfilerel(fp, fi);
                fputs(" \\\n", fp);
        }
-
-       /*
-        * The allfiles list does not include the configuration-specific
-        * C source files.  These files should be eliminated someday, but
-        * for now, we have to add them to ${CFILES} (and only ${CFILES}).
-        */
-       if (!Sflag) {
-       if (suffix == 'c') {
-               TAILQ_FOREACH(cf, &allcf, cf_next) {
-                       found++;
-                       (void)snprintf(swapname, sizeof(swapname), "swap%s.c",
-                           cf->cf_name);
-                       fprintf(fp, "\t%s \\\n", swapname);
-               }
-       }
-       }
-
        if (found == 0)
                fprintf(fp, "#%%%cFILES\n", toupper(suffix));
 }



Home | Main Index | Thread Index | Old Index