From ddc0a187c8b6fce80e12d27f74f5526a161f2c02 Mon Sep 17 00:00:00 2001 From: Ben Woods Date: Sun, 11 Mar 2018 02:24:26 +0000 Subject: [PATCH] Allow USES=go ports to override make targets & include Prior to this change, if a port had: - USES=go.mk, - .include , and - overrode a make target (e.g. post-extract:) then the following warnings were produced when invoking make on the port: make: "/usr/local/poudriere/ports/default/CATEGORY/PORT/Makefile" line XX: warning: duplicate script for target "post-extract" ignored make: "/usr/local/poudriere/ports/default/Mk/Uses/go.mk" line 68: warning: using previous script for "post-extract" defined here This change fixes this issue by wrapping the definition of make targets in a separate once-only !defined wrapper which is blocked until post.mk. This concept was copied from Mk/Uses/python.mk. PR: 224948 Submitted by: woodsb02 Approved by: jlaffaye (maintainer) --- Mk/Uses/go.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Mk/Uses/go.mk b/Mk/Uses/go.mk index eb63d03e2bee..d526ee61a43d 100644 --- a/Mk/Uses/go.mk +++ b/Mk/Uses/go.mk @@ -62,6 +62,12 @@ PLIST_SUB+= GO_LIBDIR=${GO_LIBDIR} \ GO_SRCDIR=${GO_SRCDIR} \ GO_PKGNAME=${GO_PKGNAME} +_USES_POST+= go +.endif # !defined(_INCLUDE_USES_GO_MK) + +.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_GO_POST_MK) +_INCLUDE_USES_GO_POST_MK= yes + .if !target(post-extract) post-extract: @${MKDIR} ${GO_WRKSRC:H} @@ -90,4 +96,4 @@ do-install: .endfor .endif -.endif +.endif # defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_GO_POST_MK)