Module Name:    src
Committed By:   uebayasi
Date:           Sun Aug 30 05:12:00 UTC 2015

Modified Files:
        src/sys/conf: Makefile.kern.inc files
        src/usr.bin/config: defs.h mkmakefile.c

Log Message:
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).


To generate a diff of this commit:
cvs rdiff -u -r1.211 -r1.212 src/sys/conf/Makefile.kern.inc
cvs rdiff -u -r1.1140 -r1.1141 src/sys/conf/files
cvs rdiff -u -r1.71 -r1.72 src/usr.bin/config/defs.h
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/config/mkmakefile.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.211 src/sys/conf/Makefile.kern.inc:1.212
--- src/sys/conf/Makefile.kern.inc:1.211	Sun Aug 30 01:46:02 2015
+++ src/sys/conf/Makefile.kern.inc	Sun Aug 30 05:12:00 2015
@@ -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 @@ LINK_O?=	@${_MKSHMSG} "   link  ${.CURDI
 		${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}

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1140 src/sys/conf/files:1.1141
--- src/sys/conf/files:1.1140	Sun Aug 30 01:46:02 2015
+++ src/sys/conf/files	Sun Aug 30 05:12:00 2015
@@ -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

Index: src/usr.bin/config/defs.h
diff -u src/usr.bin/config/defs.h:1.71 src/usr.bin/config/defs.h:1.72
--- src/usr.bin/config/defs.h:1.71	Sun Aug 30 01:33:20 2015
+++ src/usr.bin/config/defs.h	Sun Aug 30 05:12:00 2015
@@ -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 @@ extern const char *progname;
  * 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
 
 /*

Index: src/usr.bin/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.47 src/usr.bin/config/mkmakefile.c:1.48
--- src/usr.bin/config/mkmakefile.c:1.47	Sat Aug 29 17:42:05 2015
+++ src/usr.bin/config/mkmakefile.c	Sun Aug 30 05:12:00 2015
@@ -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 @@ emitsfiles(FILE *fp)
 }
 
 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 @@ emitxfiles(FILE *fp, int suffix, int upp
 		} 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 @@ emitfiles(FILE *fp, int suffix, int uppe
  * 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;
 

Reply via email to