diff options
author | ngie <ngie@FreeBSD.org> | 2014-12-30 20:46:01 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2014-12-30 20:46:01 +0000 |
commit | b7c609250bb56ecd416c82894f0f4018f1d6af24 (patch) | |
tree | 42042f28b011e96398613ec882e9f145f1937485 /share/mk | |
parent | 28d09f6c088f73690fb82e3fb1941fe68615a610 (diff) | |
download | FreeBSD-src-b7c609250bb56ecd416c82894f0f4018f1d6af24.zip FreeBSD-src-b7c609250bb56ecd416c82894f0f4018f1d6af24.tar.gz |
MFC r274077:
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
Diffstat (limited to 'share/mk')
-rw-r--r-- | share/mk/atf.test.mk | 4 | ||||
-rw-r--r-- | share/mk/plain.test.mk | 4 | ||||
-rw-r--r-- | share/mk/tap.test.mk | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/share/mk/atf.test.mk b/share/mk/atf.test.mk index f7d66bf..7a3ddd9 100644 --- a/share/mk/atf.test.mk +++ b/share/mk/atf.test.mk @@ -105,8 +105,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 diff --git a/share/mk/plain.test.mk b/share/mk/plain.test.mk index f26bab3..03c27f0 100644 --- a/share/mk/plain.test.mk +++ b/share/mk/plain.test.mk @@ -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 diff --git a/share/mk/tap.test.mk b/share/mk/tap.test.mk index 058ebdf..ec86088 100644 --- a/share/mk/tap.test.mk +++ b/share/mk/tap.test.mk @@ -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 |