Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/config Share more code by making *.o handling less s...



details:   https://anonhg.NetBSD.org/src/rev/2685911fc9ac
branches:  trunk
changeset: 340418:2685911fc9ac
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Fri Sep 04 01:24:01 2015 +0000

description:
Share more code by making *.o handling less special.

diffstat:

 usr.bin/config/files.c      |   5 +++--
 usr.bin/config/mkmakefile.c |  18 +++---------------
 2 files changed, 6 insertions(+), 17 deletions(-)

diffs (66 lines):

diff -r 3ee5aad40ded -r 2685911fc9ac usr.bin/config/files.c
--- a/usr.bin/config/files.c    Thu Sep 03 22:24:02 2015 +0000
+++ b/usr.bin/config/files.c    Fri Sep 04 01:24:01 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: files.c,v 1.29 2015/09/03 14:23:52 uebayasi Exp $      */
+/*     $NetBSD: files.c,v 1.30 2015/09/04 01:24:01 uebayasi Exp $      */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: files.c,v 1.29 2015/09/03 14:23:52 uebayasi Exp $");
+__RCSID("$NetBSD: files.c,v 1.30 2015/09/04 01:24:01 uebayasi Exp $");
 
 #include <sys/param.h>
 #include <errno.h>
@@ -195,6 +195,7 @@
                break;
        case 'o':
                TAILQ_INSERT_TAIL(&allofiles, fi, fi_snext);
+               TAILQ_INSERT_TAIL(&allfiles, fi, fi_next);
                break;
        default:
                cfgxerror(fi->fi_srcfile, fi->fi_srcline,
diff -r 3ee5aad40ded -r 2685911fc9ac usr.bin/config/mkmakefile.c
--- a/usr.bin/config/mkmakefile.c       Thu Sep 03 22:24:02 2015 +0000
+++ b/usr.bin/config/mkmakefile.c       Fri Sep 04 01:24:01 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mkmakefile.c,v 1.63 2015/09/03 13:32:07 uebayasi Exp $ */
+/*     $NetBSD: mkmakefile.c,v 1.64 2015/09/04 01:24:01 uebayasi Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: mkmakefile.c,v 1.63 2015/09/03 13:32:07 uebayasi Exp $");
+__RCSID("$NetBSD: mkmakefile.c,v 1.64 2015/09/04 01:24:01 uebayasi Exp $");
 
 #include <sys/param.h>
 #include <ctype.h>
@@ -334,20 +334,8 @@
 static void
 emitobjs(FILE *fp)
 {
-       struct files *fi;
-       int found = 0;
 
-       TAILQ_FOREACH(fi, &allofiles, fi_snext) {
-               if ((fi->fi_flags & FI_SEL) == 0)
-                       continue;
-               if (found++ == 0)
-                       fputs("OFILES= \\\n", fp);
-               putc('\t', fp);
-               emitfile(fp, fi);
-               fputs(" \\\n", fp);
-       }
-       if (found == 0)
-               fprintf(fp, "#%%OBJS\n");
+       emitfiles(fp, &allofiles, 'o');
 }
 
 static void



Home | Main Index | Thread Index | Old Index