Index: bsd.port.mk =================================================================== --- bsd.port.mk (revision 334461) +++ bsd.port.mk (working copy) @@ -1546,9 +1546,7 @@ .if !defined(BEFOREPORTMK) && !defined(INOPTIONSMK) .if defined(_POSTMKINCLUDED) -check-makefile:: - @${ECHO_MSG} "${PKGNAME}: Makefile error: you cannot include bsd.port[.post].mk twice" - @${FALSE} +DEV_ERORR= "${PKGNAME}: Makefile error: you cannot include bsd.port[.post].mk twice" .endif _POSTMKINCLUDED= yes @@ -4365,12 +4363,17 @@ # Please note that the order of the following targets is important, and # should not be modified. +_STAGES= SANITY PKG FETCH EXTRACT PATCH CONFIGURE BUILD INSTALL PACKAGE +.if !defined(NO_STAGE) +_STAGES+= STAGE +.endif + .if defined(CHROOTED) _CHROOT_SEQ= post-chroot .else _CHROOT_SEQ= .endif -_SANITY_SEQ= ${_CHROOT_SEQ} pre-everything check-makefile \ +_SANITY_SEQ= ${_CHROOT_SEQ} pre-everything ${CHECK_MAKEFILE} \ check-categories check-makevars check-desktop-entries \ check-depends identify-install-conflicts check-deprecated \ check-vulnerable check-license check-config buildanyway-message \ @@ -4457,10 +4460,6 @@ @${DO_NADA} .endif -.if !target(check-sanity) -check-sanity: ${_SANITY_SEQ} -.endif - # XXX MCL might need to move in loop below? .if !target(fetch) fetch: ${_FETCH_DEP} ${_FETCH_SEQ} @@ -4518,21 +4517,6 @@ .endfor -# Enforce order for -jN builds - -.ORDER: ${_SANITY_SEQ} -.ORDER: ${_PKG_DEP} ${_PKG_SEQ} -.ORDER: ${_FETCH_DEP} ${_FETCH_SEQ} -.ORDER: ${_EXTRACT_DEP} ${_EXTRACT_SEQ} -.ORDER: ${_PATCH_DEP} ${_PATCH_SEQ} -.ORDER: ${_CONFIGURE_DEP} ${_CONFIGURE_SEQ} -.ORDER: ${_BUILD_DEP} ${_BUILD_SEQ} -.if !defined(NO_STAGE) -.ORDER: ${_STAGE_DEP} ${_STAGE_SEQ} -.endif -.ORDER: ${_INSTALL_DEP} ${_INSTALL_SEQ} -.ORDER: ${_PACKAGE_DEP} ${_PACKAGE_SEQ} - extract-message: @${ECHO_MSG} "===> Extracting for ${PKGNAME}" patch-message: @@ -4553,18 +4537,13 @@ .for stage in pre post .for name in pkg check-sanity fetch extract patch configure build stage install package -.if !target(${stage}-${name}) -${stage}-${name}: - @${DO_NADA} -.endif - +.if exists(${SCRIPTDIR}/${stage}-${name}) .if !target(${stage}-${name}-script) ${stage}-${name}-script: - @if [ -f ${SCRIPTDIR}/${.TARGET:S/-script$//} ]; then \ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \ - ${SCRIPTDIR}/${.TARGET:S/-script$//}; \ - fi + ${SCRIPTDIR}/${.TARGET:S/-script$//} .endif +.endif .endfor .endfor @@ -5921,9 +5900,9 @@ ${TMPPLIST_SORT}: ${TMPPLIST} @${SORT} -u ${TMPPLIST} >${TMPPLIST_SORT} +.if defined(PORTDOCS) && !defined(NOPORTDOCS) .if !target(add-plist-docs) add-plist-docs: -.if defined(PORTDOCS) && !defined(NOPORTDOCS) @if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \ [ "`${SED} -En -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \ ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \ @@ -5939,14 +5918,12 @@ @${FIND} -P -d ${PORTDOCS:S/^/${STAGEDIR}${DOCSDIR}\//} -type d 2>/dev/null | \ ${SED} -ne 's,^${STAGEDIR}${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} @${ECHO_CMD} "@dirrm ${DOCSDIR_REL}" >> ${TMPPLIST} -.else - @${DO_NADA} .endif .endif +.if defined(PORTEXAMPLES) && !defined(NOPORTEXAMPLES) .if !target(add-plist-examples) add-plist-examples: -.if defined(PORTEXAMPLES) && !defined(NOPORTEXAMPLES) @if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \ [ "`${SED} -En -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \ ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \ @@ -5963,14 +5940,12 @@ @${FIND} -P -d ${PORTEXAMPLES:S/^/${STAGEDIR}${EXAMPLESDIR}\//} -type d 2>/dev/null | \ ${SED} -ne 's,^${STAGEDIR}${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} @${ECHO_CMD} "@dirrm ${EXAMPLESDIR_REL}" >> ${TMPPLIST} -.else - @${DO_NADA} .endif .endif +.if defined(PORTDATA) && !defined(NOPORTDATA) .if !target(add-plist-data) add-plist-data: -.if defined(PORTDATA) && !defined(NOPORTDATA) @if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \ [ "`${SED} -En -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \ ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \ @@ -5987,8 +5962,6 @@ @${FIND} -P -d ${PORTDATA:S/^/${STAGEDIR}${DATADIR}\//} -type d 2>/dev/null | \ ${SED} -ne 's,^${STAGEDIR}${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} @${ECHO_CMD} "@dirrm ${DATADIR_REL}" >> ${TMPPLIST} -.else - @${DO_NADA} .endif .endif @@ -6734,7 +6707,8 @@ .if defined(WARNING) WARNING_WAIT?= 10 -show-warnings: +CHECK_MAKEFILE+= show-warnings +show-warnings:: @${ECHO_MSG} "/!\\ WARNING /!\\" .for m in ${WARNING} @${ECHO_MSG} "${m}" @@ -6741,14 +6715,13 @@ .endfor @${ECHO_MSG} @sleep ${WARNING_WAIT} - -check-makefile:: show-warnings .endif .if defined(DEVELOPER) .if defined(DEV_WARNING) DEV_WARNING_WAIT?= 10 -show-dev-warnings: +CHECK_MAKEFILE+= show-dev-warnings +show-dev-warnings:: @${ECHO_MSG} "/!\\ ${PKGNAME}: Makefile warnings, please consider fixing /!\\" @${ECHO_MSG} .for m in ${DEV_WARNING} @@ -6756,11 +6729,11 @@ .endfor @${ECHO_MSG} @sleep ${DEV_WARNING_WAIT} -check-makefile:: show-dev-warnings .endif .if defined(DEV_ERROR) -show-dev-errors: +CHECK_MAKEFILE+= show-dev-errors +show-dev-errors:: @${ECHO_MSG} "/!\\ ${PKGNAME}: Makefile errors /!\\" @${ECHO_MSG} .for m in ${DEV_ERROR} @@ -6768,11 +6741,26 @@ .endfor @${ECHO_MSG} @${FALSE} -check-makefile:: show-dev-errors .endif .endif #DEVELOPER .endif # End of post-makefile section. +.if !target(check-sanity) +check-sanity: ${_SANITY_SEQ} + @${DO_NADA} .endif + +# Enforce order for -jN builds + +.for _stage in ${_STAGES} +.for s in ${_${_stage}_SEQ} +.if target($s) +_${_stage}_FSEQ+= ${s} +.endif +.endfor +.ORDER: ${_${_stage}_DEP} ${_${_stage}_FSEQ} +.endfor + +.endif # End of the DESTDIR if statement