forked from edunumsec2/book
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
63 lines (42 loc) · 1.71 KB
/
makefile
File metadata and controls
63 lines (42 loc) · 1.71 KB
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
.ONESHELL:
WEB_CHAPTERS = rep-info archi algo1 prog1 resx algo2 prog2 projets hist
PRINT_CHAPTERS = rep-info archi algo1 resx algo2
WEB_BUILD_DIR = build/appr
LATEX_BUILD_DIR = build/latex/appr
MD_SOURCE_DIR = src/appr
EXT_DIR = src/exts
LATEX_FORMAT_DIR = src/static/latex
# all: web print
# mkdir -p build/appr/media && cp build/latex/appr/rep_info.pdf build/appr/media/rep-info.pdf && cp build/latex/appr/archi.pdf build/appr/media/archi.pdf
# ext: $(wildcard $(EXT_DIR)*.py):
# echo "$^"
sources: $(addsuffix /*.md, $(addprefix $(MD_SOURCE_DIR)/, $(CHAPTERS)))
scripts: $(MD_SOURCE_DIR)/conf.py
latex: $(LATEX_FORMAT_DIR)/*.tex
web: sources scripts
sphinx-build -aE -b html $(MD_SOURCE_DIR) $(WEB_BUILD_DIR)
print: sources scripts latex
sphinx-build -aE -t latex_mode -b latex $(MD_SOURCE_DIR) $(LATEX_BUILD_DIR)
cd $(LATEX_BUILD_DIR) && make
modulo.pdf: print
cp $(LATEX_BUILD_DIR)/modulo.pdf .
%.pdf: sources scripts latex
sphinx-build -aE -t latex_mode -t $* -b latex $(MD_SOURCE_DIR) $(LATEX_BUILD_DIR)
#cd $(LATEX_BUILD_DIR) && rm -f $@ && make
make -C $(LATEX_BUILD_DIR)
mv $(LATEX_BUILD_DIR)/$@ .
all: web modulo.pdf $(addsuffix .pdf, $(PRINT_CHAPTERS))
mkdir -p $(WEB_BUILD_DIR)/media && cp *.pdf $(WEB_BUILD_DIR)/media/
clean:
rm -rf $(LATEX_BUILD_DIR)/* $(WEB_BUILD_DIR)*
# archi:
# sphinx-build -E -b latex -t archi src/appr build/latex/appr && \
# cd build/latex/appr && pdflatex archi.tex
# rep_info:
# sphinx-build -E -b latex -t rep_info src/appr build/latex/appr && \
# cd build/latex/appr && pdflatex rep_info.tex
# pdf:
# sphinx-build -E -b latex src/appr build/latex/appr && \
# cd build/latex/appr && pdflatex modulo2.tex
# html:
# sphinx-build -E -b html src/appr build/appr