-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
18 lines (14 loc) · 894 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
REVISION := $(shell git rev-list -1 HEAD)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
VERSION := 0.0.1
BUILD_VARS := -X main.exporterBranch=$(BRANCH) -X main.exporterVersion=$(VERSION) -X main.exporterRevision=$(REVISION)
all: clean build
clean:
rm -f ./bin/*
build: bin/cwlogstream_exporter-darwin-amd64 bin/cwlogstream_exporter-linux-amd64 bin/cwlogstream_exporter-windows-amd64.exe
bin/cwlogstream_exporter-darwin-amd64:
GO111MODULE=on GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w $(BUILD_VARS)" -o ./bin/cwlogstream_exporter-darwin-amd64
bin/cwlogstream_exporter-linux-amd64:
GO111MODULE=on GOOS=linux GOARCH=amd64 go build -ldflags="-s -w $(BUILD_VARS)" -o ./bin/cwlogstream_exporter-linux-amd64
bin/cwlogstream_exporter-windows-amd64.exe:
GO111MODULE=on GOOS=windows GOARCH=amd64 go build -ldflags="-s -w $(BUILD_VARS)" -o ./bin/cwlogstream_exporter-windows-amd64.exe