Use automatic extension naming when running go build
This commit is contained in:
parent
4551b4c5d2
commit
627f0e5d9d
|
@ -1,3 +1,4 @@
|
||||||
/build
|
/build
|
||||||
/telegraf
|
/telegraf
|
||||||
|
/telegraf.exe
|
||||||
/telegraf.gz
|
/telegraf.gz
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -12,8 +12,6 @@ else
|
||||||
PATH := $(subst :,/bin:,$(GOPATH))/bin:$(PATH)
|
PATH := $(subst :,/bin:,$(GOPATH))/bin:$(PATH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TELEGRAF := telegraf$(shell go tool dist env | grep -q 'GOOS=.windows.' && echo .exe)
|
|
||||||
|
|
||||||
LDFLAGS := $(LDFLAGS) -X main.commit=$(COMMIT) -X main.branch=$(BRANCH)
|
LDFLAGS := $(LDFLAGS) -X main.commit=$(COMMIT) -X main.branch=$(BRANCH)
|
||||||
ifdef VERSION
|
ifdef VERSION
|
||||||
LDFLAGS += -X main.version=$(VERSION)
|
LDFLAGS += -X main.version=$(VERSION)
|
||||||
|
@ -29,7 +27,7 @@ deps:
|
||||||
gdm restore
|
gdm restore
|
||||||
|
|
||||||
telegraf:
|
telegraf:
|
||||||
go build -i -o $(TELEGRAF) -ldflags "$(LDFLAGS)" ./cmd/telegraf/telegraf.go
|
go build -i -ldflags "$(LDFLAGS)" ./cmd/telegraf
|
||||||
|
|
||||||
go-install:
|
go-install:
|
||||||
go install -ldflags "-w -s $(LDFLAGS)" ./cmd/telegraf
|
go install -ldflags "-w -s $(LDFLAGS)" ./cmd/telegraf
|
||||||
|
|
Loading…
Reference in New Issue