-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
34 lines (26 loc) · 999 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
DOCDIR = doc
.PHONY: all tangle tangle_clean html doc_clean clean
all: html tangle
# Run sphinx tangle build, then copy python files to source tree. We depend on
# tangle_clean to ensure no orphaned files are left behind after a module rename
# on the literate documentation side. This process is so quick it's not really
# a problem to redo it from scratch each time.
tangle: tangle_clean
make -C $(DOCDIR) tangle
cp -R $(DOCDIR)/_build/tangle/rasmodel .
# Enumerate all .py files generated by the tangle step.
t_sources := $(wildcard rasmodel/components/*.py) \
$(wildcard rasmodel/scenarios/*.py) \
$(wildcard rasmodel/experiments/*.py)
# Omit all instances of __init__.py (not generated).
t_sources := $(t_sources:%/__init__.py=)
# Enumerate corresponding .pyc files.
t_bytecode := $(t_sources:%.py=%.pyc)
# Remove tangle-generated files.
tangle_clean:
rm -f $(t_sources) $(t_bytecode)
html:
make -C $(DOCDIR) html
doc_clean:
make -C $(DOCDIR) clean
clean: tangle_clean doc_clean