diff mbox series

[2/3] go: honor building with V=1 for debugging purposes

Message ID 20180511101020.10295-3-anisse@astier.eu
State Changes Requested
Headers show
Series go package fixes | expand

Commit Message

Anisse Astier May 11, 2018, 10:10 a.m. UTC
Signed-off-by: Anisse Astier <anisse@astier.eu>
---
 package/go/go.mk | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Thomas Petazzoni May 11, 2018, 11:11 a.m. UTC | #1
Hello Anisse,

On Fri, 11 May 2018 12:10:19 +0200, Anisse Astier wrote:
> Signed-off-by: Anisse Astier <anisse@astier.eu>
> ---
>  package/go/go.mk | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/package/go/go.mk b/package/go/go.mk
> index 37bb9801c2..bc5aca2bb7 100644
> --- a/package/go/go.mk
> +++ b/package/go/go.mk
> @@ -76,10 +76,13 @@ HOST_GO_TARGET_CC = \
>  	CC_FOR_TARGET="$(TARGET_CC)" \
>  	CXX_FOR_TARGET="$(TARGET_CXX)"
>  
> +ifneq ($(V),)
> +VERBOSE=-v

Please name the variable GO_VERBOSE and not just VERBOSE. Remember that
Buildroot has a global namespace of make variables, so if you define
VERBOSE here, you override the value of the VERBOSE variable defined in
the main Makefile.

Also, please use VERBOSE instead of testing $(V).

Perhaps do just like cargo.mk is doing:

HOST_CARGO_SNAP_OPTS = \
        --release \
        $(if $(VERBOSE),--verbose)

Thanks!

Thomas
diff mbox series

Patch

diff --git a/package/go/go.mk b/package/go/go.mk
index 37bb9801c2..bc5aca2bb7 100644
--- a/package/go/go.mk
+++ b/package/go/go.mk
@@ -76,10 +76,13 @@  HOST_GO_TARGET_CC = \
 	CC_FOR_TARGET="$(TARGET_CC)" \
 	CXX_FOR_TARGET="$(TARGET_CXX)"
 
+ifneq ($(V),)
+VERBOSE=-v
+endif
 
 define HOST_GO_BUILD_CMDS
 	cd $(@D)/src && \
-		$(HOST_GO_MAKE_ENV) $(HOST_GO_TARGET_CC) CGO_ENABLED=$(HOST_GO_CGO_ENABLED) ./make.bash
+		$(HOST_GO_MAKE_ENV) $(HOST_GO_TARGET_CC) CGO_ENABLED=$(HOST_GO_CGO_ENABLED) ./make.bash $(VERBOSE)
 endef
 
 define HOST_GO_INSTALL_CMDS