-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
50 lines (40 loc) · 1.54 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
# python interpreter configuration:
# AUTO_3_8 => auto-download python 3.8
# AUTO_3_9 => auto-download python 3.9
# AUTO_3_10 => auto-download python 3.10
PYTHON=AUTO_3_10
-include .common_makefiles/common_makefile.mk
-include .common_makefiles/shell_makefile.mk
-include .common_makefiles/python_makefile.mk
REMOVE_DIST=0
export REFERENCE=docs/90-reference
APP_DIRS=common_makefiles
TEST_DIRS=tests
SRC_MAKEFILES=$(shell ls src/*.mk)
REF_MAKEFILES=$(subst .mk,.md,$(addprefix $(REFERENCE)/,$(subst src/,,$(SRC_MAKEFILES))))
DIST_MAKEFILES=$(subst src/,dist/,$(SRC_MAKEFILES))
BOOTSTRAP=dist/extra.tar.gz $(DIST_MAKEFILES)
all:: $(BOOTSTRAP) $(REFERENCE)/makefile_to_json.py $(REF_MAKEFILES)
.PHONY: bootstrap
bootstrap: $(BOOTSTRAP)
dist/%.mk: src/%.mk
cat "$<" |./tools/envtpl-static >"$@"
dist/extra.tar.gz: src/extra
rm -Rf dist/extra*
cp -Rf "$<" dist/
cd dist && tar --dereference -cf extra.tar extra && gzip -f extra.tar
rm -Rf dist/extra
$(REFERENCE)/makefile_to_json.py: common_makefiles/makefile_to_json.py
cp -f "$<" "$@"
chmod +x "$@"
$(REFERENCE)/%.md: $(REFERENCE)/reference.md.j2 dist/%.mk
$(ENTER_VENV) && T=$$(echo $^ |cut -f2 -d' ') && export MAKEFILE=$$(basename "$${T}") && cat "$<" |./tools/envtpl-static >"$@"
custom_clean::
rm -f $(REFERENCE)/*.md $(REFERENCE)/*.py
custom_distclean::
rm -Rf dist/*
.PHONY: htmldoc serve_htmldoc
htmldoc: devenv $(REFERENCE)/makefile_to_json.py $(REF_MAKEFILES)
$(ENTER_VENV) && mkdocs build
serve_htmldoc: $(REFERENCE)/makefile_to_json.py $(REF_MAKEFILES)
$(ENTER_VENV) && mkdocs serve