Makefile for easy dev and release building.

This commit is contained in:
Marcus Carlsson
2016-12-30 09:38:49 +01:00
parent 862b2fc891
commit 275e56cc99

30
Makefile Normal file
View File

@ -0,0 +1,30 @@
DIST_DIRS:= find * -type d -exec
VERSION:=$(shell git describe --tags)
all: vendor xmonad-log
xmonad-log: main.go
go build -o $@ $^
vendor: glide.lock glide.yaml
glide install
clean:
rm -rf ./vendor
rm -rf ./dist
rm -f ./xmonad-log
build-all: vendor
gox -verbose \
-os="linux" \
-arch="amd64 386" \
-output="dist/{{.OS}}-{{.Arch}}/{{.Dir}}"
dist: build-all
cd dist && \
$(DIST_DIRS) tar -zcf xmonad-log-${VERSION}-{}.tar.gz -C {} xmonad-log \; && \
$(DIST_DIRS) zip -r xmonad-log-${VERSION}-{}.zip -j {}/xmonad-log \; && \
cd ..
.PHONY: all build-all clean dist