-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (28 loc) · 815 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
.SILENT :
.PHONY : docker-mysql clean fmt
OS:=linux
GLIDE_VERSION:=0.6.1
GLIDE_ZIP:=glide-$(OS)-$(GLIDE_VERSION).zip
TAG:=`git describe --abbrev=0 --tags`
LDFLAGS:=-X main.buildVersion=$(TAG)
all: docker-mysql
$(GLIDE_ZIP):
wget https://github.com/Masterminds/glide/releases/download/$(GLIDE_VERSION)/glide-$(OS)-amd64.zip -O $(GLIDE_ZIP)
glide: $(GLIDE_ZIP)
unzip $(GLIDE_ZIP) $(OS)-amd64/glide
mv $(OS)-amd64/glide .
rm -rf $(OS)-amd64
deps: glide
go get github.com/mitchellh/gox
./glide install
test:
go test -v
docker-mysql:
echo "Building docker-mysql"
go build -ldflags "$(LDFLAGS)"
dist-clean:
rm -rf dist
dist: dist-clean
gox -ldflags "$(LDFLAGS)" -os "darwin linux" -output "dist/{{.Dir}}-{{.OS}}-{{.Arch}}"
release: deps dist
ls dist | xargs -I {} tar -cvzf {}-$(TAG).tar.gz dist/{}