2018-01-21 16:38:17 +01:00
|
|
|
VERSION ?= $(shell git describe --tags 2>/dev/null)
|
|
|
|
ifeq "$(VERSION)" ""
|
|
|
|
VERSION := UNKNOWN
|
|
|
|
endif
|
2018-01-21 11:35:03 +01:00
|
|
|
|
|
|
|
.PHONY: \
|
2018-01-21 16:38:17 +01:00
|
|
|
all \
|
2018-01-22 16:07:58 +01:00
|
|
|
test \
|
|
|
|
docs \
|
2018-01-22 17:27:35 +01:00
|
|
|
readme \
|
|
|
|
release
|
2018-01-21 11:35:03 +01:00
|
|
|
|
|
|
|
all: bin/pomo
|
|
|
|
|
|
|
|
clean:
|
2018-01-21 16:38:17 +01:00
|
|
|
rm -v bin/* 2> /dev/null || true
|
2018-01-22 16:07:58 +01:00
|
|
|
rm -v docs/* 2> /dev/null || true
|
2018-01-21 11:35:03 +01:00
|
|
|
|
|
|
|
bindata.go:
|
|
|
|
go-bindata -pkg main -o $@ tomato-icon.png
|
|
|
|
|
2018-01-21 16:38:17 +01:00
|
|
|
test:
|
|
|
|
go test ./...
|
2018-01-26 16:34:21 +01:00
|
|
|
go vet ./...
|
2018-01-21 16:38:17 +01:00
|
|
|
|
2018-01-22 17:27:35 +01:00
|
|
|
release: bindata.go
|
2018-01-21 16:38:17 +01:00
|
|
|
@echo mkdir bin 2>/dev/null || true
|
2018-01-22 17:27:35 +01:00
|
|
|
go build -ldflags "-X main.Version=$(VERSION)" -o bin/pomo-$(VERSION)-linux
|
2018-01-22 15:59:03 +01:00
|
|
|
|
2018-01-22 17:27:35 +01:00
|
|
|
docs: readme
|
2018-01-22 16:07:58 +01:00
|
|
|
cd www && hugo -d ../docs
|
|
|
|
|
|
|
|
readme:
|
2018-01-22 17:27:35 +01:00
|
|
|
cat README.md | python -c 'import json,sys; print(json.dumps({"content": sys.stdin.read()}))' > www/data/readme.json
|