Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/conf Preserve the order of files in ${ALLFILES} -> ${OBJ...
details: https://anonhg.NetBSD.org/src/rev/e2848f42619d
branches: trunk
changeset: 340477:e2848f42619d
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Mon Sep 07 15:55:06 2015 +0000
description:
Preserve the order of files in ${ALLFILES} -> ${OBJS} conversion.
diffstat:
sys/conf/Makefile.kern.inc | 34 +++++++++++++++-------------------
1 files changed, 15 insertions(+), 19 deletions(-)
diffs (68 lines):
diff -r b0996efd108e -r e2848f42619d sys/conf/Makefile.kern.inc
--- a/sys/conf/Makefile.kern.inc Mon Sep 07 15:50:49 2015 +0000
+++ b/sys/conf/Makefile.kern.inc Mon Sep 07 15:55:06 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.kern.inc,v 1.243 2015/09/06 15:20:59 uebayasi Exp $
+# $NetBSD: Makefile.kern.inc,v 1.244 2015/09/07 15:55:06 uebayasi Exp $
#
# This file contains common `MI' targets and definitions and it is included
# at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -265,34 +265,30 @@
## (6) port independent targets and dependencies: assym.h, vers.o
##
+.if !defined(___USE_SUFFIX_RULES___)
+
+# Generate list of *.o files to pass to ${LD}, preserving order.
+# x/y/z/a.[csS] -> a.[csS]
+# a.[csS] -> a.o
+OBJS= ${ALLFILES:C|^.*/([^/]*\.[csS])$$|\1|:C|^(.*)\.[csS]$$|\1.o|}
+
CFILES= ${ALLFILES:M*.c}
SFILES= ${ALLFILES:M*.[sS]}
OFILES= ${ALLFILES:M*.o}
-
-.if !defined(___USE_SUFFIX_RULES___)
-COBJS= ${CFILES:T:R:C|$|.o|}
-SOBJS= ${SFILES:T:R:C|$|.o|}
-OOBJS= ${OFILES}
# absolute, generated (build directory), relative (under $S)
_CFILES=${CFILES:M/*} ${CFILES:N/*:N*/*} ${CFILES:N/*:M*/*:C|^|$S/|}
_SFILES=${SFILES:M/*} ${SFILES:N/*:N*/*} ${SFILES:N/*:M*/*:C|^|$S/|}
_MD_CFILES=${MD_CFILES}
_MD_SFILES=${MD_SFILES}
-.else
-COBJS= ${CFILES:R:C|$|.o|}
-SOBJS= ${SFILES:R:C|$|.o|}
-OOBJS= ${OFILES}
-_CFILES=${CFILES}
-_SFILES=${SFILES}
-_MD_CFILES=${MD_CFILES:C|^$S/||}
-_MD_SFILES=${MD_SFILES:C|^$S/||}
-.endif # ___USE_SUFFIX_RULES___
-
-OBJS= ${COBJS} ${SOBJS} ${OOBJS}
CSRCS= ${_MD_CFILES} ${_CFILES}
SSRCS= ${_MD_SFILES} ${_SFILES}
SRCS= ${CSRCS} ${SSRCS}
+.else # ___USE_SUFFIX_RULES___
+OBJS= ${ALLFILES:C|\.[csS]$$|.o|}
+SRCS= ${ALLFILES:M*.[csS]}
+.endif # ___USE_SUFFIX_RULES___
+
.if !defined(___USE_SUFFIX_RULES___)
.for _s in ${_CFILES}
.if !commands(${_s:T:R}.o)
@@ -354,9 +350,9 @@
MKDEP_AFLAGS?= ${AFLAGS}
MKDEP_CFLAGS?= ${CFLAGS}
.if !defined(___USE_SUFFIX_RULES___)
-DEPS= ${SRCS:T:u:R:S/$/.d/g}
+DEPS= ${SRCS:T:R:S/$/.d/g}
.else
-DEPS= ${SRCS:u:R:S/$/.d/g}
+DEPS= ${SRCS:R:S/$/.d/g}
.endif
.if !defined(___USE_SUFFIX_RULES___)
Home |
Main Index |
Thread Index |
Old Index