forked from mit-pdos/6.1600-notes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (35 loc) · 1 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
PAPER=lecture-notes
$(PAPER).pdf:
latexmk -pdf \
-latexoption=-file-line-error \
-latexoption=-shell-escape\
-latexoption=-halt-on-error\
-latexoption=-interaction=nonstopmode \
-latexoption=-synctex=1 $(PAPER)
.PHONY: $(PAPER).pdf
IN = $(wildcard lectures/lec*.tex)
OUT = $(subst lectures/,build/,$(IN))
OUT2 = $(addsuffix .pdf,$(basename $(OUT)))
.PHONY: build/%.pdf.run
build/%.pdf: lectures/%.tex
mkdir -p build
$(eval ARGS := -interaction nonstopmode \
-output-directory=build -jobname=$(basename $(notdir $@)) \
"\input{chapter}\input{$<}\bibliography{ref}\end{document}")
pdflatex $(ARGS)
pdflatex $(ARGS)
cp ref.bib build/ref.bbl
bibtex build/$(basename $(notdir $@))
pdflatex $(ARGS)
henry:
latexmk -pdf -pvc \
-latexoption=-file-line-error \
-latexoption=-shell-escape\
-latexoption=-halt-on-error\
-latexoption=-interaction=nonstopmode \
-latexoption=-synctex=1 $(PAPER)
all: $(PAPER).pdf $(OUT2)
clean:
latexmk -C $(PAPER).tex
rm -f lecture-notes.bbl build/*
.PHONY: clean