Source-Changes-HG archive

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

[src/trunk]: src Output relative path for ${CFILES} and ${SFILES} in generate...



details:   https://anonhg.NetBSD.org/src/rev/2f88f24dd618
branches:  trunk
changeset: 340380:2f88f24dd618
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Wed Sep 02 13:42:14 2015 +0000

description:
Output relative path for ${CFILES} and ${SFILES} in generated `Makefile'.
`Makefile.kern.inc' knows how to deal with $S prefix, so don't bother it in
config(1).

diffstat:

 sys/conf/Makefile.kern.inc  |  37 ++++++++++++++++++++-----------------
 sys/conf/files              |   4 ++--
 usr.bin/config/defs.h       |   4 ++--
 usr.bin/config/mkmakefile.c |  21 ++++++++++++++++++---
 4 files changed, 42 insertions(+), 24 deletions(-)

diffs (145 lines):

diff -r b67a2ee98133 -r 2f88f24dd618 sys/conf/Makefile.kern.inc
--- a/sys/conf/Makefile.kern.inc        Wed Sep 02 13:06:06 2015 +0000
+++ b/sys/conf/Makefile.kern.inc        Wed Sep 02 13:42:14 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.kern.inc,v 1.220 2015/09/02 12:38:48 uebayasi Exp $
+#      $NetBSD: Makefile.kern.inc,v 1.221 2015/09/02 13:42:14 uebayasi Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -160,20 +160,6 @@
                ${LD} -r ${LINKFORMAT} -Map=${.TARGET}.map -o ${.TARGET} ${.ALLSRC} && \
                ${LD} -r ${LINKFORMAT} -Map=${.TARGET}.map -o ${.TARGET} ${.ALLSRC}
 
-.for _s in ${CFILES}
-.if !commands(${_s:T:R}.o)
-${_s:T:R}.o: ${_s}
-       ${NORMAL_C}
-.endif
-.endfor
-
-.for _s in ${SFILES}
-.if !commands(${_s:T:R}.o)
-${_s:T:R}.o: ${_s}
-       ${NORMAL_S}
-.endif
-.endfor
-
 ##
 ## (3) libkern and compat
 ##
@@ -317,6 +303,23 @@
 ## (6) port independent targets and dependencies: assym.h, vers.o
 ##
 
+_CFILES=${CFILES:M/*} ${CFILES:Nswapnetbsd*:N/*:C|^|$S/|}
+_SFILES=${SFILES:M/*} ${SFILES:N/*:C|^|$S/|}
+
+.for _s in ${_CFILES}
+.if !commands(${_s:T:R}.o)
+${_s:T:R}.o: ${_s}
+       ${NORMAL_C}
+.endif
+.endfor
+
+.for _s in ${_SFILES}
+.if !commands(${_s:T:R}.o)
+${_s:T:R}.o: ${_s}
+       ${NORMAL_S}
+.endif
+.endfor
+
 assym.h: ${GENASSYM_CONF} ${GENASSYM_EXTRAS} $S/conf/genassym.cf
        ${_MKTARGET_CREATE}
        cat ${GENASSYM_CONF} ${GENASSYM_EXTRAS} $S/conf/genassym.cf | \
@@ -388,8 +391,8 @@
 .if !target(.depend)
 MKDEP_AFLAGS?= ${AFLAGS}
 MKDEP_CFLAGS?= ${CFLAGS}
-SSRCS=${MD_SFILES} ${SFILES}
-CSRCS=${MD_CFILES} ${MI_CFILES} ${CFILES}
+SSRCS=${MD_SFILES} ${_SFILES}
+CSRCS=${MD_CFILES} ${MI_CFILES} ${_CFILES}
 SRCS=${SSRCS} ${CSRCS}
 DEPS=  ${SRCS:T:u:R:S/$/.d/g}
 
diff -r b67a2ee98133 -r 2f88f24dd618 sys/conf/files
--- a/sys/conf/files    Wed Sep 02 13:06:06 2015 +0000
+++ b/sys/conf/files    Wed Sep 02 13:42:14 2015 +0000
@@ -1,7 +1,7 @@
-#      $NetBSD: files,v 1.1144 2015/08/30 07:52:30 uebayasi Exp $
+#      $NetBSD: files,v 1.1145 2015/09/02 13:42:14 uebayasi Exp $
 #      @(#)files.newconf       7.5 (Berkeley) 5/10/93
 
-version        20150832
+version        20150841
 
 #
 # device classes
diff -r b67a2ee98133 -r 2f88f24dd618 usr.bin/config/defs.h
--- a/usr.bin/config/defs.h     Wed Sep 02 13:06:06 2015 +0000
+++ b/usr.bin/config/defs.h     Wed Sep 02 13:42:14 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: defs.h,v 1.84 2015/09/02 05:09:25 uebayasi Exp $       */
+/*     $NetBSD: defs.h,v 1.85 2015/09/02 13:42:14 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         20150840
+#define CONFIG_VERSION         20150841
 #define CONFIG_MINVERSION      0
 
 /*
diff -r b67a2ee98133 -r 2f88f24dd618 usr.bin/config/mkmakefile.c
--- a/usr.bin/config/mkmakefile.c       Wed Sep 02 13:06:06 2015 +0000
+++ b/usr.bin/config/mkmakefile.c       Wed Sep 02 13:42:14 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mkmakefile.c,v 1.57 2015/09/02 13:06:06 uebayasi Exp $ */
+/*     $NetBSD: mkmakefile.c,v 1.58 2015/09/02 13:42:14 uebayasi Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: mkmakefile.c,v 1.57 2015/09/02 13:06:06 uebayasi Exp $");
+__RCSID("$NetBSD: mkmakefile.c,v 1.58 2015/09/02 13:42:14 uebayasi Exp $");
 
 #include <sys/param.h>
 #include <ctype.h>
@@ -317,6 +317,21 @@
 }
 
 static void
+emitfilerel(FILE *fp, struct files *fi)
+{
+       const char *prefix, *sep;
+
+       prefix = sep = "";
+       if (*fi->fi_path != '/') {
+               if (fi->fi_prefix != NULL) {
+                       prefix = fi->fi_prefix;
+                       sep = "/";
+               }
+       }
+       fprintf(fp, "%s%s%s", prefix, sep, fi->fi_path);
+}
+
+static void
 emitobjs(FILE *fp)
 {
        const char *prologue, *prefix, *sep;
@@ -475,7 +490,7 @@
                if ((fi->fi_flags & FI_SEL) == 0)
                        continue;
                putc('\t', fp);
-               emitfile(fp, fi);
+               emitfilerel(fp, fi);
                fputs(" \\\n", fp);
        }
 



Home | Main Index | Thread Index | Old Index