-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (39 loc) · 1.37 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
LATEX=lualatex
LATEXOPT=--shell-escape --synctex=1
NONSTOP=--interaction=nonstopmode
LATEXMK=latexmk
LATEXMKOPT=-pdf
CONTINUOUS=-pvc
MAIN=main
SUBDIRS :=
CHA_SOURCE := $(shell find cha -type f -iname "*.tex")
SOURCES=$(MAIN).tex Makefile $(CHA_SOURCE)
BIB_SOURCES := $(shell find . -type f -iname "*.bibpart")
#FIGURES := $(shell for dir in "$(SUBDIRS)"; do find $$dir/img $$dir/fig -type f; done;)
all: once
.refresh:
touch .refresh
force:
touch .refresh
rm -f $(MAIN).pdf
$(LATEXMK) $(LATEXMKOPT) $(CONTINUOUS) \
-pdflatex="$(LATEX) $(LATEXOPT) %O %S" $(MAIN)
clean:
$(LATEXMK) -C $(MAIN)
rm -f bibtex.bib
rm -f figures/*.dpth figures/*.md5 figures/*.pdf figures/*.log figures/*.run.xml
once: $(MAIN).tex .refresh $(SOURCES) $(FIGURES) bibtex.bib
./onfail.sh $(LATEXMK) $(LATEXMKOPT) -pdflatex=\"$(LATEX) $(LATEXOPT) $(NONSTOP) %O %S\" $(MAIN) \
-- rubber-info $(MAIN)
continuous: $(MAIN).tex .refresh $(SOURCES) $(FIGURES) bibtex.bib
$(LATEXMK) $(LATEXMKOPT) $(CONTINUOUS) \
-pdflatex="$(LATEX) $(LATEXOPT) $(NONSTOP) %O %S" $(MAIN)
debug: once
rubber-info $(MAIN)
bibtex.bib: $(BIB_SOURCES)
cat $^ > bibtex.bib
lint:
chktex -v0 $(shell find . -type f -name "*.tex")
test: clean bibtex.bib
latexmk -pdf -pdflatex="echo X | lualatex --draftmode --shell-escape --interaction=errorstopmode %O %S \; touch %D" $(MAIN)
.PHONY: clean force once debug lint continuous test all