-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 785 Bytes
/
Makefile
File metadata and controls
34 lines (25 loc) · 785 Bytes
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
BIN=secrets
OS=$(shell uname -s)
ARCH=$(shell uname -m)
GOVERSION=$(shell go version)
GOBIN=$(shell go env GOBIN)
VERSION=$(shell git describe --tags --candidates=1)
FLAGS=-X main.Version=$(VERSION) -s -w
SRC=$(shell find . -name '*.go')
deps:
glide install -v
test:
go test -v $(shell go list ./... | grep -v /vendor/)
build:
go build -o $(BIN) -ldflags="$(FLAGS)" .
install:
go install -ldflags="$(FLAGS)" .
$(BIN)-linux-amd64: $(SRC)
GOOS=linux GOARCH=amd64 go build -o $@ -ldflags="$(FLAGS)" .
$(BIN)-darwin-amd64: $(SRC)
GOOS=darwin GOARCH=amd64 go build -o $@ -ldflags="$(FLAGS)" .
$(BIN)-windows-386: $(SRC)
GOOS=windows GOARCH=386 go build -o $@ -ldflags="$(FLAGS)" .
release: $(BIN)-linux-amd64 $(BIN)-darwin-amd64 $(BIN)-windows-386\
clean:
rm -f $(BIN)-*-*