forked from influxdata/kapacitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (41 loc) · 1.32 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
VERSION := $(shell sh -c 'git describe --always --tags')
BRANCH:= $(shell sh -c 'git rev-parse --abbrev-ref HEAD')
COMMIT:= $(shell sh -c 'git rev-parse HEAD')
ifndef GOBIN
GOBIN = $(GOPATH)/bin
endif
#GO=$(GOBIN)/godep go
GO=go
LDFLAGS="-X main.version=$(VERSION) -X main.branch=$(BRANCH) -X main.commit=$(COMMIT)"
build: prepare
$(GO) build -o kapacitor -ldflags=$(LDFLAGS) \
./cmd/kapacitor/main.go
$(GO) build -o kapacitord -ldflags=$(LDFLAGS) \
./cmd/kapacitord/main.go
build-linux-bins: prepare
GOARCH=amd64 GOOS=linux $(GO) build -o kapacitor_linux_amd64 \
-ldflags=$(LDFLAGS) \
./cmd/kapacitor/main.go
GOARCH=amd64 GOOS=linux $(GO) build -o kapacitord_linux_amd64 \
-ldflags=$(LDFLAGS) \
./cmd/kapacitord/main.go
GOARCH=386 GOOS=linux $(GO) build -o kapacitor_linux_386 \
-ldflags=$(LDFLAGS) \
./cmd/kapacitor/main.go
GOARCH=386 GOOS=linux $(GO) build -o kapacitord_linux_386 \
-ldflags=$(LDFLAGS) \
./cmd/kapacitord/main.go
GOARCH=arm GOOS=linux $(GO) build -o kapacitor_linux_arm \
-ldflags=$(LDFLAGS) \
./cmd/kapacitor/main.go
GOARCH=arm GOOS=linux $(GO) build -o kapacitord_linux_arm \
-ldflags=$(LDFLAGS) \
./cmd/kapacitord/main.go
prepare:
go get -u -t ./...
test: prepare
$(GO) tool vet --composites=false ./
$(GO) test ./...
test-short: prepare
$(GO) test -short ./...
.PHONY: test