-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
44 lines (30 loc) · 816 Bytes
/
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
44
SRC_DIR := drawbot
CONF := vars/config.json
PY_ENV := venv
PY_BIN := $(PY_ENV)/bin
PIP := $(PY_BIN)/pip
CMD_NOT_FOUND = $(error $(strip $(1)) is required for this rule)
CHECK_CMD = $(if $(shell command -v $(1)),, $(call CMD_NOT_FOUND, $(1)))
all: start
$(CONF):
@ cp vars/config.json.example vars/config.json
$(PIP): $(PY_ENV)
$(PY_BIN)/drawbot: $(PY_ENV)
@ $(PIP) install -e .
$(PY_ENV):
$(call CHECK_CMD, python3)
@ python3 -m venv venv
@ chmod +x $(PY_BIN)/activate
$(info Use source $(PY_BIN)/activate to enable venv overriding!)
start: $(PY_BIN)/drawbot $(CONF)
@ $(PY_BIN)/python3 drawbot
clean:
$(RM) -r *.egg-info
find $(SRC_DIR) -type f -name "*.pyc" -exec rm -rf {} +
fclean: clean
$(RM) -r $(PY_ENV)
$(RM) $(CONF)
$(RM) vars/*.json
.PHONY: clean fclean
re: fclean all
.PHONY: re