Source-Changes-HG archive

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

[src/trunk]: src/sys/conf Don't assume infinite command line length.



details:   https://anonhg.NetBSD.org/src/rev/24adb4cefe0b
branches:  trunk
changeset: 581497:24adb4cefe0b
user:      sjg <sjg%NetBSD.org@localhost>
date:      Thu Jun 02 05:11:55 2005 +0000

description:
Don't assume infinite command line length.

diffstat:

 sys/conf/Makefile.kern.inc |  21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 5477b942b686 -r 24adb4cefe0b sys/conf/Makefile.kern.inc
--- a/sys/conf/Makefile.kern.inc        Thu Jun 02 05:10:22 2005 +0000
+++ b/sys/conf/Makefile.kern.inc        Thu Jun 02 05:11:55 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.kern.inc,v 1.65 2005/06/01 00:11:32 uwe Exp $
+#      $NetBSD: Makefile.kern.inc,v 1.66 2005/06/02 05:11:55 sjg Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -295,11 +295,24 @@
 SRCS?=         ${MD_SFILES} ${MD_CFILES} ${MI_CFILES} ${CFILES} ${SFILES}
 MKDEP_AFLAGS?= ${AFLAGS}
 MKDEP_CFLAGS?= ${CFLAGS}
+# We have to assume that we'll eventually run out of command line.
+# We already hit that on non-NetBSD hosts.
+_SFILES=${MD_SFILES} ${SFILES}
+_CFILES=${MD_CFILES} ${MI_CFILES} ${CFILES}
+_XargsMKDEP=${MKDEP:M*=*} xargs -t ${MKDEP:N*=*}
+
+# This dance is necessary to avoid long command lines.
+${SRCS:S,^,list-,}:
+       @echo ${.TARGET:S,^list-,,}
+
+_sfiles: ${_SFILES:S,^,list-,}
+_cfiles: ${_CFILES:S,^,list-,}
+
 .depend: ${SRCS} assym.h config_time.h
        ${_MKTARGET_CREATE}
-       ${MKDEP} -- ${MKDEP_AFLAGS} ${CPPFLAGS} ${MD_SFILES} ${SFILES}
-       ${MKDEP} -a -- ${MKDEP_CFLAGS} ${CPPFLAGS} ${MD_CFILES} ${MI_CFILES} \
-           ${CFILES}
+       @> $@
+       @${.MAKE} -f ${MAKEFILE} _sfiles | ${_XargsMKDEP} -a -- ${MKDEP_AFLAGS} ${CPPFLAGS} 
+       @${.MAKE} -f ${MAKEFILE} _cfiles | ${_XargsMKDEP} -a -- ${MKDEP_CFLAGS} ${CPPFLAGS}
        cat ${GENASSYM_CONF} ${GENASSYM_EXTRAS} | \
            ${GENASSYM} -- ${MKDEP} -f assym.dep -- \
            ${CFLAGS} ${CPPFLAGS}



Home | Main Index | Thread Index | Old Index