-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
80 lines (63 loc) · 1.99 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
VENV = .venv
GNUMAKEFLAGS=--no-print-directory
ifeq ($(BUILD_DEPS),true)
PYTHON = $(VENV)/bin/python3
PIP = $(VENV)/bin/pip
else
PYTHON = python3
PIP = pip
endif
MAKEFILES=$(shell find src -type f -name "Makefile" -exec dirname "{}" \; | sed 's/ /\\ /g')
MARKDOWN_FILES=$(shell find src -type f -name "*.md" | sed 's/ /\\ /g')
PDF_FILES=$(shell find src -type f -name "*.pdf" | sed 's/ /\\ /g')
LIB_DAISY=lib/libDaisy
LIB_DAISY_SP=lib/DaisySP
.PHONY: all build clean distclean
all: build
build:
ifeq ($(BUILD_DEPS),true)
build: $(VENV)/bin/activate LibDaisy DaisySP $(MAKEFILES) static_files content/elektrophon.html
else
build: LibDaisy DaisySP $(MAKEFILES) static_files content/elektrophon.html
endif
static_files:
$(foreach F, $(MARKDOWN_FILES), \
install $F -D content/post/$(F:src/%=%); \
)
$(foreach F, $(PDF_FILES), \
install $F -D content/post/$(F:src/%=%); \
)
$(VENV)/bin/activate: requirements.txt
python3 -m venv $(VENV)
$(PYTHON) -m pip install --upgrade pip
$(PIP) install -r requirements.txt
ln -s /usr/lib/python3.11/site-packages/pcbnew.py .venv/lib/python3.11/site-packages/pcbnew.py
ln -s /usr/lib/python3.11/site-packages/_pcbnew.so .venv/lib/python3.11/site-packages/_pcbnew.so
DaisySP:
make -C $(LIB_DAISY);
LibDaisy:
make -C $(LIB_DAISY_SP);
.PHONY: $(MAKEFILES)
$(MAKEFILES):
make BUILD_DEPS=$(BUILD_DEPS) -s -C $@
site: build
hugo
serve: build
hugo serve -D
clean:
$(foreach var,$(MAKEFILES), make -s -C $(var) clean;)
rm -rf static/pdoc
rm -rf public
rm -rf resources
make -C $(LIB_DAISY_SP) clean;
make -C $(LIB_DAISY) clean;
rm -rf content/post
rm -f content/elektrophon.html
distclean: clean
$(foreach var,$(MAKEFILES), make -s -C $(var) distclean;)
rm -rf $(VENV)
content/elektrophon.html: lib/python/elektrophon/__init__.py lib/python/makedoc/__main__.py
mkdir -p static/pdoc
python lib/python/makedoc
PYTHONPATH=:./lib/python python -m pdoc --no-search -t lib/pdoc -o content elektrophon
rm content/index.html