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
|
|
|
|
2020-09-08 18:35:47 +02:00
|
|
|
LDFLAGS=\
|
2021-07-29 03:36:33 +02:00
|
|
|
-X github.com/kevinschoon/pomo/pkg/internal.Version=$(VERSION)
|
2020-09-08 18:35:47 +02:00
|
|
|
|
2018-01-21 11:35:03 +01:00
|
|
|
.PHONY: \
|
2018-01-22 16:07:58 +01:00
|
|
|
test \
|
|
|
|
docs \
|
2019-03-17 20:10:28 +01:00
|
|
|
pomo-build \
|
2021-07-29 02:00:16 +02:00
|
|
|
readme
|
2018-01-21 11:35:03 +01:00
|
|
|
|
2022-05-29 03:24:10 +02:00
|
|
|
default: bin/pomo test
|
2021-10-10 17:32:10 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
[[ -f bin/pomo ]] && rm bin/pomo || true
|
2020-09-08 18:35:47 +02:00
|
|
|
|
2022-05-29 03:24:10 +02:00
|
|
|
bin/pomo:
|
2020-09-08 18:35:47 +02:00
|
|
|
cd cmd/pomo && \
|
|
|
|
go build -ldflags '${LDFLAGS}' -o ../../$@
|
2018-07-12 21:04:02 +02:00
|
|
|
|
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
|
|
|
|
2019-02-10 21:39:45 +01:00
|
|
|
docs: www/data/readme.json
|
2021-07-29 02:00:16 +02:00
|
|
|
cd www && hugo -d ../docs
|
2018-02-01 10:00:51 +01:00
|
|
|
|
2018-02-01 10:10:24 +01:00
|
|
|
www/data/readme.json: www/data README.md
|
2018-02-01 10:13:39 +01:00
|
|
|
cat README.md | python -c 'import json,sys; print(json.dumps({"content": sys.stdin.read()}))' > $@
|
2019-02-10 21:39:45 +01:00
|
|
|
|
2018-02-01 10:06:05 +01:00
|
|
|
www/data bin:
|
2018-02-01 10:00:51 +01:00
|
|
|
mkdir -p $@
|