-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
39 lines (31 loc) · 974 Bytes
/
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
RNTZTEXDIR := ./rntztex
LATEXRUN := $(RNTZTEXDIR)/latexrun/latexrun
# Tell TeX where to find things.
export TEXINPUTS := $(RNTZTEXDIR):
# Which tex files to build.
TEXS := tones.tex tonal-linear-sequent-calculus.tex
PDFS := $(addsuffix .pdf,$(basename $(TEXS)))
.PHONY: all watch clean FORCE
all: $(PDFS)
watch: all
@while inotifywait -e modify -r . >/dev/null 2>&1; do \
echo; \
make --no-print-directory -j all; \
done
%.pdf: %.tex FORCE
$(LATEXRUN) $<
# pdfbook combines pages to make a zine-style booklet. For example, if foo.pdf
# is formatted for A5 paper, foo-book.pdf will be A4. You can print it out, cut
# or fold down the middle, and staple the pages together.
%-book.pdf: %.pdf
pdfbook $<
# Likewise, but makes a 2-up version.
%-2up.pdf: %.pdf
pdfjam --suffix 2up --landscape --nup 2x1 -- $<
clean:
$(LATEXRUN) --clean-all
rm -r latex.out
# debugging: `make print-FOO` will print the value of $(FOO)
.PHONY: print-%
print-%:
@echo $*=$($*)