-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
41 lines (30 loc) · 1.11 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
SRC=$(shell find . -name "*.go")
BIN="./bin"
.PHONY: vet deps clean
build: ensure-dir build-linux build-windows build-darwin compress
all: vet build
deps:
$(info ******************** downloading dependencies ********************)
go get -v ./...
clean:
$(info ******************** clean bin ********************)
rm -rf $(BIN)
ensure-dir:
$(info ******************** ensure dir ********************)
rm -rf bin
mkdir bin
build-linux:
$(info ******************** build linux ********************)
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o bin/tomba.linux-amd64 *.go
build-windows:
$(info ******************** build windows ********************)
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o bin/tomba.windows-amd64.exe *.go
build-darwin:
$(info ******************** build darwin ********************)
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o bin/tomba.darwin-amd-64 *.go
compress:
$(info ******************** compress ********************)
cd ./bin && find . -name 'tomba*' | xargs -I{} tar czf {}.tar.gz {}
vet:
$(info ******************** vetting ********************)
go vet ./...