forked from lucianjon/zk-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
29 lines (22 loc) · 760 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
export SHELL:=/usr/bin/env bash -O extglob -c
export GO15VENDOREXPERIMENT:=1
export OS=$(shell uname | tr '[:upper:]' '[:lower:]')
build: GOOS ?= ${OS}
build: GOARCH ?= amd64
build: test
rm -f zk-exporter
GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags "-X main.buildTime=`date --iso-8601=s` -X main.buildVersion=`git rev-parse HEAD | cut -c-7`" -o zk-exporter .
release-linux:
GOOS=linux $(MAKE) build
tar Jcf zk-exporter-`git describe --abbrev=0 --tags`-linux-amd64.txz zk-exporter
release-darwin:
GOOS=darwin $(MAKE) build
tar Jcf zk-exporter-`git describe --abbrev=0 --tags`-darwin-amd64.txz zk-exporter
release: clean release-linux release-darwin
test:
go test -v
clean:
rm -f zk-exporter
rm -f zk-exporter-*.txz
run: build
./zk-exporter