-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (43 loc) · 1.19 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.PHONY: all clean clean-server clean-site distclean \
dev dev-server \
init init-server init-site \
package server site
.NOTPARALLEL:
VENV_NAME ?= .venv
# Main targets
all: package
package: site server
init: init-server init-site
dev: dev-server init-site
clean: clean-site clean-server
distclean: clean
rm -rf node_modules
rm -rf .eggs
rm -rf .venv
# Server targets
init-server: $(VENV_NAME)/bin/activate
dev-server: init-server
$(VENV_NAME)/bin/pip install -e .
server: init-server
$(VENV_NAME)/bin/python -m build
clean-server:
find src/adfotg -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
rm -rf src/adfotg.egg-info build dist
# Site targets
init-site: node_modules
site: node_modules
npm install
npm run dist
clean-site:
rm -rf src/adfotg/site
rm -rf site/dist
# Real targets (impl details)
node_modules:
@echo "Creating NodeJS node_modules ..."
npm install
$(VENV_NAME)/bin/activate:
@echo "Creating virtual environment ..."
python3 -m venv $(VENV_NAME)
@echo "Installing build dependencies ..."
$(VENV_NAME)/bin/pip install -U pip setuptools wheel build
@echo "Virtual environment created. Activate using it source $(VENV_NAME)/bin/activate"