Changeset View
Changeset View
Standalone View
Standalone View
head/Mk/Uses/go.mk
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
# Additional build arguments to be passed to the `go install` command | # Additional build arguments to be passed to the `go install` command | ||||
# | # | ||||
# GO_PORT | # GO_PORT | ||||
# The Go port to use. By default this is lang/go but can be set | # The Go port to use. By default this is lang/go but can be set | ||||
# to lang/go-devel in make.conf for testing with future Go versions. | # to lang/go-devel in make.conf for testing with future Go versions. | ||||
# | # | ||||
# This variable must not be set by individual ports! | # This variable must not be set by individual ports! | ||||
# | # | ||||
# MAINTAINER: jlaffaye@FreeBSD.org | # MAINTAINER: dg@syrec.org | ||||
.if !defined(_INCLUDE_USES_GO_MK) | .if !defined(_INCLUDE_USES_GO_MK) | ||||
_INCLUDE_USES_GO_MK= yes | _INCLUDE_USES_GO_MK= yes | ||||
.if !empty(go_ARGS:Nmodules:Nno_targets:Nrun) | .if !empty(go_ARGS:Nmodules:Nno_targets:Nrun) | ||||
IGNORE= USES=go has invalid arguments: ${go_ARGS:Nmodules:Nno_targets:Nrun} | IGNORE= USES=go has invalid arguments: ${go_ARGS:Nmodules:Nno_targets:Nrun} | ||||
.endif | .endif | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
post-extract: | post-extract: | ||||
@${MKDIR} ${GO_WRKSRC:H} | @${MKDIR} ${GO_WRKSRC:H} | ||||
@${LN} -sf ${WRKSRC} ${GO_WRKSRC} | @${LN} -sf ${WRKSRC} ${GO_WRKSRC} | ||||
.endif | .endif | ||||
.if !target(do-build) && empty(go_ARGS:Mno_targets) | .if !target(do-build) && empty(go_ARGS:Mno_targets) | ||||
do-build: | do-build: | ||||
(cd ${GO_WRKSRC}; \ | (cd ${GO_WRKSRC}; \ | ||||
${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} install ${GO_BUILDFLAGS} ${GO_TARGET}) | ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} install ${GO_BUILDFLAGS} ${GO_TARGET:S/^${PORTNAME}$/./}) | ||||
.endif | .endif | ||||
.if !target(do-install) && empty(go_ARGS:Mno_targets) | .if !target(do-install) && empty(go_ARGS:Mno_targets) | ||||
do-install: | do-install: | ||||
.for _TARGET in ${GO_TARGET} | .for _TARGET in ${GO_TARGET} | ||||
${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/${_TARGET:T} ${STAGEDIR}${PREFIX}/bin | ${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/${_TARGET:T:S/^.$/${PORTNAME}/} ${STAGEDIR}${PREFIX}/bin | ||||
.endfor | .endfor | ||||
.endif | .endif | ||||
.endif # defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_GO_POST_MK) | .endif # defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_GO_POST_MK) |