-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (39 loc) · 1.4 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
OTT_LOC = ../../spec/simpl/
OTT_OPTS = -tex_show_meta false
OTT_FILES = $(OTT_LOC)/*.ott
MAIN = paper
SCRIPT = script
RULESFILE = ott-rules.tex
AUTOGEN = appendix.mng sections/typesystem.mng sections/algorithm.mng sections/coherence.mng artifacts.mng
WARN_MSG = "%%% !!! WARNING: AUTO GENERATED. DO NOT MODIFY !!! %%%\n"
all: $(MAIN).pdf
long: $(MAIN).tex $(wildcard ../../impl/examples/*.sl) $(wildcard sections/*.tex) $(AUTOGEN)
@ruby $(SCRIPT).rb
@latexmk -jobname=paper_long -pdf -pdflatex='pdflatex %O -interaction=nonstopmode -synctex=1 "\newcommand*{\submitoption}{} \input{%S}"' $(MAIN)
$(MAIN).pdf: $(MAIN).tex $(wildcard ../../impl/examples/*.sl) $(wildcard sections/*.tex) $(AUTOGEN)
@ruby $(SCRIPT).rb
@latexmk -pdf $(@:.pdf=.tex)
$(RULESFILE): $(OTT_FILES)
ott -tex_wrap false $(OTT_OPTS) -o $@ $^
@if grep '<<no parses (' $@ >/dev/null 2>&1 && \
[ -z "$(DONTSTOP)" ]; then \
echo; \
echo "***** OTT PARSE ERROR(S) *****"; \
grep -n '<<no parses (' $@; \
$(RM) $@; \
exit 1; \
fi >&2
%.mng: %.tex $(RULESFILE)
ott -tex_wrap false $(OTT_OPTS) -tex_filter $*.tex $*.mng $(OTT_FILES)
@perl -pi -e 'print $(WARN_MSG) if $$. == 1' $@
@if grep '<<no parses (' $@ >/dev/null 2>&1 && \
[ -z "$(DONTSTOP)" ]; then \
echo; \
echo "***** OTT PARSE ERROR(S) *****"; \
grep -n '<<no parses (' $@; \
$(RM) $@; \
exit 1; \
fi >&2
clean:
@latexmk -c
.PHONY: all clean