Index: Mk/Uses/go.mk =================================================================== --- Mk/Uses/go.mk +++ Mk/Uses/go.mk @@ -104,15 +104,8 @@ GOARM=${GOARM} .if ${go_ARGS:Mmage} -MAGE_CMD= ${LOCALBASE}/bin/mage BUILD_DEPENDS+= mage>=1.9.0:devel/mage -_GO_BUILD_CMD=${MAGE_CMD} -gocmd ${GO_CMD} -d $${pkg} build -_GO_TEST_CMD=${MAGE_CMD} -gocmd ${GO_CMD} -d $${t} test -.else -_GO_BUILD_CMD=${GO_CMD} build ${GO_BUILDFLAGS} \ - -o ${GO_WRKDIR_BIN}/$${out} \ - $${pkg} -_GO_TEST_CMD=${GO_CMD} test ${GO_TESTFLAGS} $${t} +MAGE_CMD= ${LOCALBASE}/bin/mage .endif .if ${go_ARGS:Mmodules} @@ -141,6 +134,16 @@ .if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_GO_POST_MK) _INCLUDE_USES_GO_POST_MK= yes +.if ${go_ARGS:Mmage} +_GO_BUILD_CMD=${MAGE_CMD} -gocmd ${GO_CMD} -d $${pkg} build +_GO_TEST_CMD=${MAGE_CMD} -gocmd ${GO_CMD} -d $${t} test +.else +_GO_BUILD_CMD=${GO_CMD} build ${GO_BUILDFLAGS} \ + -o ${GO_WRKDIR_BIN}/$${out} \ + $${pkg} +_GO_TEST_CMD=${GO_CMD} test ${GO_TESTFLAGS} $${t} +.endif + .if !target(post-extract) && empty(go_ARGS:Mno_targets) post-extract: @${MKDIR} ${GO_WRKSRC:H}