Use automatic extension naming when running go build

This commit is contained in:
Daniel Nelson 2018-04-04 19:00:28 -07:00
parent 4551b4c5d2
commit 627f0e5d9d
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
2 changed files with 2 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/build
/telegraf
/telegraf.exe
/telegraf.gz

View File

@ -12,8 +12,6 @@ else
PATH := $(subst :,/bin:,$(GOPATH))/bin:$(PATH)
endif
TELEGRAF := telegraf$(shell go tool dist env | grep -q 'GOOS=.windows.' && echo .exe)
LDFLAGS := $(LDFLAGS) -X main.commit=$(COMMIT) -X main.branch=$(BRANCH)
ifdef VERSION
LDFLAGS += -X main.version=$(VERSION)
@ -29,7 +27,7 @@ deps:
gdm restore
telegraf:
go build -i -o $(TELEGRAF) -ldflags "$(LDFLAGS)" ./cmd/telegraf/telegraf.go
go build -i -ldflags "$(LDFLAGS)" ./cmd/telegraf
go-install:
go install -ldflags "-w -s $(LDFLAGS)" ./cmd/telegraf