From cc0036c43b4a662df18c98965ccda613c0d596ec Mon Sep 17 00:00:00 2001 From: Jguer Date: Fri, 7 Dec 2018 13:37:44 +0000 Subject: [PATCH] Detect gccgo and give them their own flags. #824 --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a361f7b3..a3deebd2 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ .PHONY: all default install uninstall test build release clean package -export GO111MODULE=on PREFIX := /usr/local DESTDIR := @@ -10,11 +9,19 @@ PATCHVERSION := 0 VERSION ?= ${MAJORVERSION}.${MINORVERSION}.${PATCHVERSION} LDFLAGS := -ldflags '-s -w -X main.version=${VERSION}' +MOD := -mod=vendor +export GO111MODULE=on ARCH := $(shell uname -m) +GOCC := $(shell go version) PKGNAME := yay BINNAME := yay PACKAGE := ${PKGNAME}_${VERSION}_${ARCH} +ifneq (,$(findstring gccgo,$(GOCC))) + LDFLAGS := -gccgoflags '-s -w' + MOD := +endif + default: build all: | clean package @@ -40,7 +47,7 @@ test: go test -v build: - go build -mod=vendor -v ${LDFLAGS} -o ${BINNAME} + go build -v ${LDFLAGS} -o ${BINNAME} ${MOD} release: | test build mkdir ${PACKAGE}