Module Name: src
Committed By: uebayasi
Date: Tue Sep 1 23:04:35 UTC 2015
Modified Files:
src/sys/conf: Makefile.kern.inc
Log Message:
Define suffix rules at the end to override system definitions. Provide them
only if ___USE_SUFFIX_RULES___ is defined (config -S).
To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.218 src/sys/conf/Makefile.kern.inc
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.217 src/sys/conf/Makefile.kern.inc:1.218
--- src/sys/conf/Makefile.kern.inc:1.217 Tue Sep 1 16:04:04 2015
+++ src/sys/conf/Makefile.kern.inc Tue Sep 1 23:04:35 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.kern.inc,v 1.217 2015/09/01 16:04:04 uebayasi Exp $
+# $NetBSD: Makefile.kern.inc,v 1.218 2015/09/01 23:04:35 uebayasi Exp $
#
# This file contains common `MI' targets and definitions and it is included
# at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -174,14 +174,6 @@ ${_s:T:R}.o: ${_s}
.endif
.endfor
-.SUFFIXES: .c .o
-.c.o:
- ${NORMAL_C}
-
-.SUFFIXES: .S .o
-.S.o:
- ${NORMAL_S}
-
##
## (3) libkern and compat
##
@@ -325,14 +317,6 @@ SYSTEM_LD_TAIL_STAGE2+= ${SYSTEM_LD_TAIL
## (6) port independent targets and dependencies: assym.h, vers.o
##
-.SUFFIXES: .genassym .assym.h
-.genassym.assym.h:
- ${_MKTARGET_CREATE}
- cat $< | \
- ${GENASSYM} -- ${CC} ${CFLAGS:N-Wa,*} ${CPPFLAGS} ${PROF} \
- ${GENASSYM_CPPFLAGS} > [email protected] && \
- mv -f [email protected] $@
-
assym.h: ${GENASSYM_CONF} ${GENASSYM_EXTRAS} $S/conf/genassym.cf
${_MKTARGET_CREATE}
cat ${GENASSYM_CONF} ${GENASSYM_EXTRAS} $S/conf/genassym.cf | \
@@ -409,12 +393,6 @@ CSRCS=${MD_CFILES} ${MI_CFILES} ${CFILES
SRCS=${SSRCS} ${CSRCS}
DEPS= ${SRCS:T:u:R:S/$/.d/g}
-.SUFFIXES: .S .d
-.S.d:
- ${_MKTARGET_CREATE}
- ${MKDEP} -f ${.TARGET} -- ${MKDEP_AFLAGS} \
- ${CPPFLAGS} ${CPPFLAGS.${_s:T}} $<
-
.for _s in ${SSRCS}
.if !target(${_s:T:R}.d)
${_s:T:R}.d: ${_s} assym.h
@@ -424,12 +402,6 @@ ${_s:T:R}.d: ${_s} assym.h
.endif
.endfor
-.SUFFIXES: .c .d
-.c.d:
- ${_MKTARGET_CREATE}
- ${MKDEP} -f ${.TARGET} -- ${MKDEP_CFLAGS} \
- ${CPPFLAGS} ${CPPFLAGS.${_s:T}} $<
-
.for _s in ${CSRCS}
.if !target(${_s:T:R}.d)
${_s:T:R}.d: ${_s}
@@ -544,5 +516,49 @@ build_kernel: .USE
.include <bsd.clang-analyze.mk>
##
+## suffix rules
+##
+
+.if defined(___USE_SUFFIX_RULES___)
+.SUFFIXES: .genassym .assym.h
+.genassym.assym.h:
+ ${_MKTARGET_CREATE}
+ cat $< | \
+ ${GENASSYM} -- ${CC} ${CFLAGS:N-Wa,*} ${CPPFLAGS} ${PROF} \
+ ${GENASSYM_CPPFLAGS} > [email protected] && \
+ mv -f [email protected] $@
+
+.SUFFIXES: .s .d
+.s.d:
+ ${_MKTARGET_CREATE}
+ ${MKDEP} -f ${.TARGET} -- ${MKDEP_AFLAGS} \
+ ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
+
+.SUFFIXES: .S .d
+.S.d:
+ ${_MKTARGET_CREATE}
+ ${MKDEP} -f ${.TARGET} -- ${MKDEP_AFLAGS} \
+ ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
+
+.SUFFIXES: .c .d
+.c.d:
+ ${_MKTARGET_CREATE}
+ ${MKDEP} -f ${.TARGET} -- ${MKDEP_CFLAGS} \
+ ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
+
+.SUFFIXES: .c .o
+.c.o:
+ ${NORMAL_C}
+
+.SUFFIXES: .s .o
+.s.o:
+ ${NORMAL_S}
+
+.SUFFIXES: .S .o
+.S.o:
+ ${NORMAL_S}
+.endif # ___USE_SUFFIX_RULES___
+
+##
## the end
##