-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
61 lines (50 loc) · 1.4 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
# Build pdfs for the TeX files
# '-recursive' rules are based on a Makefile by Santiago Gonzalez Gancedo
# which was a modified version of a Makefile by Johannes Ranke,
# which was based on Makesfiles by Tadeusz Pietraszek
TEXFILES=$(wildcard *.tex)
TARGETS=$(patsubst %.tex,%.pdf,$(TEXFILES))
TEX_DIRECTORIES=$(sort $(dir $(wildcard */*.tex)))
.PHONY: all
all: latexmk-recursive
.PHONY: distclean
distclean: distclean-recursive
.PHONY: clean
clean: clean-recursive
.PHONY: latexmk-recursive
latexmk-recursive:
for dir in $(TEX_DIRECTORIES); do \
echo '******** starting latexmk ********'; \
cd $$dir; \
echo $$dir; \
latexmk -shell-escape -quiet -pdf *.tex || exit 1; \
echo '******** finished latexmk ********'; \
cd ..; \
done
.PHONY: distclean-recursive
distclean-recursive:
for dir in $(TEX_DIRECTORIES); do \
cd $$dir; \
latexmk -quiet -C *.tex; \
cd ..; \
done
.PHONY: clean-recursive
clean-recursive:
for dir in $(TEX_DIRECTORIES); do \
cd $$dir; \
latexmk -quiet -c *.tex; \
cd ..; \
done
.PHONY: index
index:
python generate_index.py
# Convert notebooks from markdown to ipynb
NOTEBOOKDIR=notebooks
NOTEBOOKSRCS:=$(wildcard $(NOTEBOOKDIR)/*.md)
NOTEBOOKSRCS:=$(filter-out $(NOTEBOOKDIR)/README.md, $(NOTEBOOKSRCS))
NOTEBOOKS:=$(NOTEBOOKSRCS:.md=.ipynb)
%.ipynb:%.md
jupytext $< --to ipynb
.PHONY: notebooks
notebooks: $(NOTEBOOKS)
@echo 'converted notebooks from .md to .ipynb'