svn commit: r274077 - head/share/mk
Garrett Cooper
ngie at FreeBSD.org
Tue Nov 4 01:57:32 UTC 2014
Author: ngie
Date: Tue Nov 4 01:57:31 2014
New Revision: 274077
URL: https://svnweb.freebsd.org/changeset/base/274077
Log:
As an optimization (in simple, well used cases) only call cat ${.ALLSRC} when
generating files from various sources instead of calling cat ${.ALLSRC} | sed
The perl case was skipped because it's not being used in the tree at this time
Modified:
head/share/mk/atf.test.mk
head/share/mk/plain.test.mk
head/share/mk/tap.test.mk
Modified: head/share/mk/atf.test.mk
==============================================================================
--- head/share/mk/atf.test.mk Tue Nov 4 01:06:33 2014 (r274076)
+++ head/share/mk/atf.test.mk Tue Nov 4 01:57:31 2014 (r274077)
@@ -113,8 +113,12 @@ ATF_TESTS_SH_SED_${_T}?= # empty
ATF_TESTS_SH_SRC_${_T}?= ${_T}.sh
${_T}: ${ATF_TESTS_SH_SRC_${_T}}
echo '#! /usr/libexec/atf-sh' > ${.TARGET}.tmp
+.if empty(ATF_TESTS_SH_SED_${_T})
+ cat ${.ALLSRC:N*Makefile*} >>${.TARGET}.tmp
+.else
cat ${.ALLSRC:N*Makefile*} \
| sed ${ATF_TESTS_SH_SED_${_T}} >>${.TARGET}.tmp
+.endif
chmod +x ${.TARGET}.tmp
mv ${.TARGET}.tmp ${.TARGET}
.endfor
Modified: head/share/mk/plain.test.mk
==============================================================================
--- head/share/mk/plain.test.mk Tue Nov 4 01:06:33 2014 (r274076)
+++ head/share/mk/plain.test.mk Tue Nov 4 01:57:31 2014 (r274077)
@@ -57,8 +57,12 @@ CLEANFILES+= ${_T} ${_T}.tmp
PLAIN_TESTS_SH_SED_${_T}?= # empty
PLAIN_TESTS_SH_SRC_${_T}?= ${_T}.sh
${_T}: ${PLAIN_TESTS_SH_SRC_${_T}}
+.if empty(PLAIN_TESTS_SH_SED_${_T})
+ cat ${.ALLSRC:N*Makefile*} >${.TARGET}.tmp
+.else
cat ${.ALLSRC:N*Makefile*} \
| sed ${PLAIN_TESTS_SH_SED_${_T}} >${.TARGET}.tmp
+.endif
chmod +x ${.TARGET}.tmp
mv ${.TARGET}.tmp ${.TARGET}
.endfor
Modified: head/share/mk/tap.test.mk
==============================================================================
--- head/share/mk/tap.test.mk Tue Nov 4 01:06:33 2014 (r274076)
+++ head/share/mk/tap.test.mk Tue Nov 4 01:57:31 2014 (r274077)
@@ -86,7 +86,11 @@ CLEANFILES+= ${_T} ${_T}.tmp
TAP_TESTS_SH_SED_${_T}?= # empty
TAP_TESTS_SH_SRC_${_T}?= ${_T}.sh
${_T}: ${TAP_TESTS_SH_SRC_${_T}}
+.if empty(TAP_TESTS_SH_SED_${_T})
+ cat ${.ALLSRC} >${.TARGET}.tmp
+.else
cat ${.ALLSRC} | sed ${TAP_TESTS_SH_SED_${_T}} >${.TARGET}.tmp
+.endif
chmod +x ${.TARGET}.tmp
mv ${.TARGET}.tmp ${.TARGET}
.endfor
More information about the svn-src-all
mailing list