-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (35 loc) · 1.06 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
GOPATH ?= /go
GOBIN := $(GOPATH)/bin
PATH := $(GOROOT)/bin:$(PATH)
all: deps test organizer
deps:
GOPATH=$(GOPATH) glide install
test: deps
GOPATH=$(GOPATH) go test -v $(glide novendor)
organizer: deps
# always format code
GOPATH=$(GOPATH) go fmt $(glide novendor)
# vet it
GOPATH=$(GOPATH) go tool vet *.go
# binary
GOPATH=$(GOPATH) go build -o $@ -v $(glide novendor)
touch $@
linux64: deps
# always format code
GOPATH=$(GOPATH) go fmt $(glide novendor)
# vet it
GOPATH=$(GOPATH) go tool vet *.go
# binary
GOOS=linux GOARCH=amd64 GOPATH=$(GOPATH) go build -o organizer-linux-amd64.bin -v $(glide novendor)
touch organizer-linux-amd64.bin
win64: deps
# always format code
GOPATH=$(GOPATH) go fmt $(glide novendor)
# vet it
GOPATH=$(GOPATH) go tool vet *.go
# binary
GOOS=windows GOARCH=amd64 GOPATH=$(GOPATH) go build -o organizer-win-amd64.exe -v $(glide novendor)
touch organizer-win-amd64.exe
.PHONY: $(DEPS) clean
clean:
rm -rf organizer organizer-win-amd64.exe organizer-linux-amd64.bin .glide vendor