Makefile -rw-r--r-- 742 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 bin/pomo
15
16default: bin/pomo test
17
18clean:
19 [[ -f bin/pomo ]] && rm bin/pomo || true
20
21bin/pomo:
22 cd cmd/pomo && \
23 go build -ldflags '${LDFLAGS}' -o ../../$@
24
25test:
26 go test ./...
27 go vet ./...
28
29install:
30 go install ./cmd/...
31
32man/pomo.1: man/pomo.1.scd
33 scdoc < $< > $@
34
35manpages: man/pomo.1
36
37docs: www/data/readme.json
38 cd www && hugo -d ../docs
39
40www/data/readme.json: www/data README.md
41 cat README.md | python -c 'import json,sys; print(json.dumps({"content": sys.stdin.read()}))' > $@
42
43www/data bin:
44 mkdir -p $@