Makefile 707 Bytes
Newer Older
Loïck Bonniot's avatar
Loïck Bonniot committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
REVISION := $(shell git rev-parse HEAD || echo )
VERSION := $(shell git tag --points-at HEAD | grep -m1 v[0-9] | sed -e 's/^v//g' )
ifeq ($(VERSION),)
	VERSION := master
endif

.PHONY:

release: clean build_all package

clean:
	rm -rf release

build_all:
	go get github.com/mitchellh/gox
Richer Maximilien's avatar
Richer Maximilien committed
16
	gox -os "linux darwin windows" -parallel 1 -output "release/dfss_${VERSION}_{{.OS}}_{{.Arch}}/{{.Dir}}" dfss/dfssc dfss/dfssd dfss/dfssp dfss/dfsst
Loïck Bonniot's avatar
Loïck Bonniot committed
17
18
19
20
21
22
23
24
25

package:
	echo "$(VERSION) $(REVISION)" > build/embed/VERSION
	cd release && ls -1 . | xargs -n1 -I {} cp ../build/embed/* {}/
	cd release && ls -1 . | xargs -n1 -I {} tar zcvf {}.tar.gz {}

deploy:
	mkdir -p /deploy/$(VERSION)
	cp release/*.tar.gz /deploy/$(VERSION)/