forked from ligurio/litclock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (30 loc) · 1.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This way everything works as expected ever for
# `make -C /path/to/project` or
# `make -f /path/to/project/Makefile`.
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
PROJECT_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))
PREFIX ?= /usr
PREFIX_MAN = ${PREFIX}/share/man
QUOTES ?= $(PROJECT_DIR)/quotes/quotes_ru.csv
TARGET_DIR ?= static/times/
JSON_DATA = ${TARGET_DIR}/*.json
LITCLOCK_SCRIPT = litclock
LITCLOCK_MAN = litclock.1
all: build
build: ${QUOTES}
@python build.py --filename $< --path ${TARGET_DIR}
check: check-data check-man check-pep8
check-data: ${QUOTES}
@python build.py --filename $< --dry-run
check-man: ${LITCLOCK_MAN}
@mandoc -Tlint $< -W style
check-pep8: build.py
@autopep8 --diff $<
www:
@python -m http.server 8000 --bind 127.0.0.1
install: ${LITCLOCK_SCRIPT} ${LITCLOCK_MAN}
@install ${LITCLOCK_SCRIPT} ${PREFIX}/local/bin/${LITCLOCK_SCRIPT}
@install ${LITCLOCK_MAN} ${PREFIX_MAN}/man1/${LITCLOCK_MAN}
clean:
@rm -f ${JSON_DATA}
.PHONY: build check check-data check-man check-pep8 install www clean