From 09ed1dcb61b8b6629be317fc7bbc5aa9d1a4f2e0 Mon Sep 17 00:00:00 2001 From: espie Date: Tue, 20 Apr 2010 10:15:09 +0000 Subject: [PATCH] use _MAKE and _MAKESYS, simpler to read --- infrastructure/mk/bsd.port.mk | 114 ++++++++++++++++------------------ 1 file changed, 55 insertions(+), 59 deletions(-) diff --git a/infrastructure/mk/bsd.port.mk b/infrastructure/mk/bsd.port.mk index 7a13861ebd9..3df1326296c 100644 --- a/infrastructure/mk/bsd.port.mk +++ b/infrastructure/mk/bsd.port.mk @@ -1,6 +1,6 @@ #-*- mode: Makefile; tab-width: 4; -*- # ex:ts=4 sw=4 filetype=make: -# $OpenBSD: bsd.port.mk,v 1.991 2010/04/17 10:16:11 espie Exp $ +# $OpenBSD: bsd.port.mk,v 1.992 2010/04/20 10:15:09 espie Exp $ # $FreeBSD: bsd.port.mk,v 1.264 1996/12/25 02:27:44 imp Exp $ # $NetBSD: bsd.port.mk,v 1.62 1998/04/09 12:47:02 hubertf Exp $ # @@ -1518,12 +1518,12 @@ ${_PACKAGE_COOKIE${_S}}: { ln $$f $@ 2>/dev/null || cp -p $$f $@ ; } || \ cd ${.CURDIR} && ${MAKE} _TRIED_FETCHING_${_PACKAGE_COOKIE${_S}}=Yes _internal-package-only . else - @cd ${.CURDIR} && exec ${MAKE} ${_PACKAGE_COOKIE_DEPS} + @${_MAKE} ${_PACKAGE_COOKIE_DEPS} . if target(pre-package) - @cd ${.CURDIR} && exec ${MAKE} pre-package + @${_MAKE} pre-package . endif . if target(do-package) - @cd ${.CURDIR} && exec ${MAKE} do-package + @${_MAKE} do-package . else # What PACKAGE normally does: @${ECHO_MSG} "===> Building package for ${FULLPKGNAME${_S}}" @@ -1542,7 +1542,7 @@ ${_PACKAGE_COOKIE${_S}}: # End of PACKAGE. . endif . if target(post-package) - @cd ${.CURDIR} && exec ${MAKE} post-package + @${_MAKE} post-package . endif @rm -f ${_BULK_COOKIE} ${_UPDATE_COOKIE${_S}} ${_FUPDATE_COOKIE${_S}} . endif @@ -1555,7 +1555,7 @@ ${_INSTALL_COOKIE${_S}}: @cd ${.CURDIR} && SUBPACKAGE=${_S} exec ${MAKE} subpackage . else - @cd ${.CURDIR} && exec ${MAKE} package + @${_MAKE} package . endif @cd ${.CURDIR} && SUBPACKAGE=${_S} DEPENDS_TARGET=install \ exec ${MAKE} _internal-run-depends _internal-runlib-depends \ @@ -1581,7 +1581,7 @@ ${_INSTALL_COOKIE${_S}}: ${_UPDATE_COOKIE${_S}}: - @cd ${.CURDIR} && exec ${MAKE} _internal-package + @${_MAKE} _internal-package . if empty(UPDATE_COOKIES_DIR) @exec ${MAKE} ${WRKDIR} . else @@ -1600,7 +1600,7 @@ ${_UPDATE_COOKIE${_S}}: @${_MAKE_COOKIE} $@ ${_FUPDATE_COOKIE${_S}}: - @cd ${.CURDIR} && exec ${MAKE} _internal-package + @${_MAKE} _internal-package @cd ${.CURDIR} && SUBPACKAGE=${_S} DEPENDS_TARGET=package \ exec ${MAKE} _internal-run-depends _internal-runlib-depends \ _internal-runwantlib-depends @@ -1801,15 +1801,15 @@ _internal-fetch-all: # See ports/infrastructure/templates/Makefile.template @${ECHO_MSG} "===> Checking files for ${FULLPKGNAME}${_MASTER}" .if target(pre-fetch) - @cd ${.CURDIR} && exec ${MAKE} pre-fetch __FETCH_ALL=Yes + @${_MAKE} pre-fetch __FETCH_ALL=Yes .endif # What FETCH-ALL normally does: . if !empty(MAKESUMFILES) - @cd ${.CURDIR} && exec ${MAKE} ${MAKESUMFILES:S@^@${DISTDIR}/@} + @${_MAKE} ${MAKESUMFILES:S@^@${DISTDIR}/@} . endif # End of FETCH .if target(post-fetch) - @cd ${.CURDIR} && exec ${MAKE} post-fetch __FETCH_ALL=Yes + @${_MAKE} post-fetch __FETCH_ALL=Yes .endif .if !empty(IGNORE) && !defined(NO_IGNORE) @@ -1834,7 +1834,7 @@ _LIB_DEPENDS_FLAGS= . endif lib-depends-check: - @cd ${.CURDIR} && exec ${MAKE} package + @${_MAKE} package @PORTSDIR=${PORTSDIR} perl ${PORTSDIR}/infrastructure/package/check-lib-depends \ ${_LIB_DEPENDS_FLAGS} -d ${_PKG_REPO} ${_PACKAGE_COOKIE} @@ -1869,19 +1869,19 @@ _internal-fetch: # See ports/infrastructure/templates/Makefile.template @${ECHO_MSG} "===> Checking files for ${FULLPKGNAME}${_MASTER}" . if target(pre-fetch) - @cd ${.CURDIR} && exec ${MAKE} pre-fetch + @${_MAKE} pre-fetch . endif . if target(do-fetch) - @cd ${.CURDIR} && exec ${MAKE} do-fetch + @${_MAKE} do-fetch . else # What FETCH normally does: . if !empty(CHECKSUMFILES) - @cd ${.CURDIR} && exec ${MAKE} ${CHECKSUMFILES:S@^@${DISTDIR}/@} + @${_MAKE} ${CHECKSUMFILES:S@^@${DISTDIR}/@} . endif # End of FETCH . endif . if target(post-fetch) - @cd ${.CURDIR} && exec ${MAKE} post-fetch + @${_MAKE} post-fetch . endif @@ -1933,10 +1933,10 @@ _internal-checksum: _internal-fetch _refetch: . for file cipher value in ${_PROBLEMS} @rm ${DISTDIR}/${file} - @cd ${.CURDIR} && exec ${MAKE} ${DISTDIR}/${file} \ + @${_MAKE} ${DISTDIR}/${file} \ MASTER_SITE_OVERRIDE="${MASTER_SITE_OPENBSD:=by_cipher/${cipher}/${value:C/(..).*/\1/}/${value}/} ${MASTER_SITE_OPENBSD:=${cipher}/${value}/}" . endfor - cd ${.CURDIR} && exec ${MAKE} _internal-checksum REFETCH=false + ${_MAKE} _internal-checksum REFETCH=false # The cookie's recipe hold the real rule for each of those targets. @@ -2046,23 +2046,23 @@ subpackage: @${_DO_LOCK}; cd ${.CURDIR} && ${MAKE} _internal-subpackage _internal-package: - @cd ${.CURDIR} && exec ${MAKE} _internal-package-only + @${_MAKE} _internal-package-only .if ${BULK_${PKGPATH}:L} == "yes" - @cd ${.CURDIR} && exec ${MAKE} ${_BULK_COOKIE} + @${_MAKE} ${_BULK_COOKIE} .endif ${_BULK_COOKIE}: - @cd ${.CURDIR} && exec ${MAKE} _internal-package-only + @${_MAKE} _internal-package-only @mkdir -p ${BULK_COOKIES_DIR} .for _i in ${BULK_TARGETS_${PKGPATH}} @${ECHO_MSG} "===> Running ${_i}" - @cd ${.CURDIR} && exec ${MAKE} ${_i} ${BULK_FLAGS} + @${_MAKE} ${_i} ${BULK_FLAGS} .endfor .if !empty(BULK_DO_${PKGPATH}) @${BULK_DO_${PKGPATH}} .endif - @cd ${.CURDIR} && exec ${SUDO} ${MAKE} _internal-clean + @${SUDO} ${_MAKE} _internal-clean @${_MAKE_COOKIE} $@ # The real targets. Note that some parts always get run, some parts can be @@ -2078,15 +2078,14 @@ ${_WRKDIR_COOKIE}: @${_MAKE_COOKIE} $@ ${_EXTRACT_COOKIE}: ${_WRKDIR_COOKIE} ${_SYSTRACE_COOKIE} - @cd ${.CURDIR} && exec ${MAKE} \ - _internal-checksum _internal-prepare + @${_MAKE} _internal-checksum _internal-prepare @${ECHO_MSG} "===> Extracting for ${FULLPKGNAME}${_MASTER}" .if target(pre-extract) - @cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} pre-extract + @${_MAKESYS} pre-extract .endif - @cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} do-extract + @${_MAKESYS} do-extract .if target(post-extract) - @cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} post-extract + @${_MAKESYS} post-extract .endif @${_MAKE_COOKIE} $@ @@ -2108,7 +2107,7 @@ do-extract: # Hence it needs special treatment (a specific cookie). .if target(pre-patch) ${_PREPATCH_COOKIE}: - @cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} pre-patch + @${_MAKESYS} pre-patch . if ${PATCH_CHECK_ONLY:L} != "yes" @${_MAKE_COOKIE} $@ . endif @@ -2120,11 +2119,11 @@ ${_PREPATCH_COOKIE}: ${_DISTPATCH_COOKIE}: ${_EXTRACT_COOKIE} .if target(pre-patch) - @cd ${.CURDIR} && exec ${MAKE} ${_PREPATCH_COOKIE} + @${_MAKE} ${_PREPATCH_COOKIE} .endif - @cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} do-distpatch + @${_MAKESYS} do-distpatch .if target(post-distpatch) - @cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} post-distpatch + @${_MAKESYS} post-distpatch .endif .if ${PATCH_CHECK_ONLY:L} != "yes" @${_MAKE_COOKIE} $@ @@ -2154,15 +2153,15 @@ do-distpatch: ${_PATCH_COOKIE}: ${_EXTRACT_COOKIE} @${ECHO_MSG} "===> Patching for ${FULLPKGNAME}${_MASTER}" .if target(pre-patch) - @cd ${.CURDIR} && exec ${MAKE} ${_PREPATCH_COOKIE} + @${_MAKE} ${_PREPATCH_COOKIE} .endif .if target(do-patch) - @cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} do-patch + @${_MAKESYS} do-patch .else # What PATCH normally does: # XXX test for efficiency, don't bother with distpatch if it's not needed . if target(do-distpatch) || target(post-distpatch) || defined(PATCHFILES) - @cd ${.CURDIR} && exec ${MAKE} _internal-distpatch + @${_MAKE} _internal-distpatch . endif @if cd ${PATCHDIR} 2>/dev/null || [ x"${PATCH_LIST:M/*}" != x"" ]; then \ error=false; \ @@ -2194,7 +2193,7 @@ ${_PATCH_COOKIE}: ${_EXTRACT_COOKIE} # End of PATCH. .endif .if target(post-patch) - @cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} post-patch + @${_MAKESYS} post-patch .endif .for _m in ${MODULES:T:U} . if defined(MOD${_m}_post-patch) @@ -2228,10 +2227,10 @@ ${_CONFIGURE_COOKIE}: ${_PATCH_COOKIE} @${ECHO_MSG} "===> Configuring for ${FULLPKGNAME}${_MASTER}" @mkdir -p ${WRKBUILD} .if target(pre-configure) - @cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} pre-configure + @${_MAKESYS} pre-configure .endif .if target(do-configure) - @cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} do-configure + @${_MAKESYS} do-configure .else # What CONFIGURE normally does . for _c in ${CONFIGURE_STYLE:U} @@ -2242,7 +2241,7 @@ ${_CONFIGURE_COOKIE}: ${_PATCH_COOKIE} # End of CONFIGURE. .endif .if target(post-configure) - @cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} post-configure + @${_MAKESYS} post-configure .endif @${_MAKE_COOKIE} $@ @@ -2265,10 +2264,10 @@ ${_BUILD_COOKIE}: ${_CONFIGURE_COOKIE} echo "" . endif . if target(pre-build) - @cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} pre-build + @${_MAKESYS} pre-build . endif . if target(do-build) - @cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} do-build + @${_MAKESYS} do-build . else # What BUILD normally does: @cd ${WRKBUILD} && exec ${_SYSTRACE_CMD} ${SETENV} ${MAKE_ENV} \ @@ -2276,7 +2275,7 @@ ${_BUILD_COOKIE}: ${_CONFIGURE_COOKIE} # End of BUILD . endif . if target(post-build) - @cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} post-build + @${_MAKESYS} post-build . endif .endif @${_MAKE_COOKIE} $@ @@ -2295,7 +2294,7 @@ ${_REGRESS_COOKIE}: ${_BUILD_COOKIE} . endif . endif . if target(pre-regress) - @cd ${.CURDIR} && exec ${MAKE} pre-regress + @${_MAKE} pre-regress . endif . if target(do-regress) @${REGRESS_STATUS_IGNORE}cd ${.CURDIR} && exec 3>&1 && exit `exec 4>&1 1>&3; \ @@ -2310,7 +2309,7 @@ ${_REGRESS_COOKIE}: ${_BUILD_COOKIE} # End of REGRESS . endif . if target(post-regress) - @cd ${.CURDIR} && exec ${MAKE} post-regress + @${_MAKE} post-regress . endif .else @echo 1>&2 "No regression check for ${FULLPKGNAME}" @@ -2336,17 +2335,14 @@ ${_FAKE_COOKIE}: ${_BUILD_COOKIE} .endfor .if target(pre-fake) - @cd ${.CURDIR} && exec ${SUDO} ${_SYSTRACE_CMD} \ - ${MAKE} pre-fake ${_FAKE_SETUP} + @${SUDO} ${_MAKESYS} pre-fake ${_FAKE_SETUP} .endif @${SUDO} ${_MAKE_COOKIE} ${_INSTALL_PRE_COOKIE} .if target(pre-install) - @cd ${.CURDIR} && exec ${SUDO} ${_SYSTRACE_CMD} \ - ${MAKE} pre-install ${_FAKE_SETUP} + @${SUDO} ${_MAKESYS} pre-install ${_FAKE_SETUP} .endif .if target(do-install) - @cd ${.CURDIR} && exec ${SUDO} ${_SYSTRACE_CMD} \ - ${MAKE} do-install ${_FAKE_SETUP} + @${SUDO} ${_MAKESYS} do-install ${_FAKE_SETUP} .else # What FAKE normally does: @cd ${WRKBUILD} && exec ${SUDO} ${_SYSTRACE_CMD} \ @@ -2355,7 +2351,7 @@ ${_FAKE_COOKIE}: ${_BUILD_COOKIE} # End of FAKE. .endif .if target(post-install) - @cd ${.CURDIR} && exec ${SUDO} ${_SYSTRACE_CMD} ${MAKE} post-install ${_FAKE_SETUP} + @${SUDO} ${_MAKESYS} post-install ${_FAKE_SETUP} .endif .for _p in ${PROTECT_MOUNT_POINTS} @${SUDO} mount -u -w ${_p} @@ -3052,28 +3048,28 @@ homepage-links: ##################################################### checkpatch: - @cd ${.CURDIR} && exec ${MAKE} PATCH_CHECK_ONLY=Yes patch + @${_MAKE} PATCH_CHECK_ONLY=Yes patch clean-depends: - @cd ${.CURDIR} && exec ${MAKE} clean=depends + @${_MAKE} clean=depends distclean: - @cd ${.CURDIR} && exec ${MAKE} clean=dist + @${_MAKE} clean=dist delete-package: - @cd ${.CURDIR} && exec ${MAKE} clean=package + @${_MAKE} clean=package reinstall: - @cd ${.CURDIR} && exec ${MAKE} clean='install force' + @${_MAKE} clean='install force' @cd ${.CURDIR} && DEPENDS_TARGET=${DEPENDS_TARGET} exec ${MAKE} install repackage: - @cd ${.CURDIR} && exec ${MAKE} clean=packages - @cd ${.CURDIR} && exec ${MAKE} package + @${_MAKE} clean=packages + @${_MAKE} package rebuild: @rm -f ${_BUILD_COOKIE} - @cd ${.CURDIR} && exec ${MAKE} build + @${_MAKE} build uninstall deinstall: @${ECHO_MSG} "===> Deinstalling for ${FULLPKGNAME${SUBPACKAGE}}"