From 627f0e5d9d961205c6d7b5247c0d3e2aca4c7b7b Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Wed, 4 Apr 2018 19:00:28 -0700 Subject: [PATCH] Use automatic extension naming when running go build --- .gitignore | 1 + Makefile | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 66a7c7c0a..c584e6c14 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /build /telegraf +/telegraf.exe /telegraf.gz diff --git a/Makefile b/Makefile index 9ca4fc458..d8a82050a 100644 --- a/Makefile +++ b/Makefile @@ -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