Source-Changes-HG archive

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

[src/trunk]: src/sys/conf If we are going to run mkdep separately for each fi...



details:   https://anonhg.NetBSD.org/src/rev/cf8dbb8d8dd4
branches:  trunk
changeset: 586289:cf8dbb8d8dd4
user:      dsl <dsl%NetBSD.org@localhost>
date:      Mon Dec 12 22:44:04 2005 +0000

description:
If we are going to run mkdep separately for each file, we might as well
get this makefile to execute the mkdep commands - no need for a submake
and xargs at that point.
However we do need to do something to stop the 'mkdep -d' and CLEANDEPEND
command lines being to long.
Note that 'echo ${xxx} | cmd' is ok because echo is a shell builtin, and
isn't (usually) subject to the kernel's command line limits.

diffstat:

 sys/conf/Makefile.kern.inc |  48 ++++++++++++++-------------------------------
 1 files changed, 15 insertions(+), 33 deletions(-)

diffs (85 lines):

diff -r 8bd03f4a9fc7 -r cf8dbb8d8dd4 sys/conf/Makefile.kern.inc
--- a/sys/conf/Makefile.kern.inc        Mon Dec 12 22:42:34 2005 +0000
+++ b/sys/conf/Makefile.kern.inc        Mon Dec 12 22:44:04 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.kern.inc,v 1.72 2005/12/01 06:01:18 lukem Exp $
+#      $NetBSD: Makefile.kern.inc,v 1.73 2005/12/12 22:44:04 dsl Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -291,7 +291,7 @@
 
 .if !target(__CLEANDEPEND)
 __CLEANDEPEND: .USE
-       rm -f .depend ${DEPS}
+       echo .depend ${DEPS} | xargs rm -f --
 .endif
 
 # do not !target these, the kern and compat Makefiles augment them
@@ -303,16 +303,6 @@
 .if !target(.depend)
 MKDEP_AFLAGS?= ${AFLAGS}
 MKDEP_CFLAGS?= ${CFLAGS}
-.SUFFIXES: .d .c .s .S
-.c.d:
-       ${_MKTARGET_CREATE}
-       @${MKDEP} -f ${.TARGET} -- ${MKDEP_CFLAGS} \
-           ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
-.s.d .S.d:
-       ${_MKTARGET_CREATE}
-       @${MKDEP} -f ${.TARGET} -- ${MKDEP_AFLAGS} \
-           ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
-
 SSRCS=${MD_SFILES} ${SFILES}
 CSRCS=${MD_CFILES} ${MI_CFILES} ${CFILES}
 SRCS=${SSRCS} ${CSRCS}
@@ -320,36 +310,28 @@
 
 .for _s in ${SSRCS}
 ${_s:T:R}.d: ${_s} assym.h config_time.h
+       ${_MKTARGET_CREATE}
+       ${MKDEP} -f ${.TARGET} -- ${MKDEP_AFLAGS} \
+           ${CPPFLAGS} ${CPPFLAGS.${_s:T}} ${_s}
 .endfor
 .for _s in ${CSRCS}
 ${_s:T:R}.d: ${_s} config_time.h
+       ${_MKTARGET_CREATE}
+       ${MKDEP} -f ${.TARGET} -- ${MKDEP_CFLAGS} \
+           ${CPPFLAGS} ${CPPFLAGS.${_s:T}} ${_s}
 .endfor
 
-# We have to assume that we'll eventually run out of command line.
-# We already hit that on non-NetBSD hosts.
-.if ${MAKEVERBOSE} == 2
-_T=-t
-.else
-_T=
-.endif
-_XargsMKDEP=${MKDEP:M*=*} xargs ${_T} ${MKDEP:N*=*}
-_SubMake=${.MAKE} -f ${MAKEFILE} -DnoBEGIN
-
-# This dance is necessary to avoid long command lines.
-${DEPS:S,^,list-,}:
-       @echo ${.TARGET:S,^list-,,}
-
-_depfiles: ${DEPS:S,^,list-,}
-
-.depend: ${DEPS}
+assym.d: assym.h config_time.h
        ${_MKTARGET_CREATE}
-       @> $@
-       @${_SubMake} _depfiles | ${_XargsMKDEP} -a -d --
        cat ${GENASSYM_CONF} ${GENASSYM_EXTRAS} | \
            ${GENASSYM} -- ${MKDEP} -f assym.dep -- \
            ${CFLAGS} ${CPPFLAGS}
-       @sed -e 's/^.*\.o:.*\.c /assym.h: /' < assym.dep >> .depend
-       @rm -f assym.dep
+       sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >${.TARGET}
+       rm -f assym.dep
+
+.depend: ${DEPS} assym.d
+       ${_MKTARGET_CREATE}
+       echo "${.ALLSRC}" | ${MKDEP} -D
 .endif
 
 .if !target(lint)



Home | Main Index | Thread Index | Old Index