-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
38 lines (31 loc) · 788 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
30
31
32
33
34
35
36
37
38
PROGRAM=stats-tools
VERSION=0.0.1
LDFLAGS="-X stats.programVersion=$(VERSION)"
all: test
deps:
go get ./...
install: deps
go install -a -v -ldflags $(LDFLAGS) ./cmd/...
test: deps
go test -v ./...
qa:
go vet
golint
go test -coverprofile=.cover~
go tool cover -html=.cover~
dist:
@for os in linux darwin; do \
for arch in 386 amd64; do \
target=$(PROGRAM)-$$os-$$arch-$(VERSION); \
echo Building $$target; \
mkdir $$target; \
cp ./README.md ./LICENSE $$target; \
for tool in $$(ls ./cmd); do \
GOOS=$$os GOARCH=$$arch go build -ldflags $(LDFLAGS) -o $$target/$$tool ./cmd/$$tool ; \
done; \
tar -zcf $$target.tar.gz $$target; \
rm -rf $$target; \
done \
done
clean:
rm -rf *.tar.gz