From 2d1efcc270c854ae8484dae8c3edf5fd14a63c63 Mon Sep 17 00:00:00 2001 From: Mura Li Date: Wed, 5 Apr 2017 16:10:32 +0800 Subject: [PATCH] Add GOFLAGS and EXTRA_GOFLAGS (#1438) --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 63dab1680a..3614364df6 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ BINDATA := modules/{options,public,templates}/bindata.go STYLESHEETS := $(wildcard public/less/index.less public/less/_*.less) JAVASCRIPTS := +GOFLAGS := -i -v +EXTRA_GOFLAGS ?= + LDFLAGS := -X "main.Version=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')" -X "main.Tags=$(TAGS)" PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations,$(shell go list ./... | grep -v /vendor/)) @@ -93,7 +96,7 @@ install: $(wildcard *.go) build: $(EXECUTABLE) $(EXECUTABLE): $(SOURCES) - go build -i -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@ + go build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@ .PHONY: docker docker: