wspr / thesis

My ever-continuing PhD thesis

This URL has Read+Write access

thesis / Makefile
100755 36 lines (26 sloc) 0.845 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
 
main = thesis
support = thesis-preamble.sty thesis-maths.sty
chapters = \
  front abstract acknowledgements contents \
  intro magnet-theory \
  magnet-design multipole qzs control xpmt \
  conclusion
 
.PHONY: $(chapters) show clean
 
show: $(main).pdf $(main).bbl
open $<
osascript -e 'tell application "Skim" to revert item 1 of (every window whose name contains "'$<'")'
 
clean:
rm -f *.pdf
 
$(main).pdf: $(main).tex $(addsuffix .tex,$(chapters)) $(support)
pdflatex --shell-escape $(main); \
bibtex $(main)
 
$(chapters): %: ch-%.pdf
open $<
osascript -e 'tell the front window of application "Skim" to revert'
 
ch-%.pdf: %.tex ch-%.bbl ch-%.aux $(support)
pdflatex --shell-escape --jobname=ch-$* \
"\includeonly{$*}\input{$(main)}"
 
ch-%.bbl: $(main).bbl
cp $(main).bbl ch-$*.bbl
 
ch-%.aux: $(main).aux
cp $(main).aux ch-$*.aux