aboutsummaryrefslogtreecommitdiff
path: root/Mk/bsd.port.subdir.mk
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2004-04-02 07:25:23 +0000
committerKris Kennaway <kris@FreeBSD.org>2004-04-02 07:25:23 +0000
commite74f65891de820071516510bbc68b8e00472a79e (patch)
treeed00e25eb1c26e2b9cbd086dbd60a0592c3da8fa /Mk/bsd.port.subdir.mk
parent783ff30c636b06af3170b25cc26e2edc6b112664 (diff)
downloadports-e74f65891de820071516510bbc68b8e00472a79e.tar.gz
ports-e74f65891de820071516510bbc68b8e00472a79e.zip
Notes
Diffstat (limited to 'Mk/bsd.port.subdir.mk')
-rw-r--r--Mk/bsd.port.subdir.mk52
1 files changed, 25 insertions, 27 deletions
diff --git a/Mk/bsd.port.subdir.mk b/Mk/bsd.port.subdir.mk
index 25682e8674ec..dd04f94d5ff9 100644
--- a/Mk/bsd.port.subdir.mk
+++ b/Mk/bsd.port.subdir.mk
@@ -198,38 +198,36 @@ checksubdir:
.if !target(describe)
.if defined(PORTSTOP)
+# This is a bit convoluted to deal with the fact that make will overlap I/O from child make processes
+# if they write more than 2k: this will corrupt the INDEX file. make -P does not do this, but it adds
+# extraneous output and redirects stderr, so we lose error reporting from child makes. Instead we have
+# to roll our own implementation of make -P and make sure that each child make writes to their own file,
+# which we will combine at the end. This gives substantial performance benefits over doing a make -j1
+
+.if defined(BUILDING_INDEX)
+describe: ${SUBDIR:S/^/describe./}
+
+.for i in ${SUBDIR}
+describe.$i:
+ @${MAKE} -B ${i:S/^/_/:S/$/.describe/} > ${INDEX_TMPDIR}/${INDEXFILE}.desc.${i}
+.endfor
+.else
describe: ${SUBDIR:S/^/_/:S/$/.describe/}
+.endif
.else
describe:
- @TMPFILE=`mktemp -q /tmp/describe.XXXXXX` || exit 1; \
- for sub in ${SUBDIR}; do \
- OK=""; \
- for dud in $$DUDS; do \
- if [ $${dud} = $$sub ]; then \
- OK="false"; \
- ${ECHO_MSG} "===> ${DIRPRFX}$$sub skipped"; \
- fi; \
- done; \
- if test -d ${.CURDIR}/$${sub}.${MACHINE_ARCH}; then \
- edir=$${sub}.${MACHINE_ARCH}; \
- elif test -d ${.CURDIR}/$${sub}; then \
- edir=$${sub}; \
+ @for sub in ${SUBDIR}; do \
+ if test -d ${.CURDIR}/$${sub}; then \
+ ${ECHO_MSG} "===> ${DIRPRFX}$${sub}"; \
+ cd ${.CURDIR}/$${sub}; \
+ ${MAKE} -B describe 2> /dev/null || \
+ (echo "===> ${DIRPRFX}$${sub} failed:" >&2 ; \
+ cd ${.CURDIR}/$${sub}; ${MAKE} -B describe >&2; \
+ exit 1) ;\
else \
- OK="false"; \
${ECHO_MSG} "===> ${DIRPRFX}$${sub} non-existent"; \
fi; \
- if [ "$$OK" = "" ]; then \
- ${ECHO_MSG} "===> ${DIRPRFX}$${edir}"; \
- cd ${.CURDIR}/$${edir}; \
- ${MAKE} -B describe 2>$${TMPFILE}; \
- if [ -s $${TMPFILE} ]; then \
- echo "===> ${DIRPRFX}$${sub} failed:" >&2; \
- cat $${TMPFILE} >&2; \
- echo -n >$${TMPFILE}; \
- fi; \
- fi; \
- done; \
- rm -f $${TMPFILE}
+ done
.endif
.endif
@@ -287,7 +285,7 @@ README.html:
@> $@.tmp3
.endif
.if defined(COMMENT)
- @echo "${COMMENT:Q}" | ${HTMLIFY} > $@.tmp4
+ @echo "${COMMENT}" | ${HTMLIFY} > $@.tmp4
.else
.if exists(${COMMENTFILE})
@${HTMLIFY} ${COMMENTFILE} > $@.tmp4