Makefile -rw-r--r-- 632 B
1VERSION ?= $(shell git describe --tags 2>/dev/null)
2ifeq "$(VERSION)" ""
3 VERSION := UNKNOWN
4endif
5
6LDFLAGS=\
7 -X github.com/kevinschoon/pomo/pkg/internal.Version=$(VERSION)
8
9.PHONY: \
10 test \
11 docs \
12 pomo-build \
13 readme
14
15default: bin/pomo
16
17clean:
18 [[ -f bin/pomo ]] && rm bin/pomo || true
19
20bin/pomo: test
21 cd cmd/pomo && \
22 go build -ldflags '${LDFLAGS}' -o ../../$@
23
24test:
25 go test ./...
26 go vet ./...
27
28docs: www/data/readme.json
29 cd www && hugo -d ../docs
30
31www/data/readme.json: www/data README.md
32 cat README.md | python -c 'import json,sys; print(json.dumps({"content": sys.stdin.read()}))' > $@
33
34www/data bin:
35 mkdir -p $@