-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
47 lines (35 loc) · 1.34 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
# You should only have to modify RELEASED and SOLUTIONS.
RELEASED = mentor03
SOLUTIONS = mentor03
DST = published
SRC = src
DEPEND = python make_dependency.py
TEX = pdflatex
TEX_FLAGS = -interaction=nonstopmode -halt-on-error -output-directory ../$(DST)
SOURCES = $(wildcard $(SRC)/*.tex)
HANDOUT = $(SOURCES:$(SRC)/%.tex=%)
HANDOUT_SOL = $(addsuffix _sol, $(HANDOUT))
#################################################################
# User-friendly targets: use the following to publish material. #
#################################################################
all: $(RELEASED) $(addsuffix _sol, $(SOLUTIONS))
src: $(HANDOUT) $(HANDOUT_SOL)
clean:
find . -name "deps" -type d -prune -exec rm -rf {} \;
find . -name "*.pyc" -exec rm -rf {} \;
rm -rf $(DST)/*
.SECONDEXPANSION:
$(HANDOUT) $(HANDOUT_SOL): $(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
$(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
$(DST):
mkdir -p $@
# Include dependencies that are created by $(DEPEND). These
# dependencies are primarily based on \subimport directives.
-include $(SOURCES:%=deps/%.d)