Source-Changes-HG archive

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

[src/trunk]: src Define compile rules in sys/conf/Makefile.kern.inc except th...



details:   https://anonhg.NetBSD.org/src/rev/2f6c0193426e
branches:  trunk
changeset: 810423:2f6c0193426e
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Sun Aug 30 05:12:00 2015 +0000

description:
Define compile rules in sys/conf/Makefile.kern.inc except those overriden by
"file ... compile-with ...".  As rules are still explicit, be careful to not
override by checking .if !target(xxx.o).

diffstat:

 sys/conf/Makefile.kern.inc  |  16 +++++++++++++++-
 sys/conf/files              |   4 ++--
 usr.bin/config/defs.h       |   4 ++--
 usr.bin/config/mkmakefile.c |  45 +++++++--------------------------------------
 4 files changed, 26 insertions(+), 43 deletions(-)

diffs (151 lines):

diff -r 89cd78a96cde -r 2f6c0193426e sys/conf/Makefile.kern.inc
--- a/sys/conf/Makefile.kern.inc        Sun Aug 30 05:09:16 2015 +0000
+++ b/sys/conf/Makefile.kern.inc        Sun Aug 30 05:12:00 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.kern.inc,v 1.211 2015/08/30 01:46:02 uebayasi Exp $
+#      $NetBSD: Makefile.kern.inc,v 1.212 2015/08/30 05:12:00 uebayasi Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -163,6 +163,20 @@
                ${LD} -r ${LINKFORMAT} -Map=${.TARGET}.map -o ${.TARGET} ${.ALLSRC} && \
                ${LD} -r ${LINKFORMAT} -Map=${.TARGET}.map -o ${.TARGET} ${.ALLSRC}
 
+.for _s in ${CFILES}
+.if !target(${_s:T:R}.o)
+${_s:T:R}.o: ${_s}
+       ${NORMAL_C}
+.endif
+.endfor
+
+.for _s in ${SFILES}
+.if !target(${_s:T:R}.o)
+${_s:T:R}.o: ${_s}
+       ${NORMAL_S}
+.endif
+.endfor
+
 .SUFFIXES: .c .o
 .c.o:
        ${NORMAL_C}
diff -r 89cd78a96cde -r 2f6c0193426e sys/conf/files
--- a/sys/conf/files    Sun Aug 30 05:09:16 2015 +0000
+++ b/sys/conf/files    Sun Aug 30 05:12:00 2015 +0000
@@ -1,7 +1,7 @@
-#      $NetBSD: files,v 1.1140 2015/08/30 01:46:02 uebayasi Exp $
+#      $NetBSD: files,v 1.1141 2015/08/30 05:12:00 uebayasi Exp $
 #      @(#)files.newconf       7.5 (Berkeley) 5/10/93
 
-version        20150831
+version        20150832
 
 #
 # device classes
diff -r 89cd78a96cde -r 2f6c0193426e usr.bin/config/defs.h
--- a/usr.bin/config/defs.h     Sun Aug 30 05:09:16 2015 +0000
+++ b/usr.bin/config/defs.h     Sun Aug 30 05:12:00 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: defs.h,v 1.71 2015/08/30 01:33:20 uebayasi Exp $       */
+/*     $NetBSD: defs.h,v 1.72 2015/08/30 05:12:00 uebayasi Exp $       */
 
 /*
  * Copyright (c) 1992, 1993
@@ -107,7 +107,7 @@
  * The next two lines define the current version of the config(1) binary,
  * and the minimum version of the configuration files it supports.
  */
-#define CONFIG_VERSION         20150831
+#define CONFIG_VERSION         20150832
 #define CONFIG_MINVERSION      0
 
 /*
diff -r 89cd78a96cde -r 2f6c0193426e usr.bin/config/mkmakefile.c
--- a/usr.bin/config/mkmakefile.c       Sun Aug 30 05:09:16 2015 +0000
+++ b/usr.bin/config/mkmakefile.c       Sun Aug 30 05:12:00 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mkmakefile.c,v 1.47 2015/08/29 17:42:05 uebayasi Exp $ */
+/*     $NetBSD: mkmakefile.c,v 1.48 2015/08/30 05:12:00 uebayasi Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: mkmakefile.c,v 1.47 2015/08/29 17:42:05 uebayasi Exp $");
+__RCSID("$NetBSD: mkmakefile.c,v 1.48 2015/08/30 05:12:00 uebayasi Exp $");
 
 #include <sys/param.h>
 #include <ctype.h>
@@ -445,13 +445,13 @@
 }
 
 static void
-emitxfiles(FILE *fp, int suffix, int upper_suffix, int normal)
+emitfiles(FILE *fp, int suffix, int upper_suffix)
 {
        struct files *fi;
        struct config *cf;
+       char swapname[100];
 
-       fprintf(fp, "%cFILES.%snormal= \\\n", toupper(suffix),
-           normal ? "" : "ab");
+       fprintf(fp, "%cFILES= \\\n", toupper(suffix));
        TAILQ_FOREACH(fi, &allfiles, fi_next) {
                const char *prefix, *sep;
 
@@ -465,25 +465,10 @@
                } else {
                        prefix = sep = "";
                }
-               if (((fi->fi_mkrule == NULL) && normal) ||
-                   ((fi->fi_mkrule != NULL) && !normal))
-                       fprintf(fp, "\t%s%s%s%s \\\n", "$S/", prefix, sep,
-                           fi->fi_path);
+               fprintf(fp, "\t%s%s%s%s \\\n", "$S/", prefix, sep,
+                   fi->fi_path);
        }
-       putc('\n', fp);
-}
 
-static void
-emitfiles(FILE *fp, int suffix, int upper_suffix)
-{
-       struct files *fi;
-       struct config *cf;
-       char swapname[100];
-
-       emitxfiles(fp, suffix, upper_suffix, 1);
-       emitxfiles(fp, suffix, upper_suffix, 0);
-       fprintf(fp, "%cFILES= ${%cFILES.normal} ${%cFILES.abnormal} \\\n",
-           toupper(suffix), toupper(suffix), toupper(suffix));
        /*
         * The allfiles list does not include the configuration-specific
         * C source files.  These files should be eliminated someday, but
@@ -503,26 +488,10 @@
  * Emit the make-rules.
  */
 static void
-emitxrules(FILE *fp, int suffix)
-{
-       char s = tolower(suffix), S = toupper(suffix);
-
-       fprintf(fp, ".for _%cfile in ${%cFILES.normal}\n", s, S);
-       fprintf(fp, "${_%cfile:T:R}.o: ${_%cfile}\n", s, s);
-       fprintf(fp, "\t${NORMAL_%c}\n", S);
-       fprintf(fp, ".endfor\n\n");
-}
-
-static void
 emitrules(FILE *fp)
 {
        struct files *fi;
 
-       /* normal */
-       emitxrules(fp, 'c');
-       emitxrules(fp, 's');
-
-       /* abnormal */
        TAILQ_FOREACH(fi, &allfiles, fi_next) {
                const char *prefix, *sep;
 



Home | Main Index | Thread Index | Old Index