forked from presslabs/dockerize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
24 lines (18 loc) · 903 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
.PHONY : dockerize clean fmt
TAG:=`git describe --abbrev=5 --dirty --tags`
LDFLAGS:=-X main.buildVersion=$(TAG)
all: dockerize
dockerize:
echo "Building dockerize"
go install -ldflags "$(LDFLAGS)"
dist-clean:
rm -rf dist
rm -f dockerize-*.tar.gz
dist: dist-clean
mkdir -p dist/linux/amd64 && GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags "$(LDFLAGS)" -o dist/linux/amd64/dockerize
mkdir -p dist/linux/386 && GOOS=linux GOARCH=386 go build -a -tags netgo -ldflags "$(LDFLAGS)" -o dist/linux/386/dockerize
mkdir -p dist/darwin/amd64 && GOOS=darwin GOARCH=amd64 go build -a -tags netgo -ldflags "$(LDFLAGS)" -o dist/darwin/amd64/dockerize
release: dist
tar -cvzf dockerize-linux-amd64-$(TAG).tar.gz -C dist/linux/amd64 dockerize
tar -cvzf dockerize-linux-386-$(TAG).tar.gz -C dist/linux/386 dockerize
tar -cvzf dockerize-darwin-amd64-$(TAG).tar.gz -C dist/darwin/amd64 dockerize