-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
57 lines (43 loc) · 1.73 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
# You should only have to modify RELEASED and SOLUTIONS.
# Also change SRC once per semester.
RELEASED = mentor10
SOLUTIONS = mentor10
DST = published
SRC = src/su21
DEPEND = python make_dependency.py
TEX = pdflatex
TEX_FLAGS = -halt-on-error -output-directory ../../$(DST)
SOURCES = $(wildcard $(SRC)/*.tex)
HANDOUT = $(SOURCES:$(SRC)/%.tex=%)
HANDOUT_SOL = $(addsuffix _sol, $(HANDOUT))
HANDOUT_GUIDE = $(addsuffix _guide, $(HANDOUT))
#################################################################
# User-friendly targets: use the following to publish material. #
#################################################################
all: $(RELEASED) $(addsuffix _sol, $(SOLUTIONS)) $(addsuffix _guide, $(SOLUTIONS))
clean:
find . -name "deps" -type d -prune -exec rm -rf {} \;
find . -name "*.pyc" -exec rm -rf {} \;
rm -rf $(DST)/*
.SECONDEXPANSION:
$(HANDOUT) $(HANDOUT_SOL) $(HANDOUT_GUIDE): $(DST) $(DST)/[email protected]
$(DST)/%.pdf: $(SRC)/%.tex commonheader.sty
$(DEPEND) $* $< deps
cd $(SRC); $(TEX) $(TEX_FLAGS) $*.tex;
@-rm $(DST)/*.aux $(DST)/*.log $(DST)/*.out
#open $(DST)/$*.pdf
$(DST)/%_sol.pdf: $(SRC)/%.tex commonheader.sty
$(DEPEND) $* $< deps
cd $(SRC); $(TEX) $(TEX_FLAGS) -jobname="$*_sol" "\def\discussionsolutions{}\input{$*}"
@-rm $(DST)/*.aux $(DST)/*.log $(DST)/*.out
#open $(DST)/$*_sol.pdf
$(DST)/%_guide.pdf: $(SRC)/%.tex commonheader.sty
$(DEPEND) $* $< deps
cd $(SRC); $(TEX) $(TEX_FLAGS) -jobname="$*_guide" "\def\discussionsolutions{}\def\discussionguides{}\input{$*}"
@-rm $(DST)/*.aux $(DST)/*.log $(DST)/*.out
#open $(DST)/$*_guide.pdf
$(DST):
mkdir -p $@
# Include dependencies that are created by $(DEPEND). These
# dependencies are primarily based on \subimport directives.
-include $(SOURCES:%=deps/%.d)