-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (36 loc) · 879 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
39
40
41
42
43
44
45
46
PROGRAM=bam
VERSION=0.1.0
LDFLAGS="-X main.programVersion=$(VERSION)"
all: test
deps:
go get ./...
tools:
go get github.com/mjibson/esc
server:
./bam -config examples/bam.conf
build: deps
go build -o ./examples/fileserver/fileserver ./examples/fileserver
go build -o ./examples/ping/ping ./examples/ping
go build
generate:
go generate
test: build
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; \
GOOS=$$os GOARCH=$$arch go build -ldflags $(LDFLAGS) -o $$target/$(PROGRAM) ; \
cp ./README.md ./LICENSE $$target; \
tar -zcf $$target.tar.gz $$target; \
rm -rf $$target; \
done \
done
clean:
rm -rf *.tar.gz