From f5cca2b075f45417e97d0af7aede1f7445018da7 Mon Sep 17 00:00:00 2001 From: espie Date: Tue, 2 Jul 2013 08:36:16 +0000 Subject: [PATCH] convert to using intermediate *TARGET, as discussed with a few people. (the waf version actually works, contrary to my former patch, as CONFIGURE_STYLE must be set before modules) --- devel/scons/scons.port.mk | 18 ++++++++----- devel/waf/waf.port.mk | 24 +++++++++-------- lang/ghc/ghc.port.mk | 56 ++++++++++++++++++++++++--------------- lang/mono/mono.port.mk | 10 +++---- 4 files changed, 64 insertions(+), 44 deletions(-) diff --git a/devel/scons/scons.port.mk b/devel/scons/scons.port.mk index 2b25d823f49..b17611f2845 100644 --- a/devel/scons/scons.port.mk +++ b/devel/scons/scons.port.mk @@ -1,4 +1,4 @@ -# $OpenBSD: scons.port.mk,v 1.5 2011/07/05 15:17:26 sthen Exp $ +# $OpenBSD: scons.port.mk,v 1.6 2013/07/02 08:36:16 espie Exp $ BUILD_DEPENDS+= devel/scons @@ -18,15 +18,21 @@ MODSCONS_FLAGS?= ALL_TARGET?= NO_CCACHE?=Yes +MODSCONS_BUILD_TARGET = \ + ${SETENV} ${MAKE_ENV} ${MODSCONS_BIN} -C ${WRKSRC} \ + ${MODSCONS_ENV} ${MODSCONS_FLAGS} ${ALL_TARGET} + +MODSCONS_INSTALL_TARGET = \ + ${SETENV} ${MAKE_ENV} ${MODSCONS_BIN} -C ${WRKSRC} \ + ${MODSCONS_ENV} ${MODSCONS_FLAGS} ${INSTALL_TARGET} \ + DESTDIR=${WRKINST} + .if !target(do-build) do-build: - @${SETENV} ${MAKE_ENV} ${MODSCONS_BIN} -C ${WRKSRC} \ - ${MODSCONS_ENV} ${MODSCONS_FLAGS} ${ALL_TARGET} + @${MODSCONS_BUILD_TARGET} .endif .if !target(do-install) do-install: - @${SETENV} ${MAKE_ENV} ${MODSCONS_BIN} -C ${WRKSRC} \ - ${MODSCONS_ENV} ${MODSCONS_FLAGS} ${INSTALL_TARGET} \ - DESTDIR=${WRKINST} + @${MODSCONS_INSTALL_TARGET} .endif diff --git a/devel/waf/waf.port.mk b/devel/waf/waf.port.mk index 8431617c21d..55276c45e8e 100644 --- a/devel/waf/waf.port.mk +++ b/devel/waf/waf.port.mk @@ -1,32 +1,34 @@ -# $OpenBSD: waf.port.mk,v 1.4 2011/09/22 13:05:57 landry Exp $ +# $OpenBSD: waf.port.mk,v 1.5 2013/07/02 08:36:16 espie Exp $ MODULES += lang/python MODPY_RUNDEP = no BUILD_DEPENDS += devel/waf MODWAF_BIN = ${LOCALBASE}/bin/waf MAKE_ENV += PYTHON=${MODPY_BIN} PYTHON_VERSION=${MODPY_VERSION} -_MODWAF_CMD = @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MODWAF_BIN} -_MODWAF_CONFIGURE_CMD = @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${CONFIGURE_ENV} ${MODWAF_BIN} +_MODWAF_CMD = cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MODWAF_BIN} +_MODWAF_CONFIGURE_CMD = cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${CONFIGURE_ENV} ${MODWAF_BIN} MODWAF_VERBOSE ?= Yes .if ${MODWAF_VERBOSE:L} == "yes" _MODWAF_VERBOSE_FLAG = -v .endif -do-configure: - ${_MODWAF_CONFIGURE_CMD} configure ${_MODWAF_VERBOSE_FLAG} ${CONFIGURE_ARGS} +.if empty(CONFIGURE_STYLE) +CONFIGURE_STYLE = waf +.endif + +MODWAF_configure = ${_MODWAF_CONFIGURE_CMD} configure ${_MODWAF_VERBOSE_FLAG} ${CONFIGURE_ARGS} +MODWAF_BUILD_TARGET = ${_MODWAF_CMD} build ${_MODWAF_VERBOSE_FLAG} +MODWAF_INSTALL_TARGET = ${_MODWAF_CMD} install ${_MODWAF_VERBOSE_FLAG} --destdir=${WRKINST} .if !target(do-build) do-build: - ${_MODWAF_CMD} build ${_MODWAF_VERBOSE_FLAG} + @${MODWAF_BUILD_TARGET} .endif .if !target(do-install) do-install: - ${_MODWAF_CMD} install ${_MODWAF_VERBOSE_FLAG} --destdir=${WRKINST} + @${MODWAF_INSTALL_TARGET} .endif -.if !target(post-install) -post-install: - @rm -Rf ${WRKSRC}/_build_ -.endif +MODWAF-post-install = rm -Rf ${WRKSRC}/_build_ diff --git a/lang/ghc/ghc.port.mk b/lang/ghc/ghc.port.mk index 0e4de272f69..99139f1f5cd 100644 --- a/lang/ghc/ghc.port.mk +++ b/lang/ghc/ghc.port.mk @@ -1,4 +1,4 @@ -# $OpenBSD: ghc.port.mk,v 1.28 2013/03/11 11:20:27 espie Exp $ +# $OpenBSD: ghc.port.mk,v 1.29 2013/07/02 08:36:16 espie Exp $ # Module for Glasgow Haskell Compiler # Not yet ported to other architectures @@ -83,37 +83,49 @@ MODCABAL_configure = \ CONFIGURE_STYLE += CABAL +MODGHC_BUILD_TARGET = \ + cd ${WRKBUILD} && ${SETENV} ${MAKE_ENV} \ + ${MODGHC_SETUP_PROG} build -v +. if ${MODGHC_BUILD:L:Mhaddock} +MODGHC_BUILD_TARGET += \ + ;cd ${WRKBUILD} && ${SETENV} ${MAKE_ENV} \ + ${MODGHC_SETUP_PROG} haddock +. endif +. if ${MODGHC_BUILD:L:Mregister} +MODGHC_BUILD_TARGET += \ + ;cd ${WRKBUILD} && ${SETENV} ${MAKE_ENV} \ + ${MODGHC_SETUP_PROG} register --gen-script \ + --pkgpath="${PKGPATH}"; \ + cd ${WRKBUILD} && ${SETENV} ${MAKE_ENV} \ + ${MODGHC_SETUP_PROG} unregister --gen-script +. endif + +MODGHC_INSTALL_TARGET = \ + cd ${WRKBUILD} && ${SETENV} ${MAKE_ENV} \ + ${MODGHC_SETUP_PROG} copy --destdir=${DESTDIR} +. if ${MODGHC_BUILD:L:Mregister} +MODGHC_INSTALL_TARGET += \ + ;${INSTALL_SCRIPT} ${WRKBUILD}/register.sh ${PREFIX}/lib/ghc/${DISTNAME} \ + ;${INSTALL_SCRIPT} ${WRKBUILD}/unregister.sh ${PREFIX}/lib/ghc/${DISTNAME} +. endif + +MODGHC_TEST_TARGET = \ + cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \ + ${MODGHC_SETUP_PROG} test + . if !target(do-build) do-build: - @cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \ - ${MODGHC_SETUP_PROG} build -v -. if ${MODGHC_BUILD:L:Mhaddock} - @cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \ - ${MODGHC_SETUP_PROG} haddock -. endif -. if ${MODGHC_BUILD:L:Mregister} - @cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \ - ${MODGHC_SETUP_PROG} register --gen-script \ - --pkgpath="${PKGPATH}" - @cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \ - ${MODGHC_SETUP_PROG} unregister --gen-script -. endif + @${MODGHC_BUILD_TARGET} . endif . if !target(do-install) do-install: - @cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \ - ${MODGHC_SETUP_PROG} copy --destdir=${DESTDIR} -. if ${MODGHC_BUILD:L:Mregister} - @${INSTALL_SCRIPT} ${WRKBUILD}/register.sh ${PREFIX}/lib/ghc/${DISTNAME} - @${INSTALL_SCRIPT} ${WRKBUILD}/unregister.sh ${PREFIX}/lib/ghc/${DISTNAME} -. endif + @${MODGHC_INSTALL_TARGET} . endif . if !target(do-test) do-test: - @cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \ - ${MODGHC_SETUP_PROG} test + @${MODGHC_TEST_TARGET} . endif . endif .endif diff --git a/lang/mono/mono.port.mk b/lang/mono/mono.port.mk index 51b5cc5e05b..f51ce4d1aa2 100644 --- a/lang/mono/mono.port.mk +++ b/lang/mono/mono.port.mk @@ -1,4 +1,4 @@ -# $OpenBSD: mono.port.mk,v 1.21 2012/03/09 10:59:11 espie Exp $ +# $OpenBSD: mono.port.mk,v 1.22 2013/07/02 08:36:16 espie Exp $ # XXX list in infrastructure/mk/arch-defines.mk # XXX arm powerpc (no support for sigcontext) @@ -29,18 +29,18 @@ NANT_FLAGS?= BUILD_DEPENDS+= devel/nant -MODMONO_BUILD_TARGET= @cd ${WRKSRC} && ${MAKE_FLAGS} ${NANT} ${NANT_FLAGS} -MODMONO_INSTALL_TARGET= @cd ${WRKSRC} && ${MAKE_FLAGS} ${NANT} ${NANT_FLAGS} \ +MODMONO_BUILD_TARGET= cd ${WRKSRC} && ${MAKE_FLAGS} ${NANT} ${NANT_FLAGS} +MODMONO_INSTALL_TARGET= cd ${WRKSRC} && ${MAKE_FLAGS} ${NANT} ${NANT_FLAGS} \ -D:prefix="${PREFIX}" install . if !target(do-build) do-build: - ${MODMONO_BUILD_TARGET} + @${MODMONO_BUILD_TARGET} . endif . if !target(do-install) do-install: - ${MODMONO_INSTALL_TARGET} + @${MODMONO_INSTALL_TARGET} . endif .endif