summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: c70b82748429117e654a663cc35619994b318ea5 (plain)
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
54
55
56
57
58
59
60
61
62
63
64
SHOW=yes
PDFVIEWER=evince
LATEX=pdflatex

# targets
all: git.pp.pdf
git.tex: git-centralized.pdf git-distributed.pdf git-objdb.pdf git-patch.pdf

.PHONY: all clean handout notes

# Don't touch this, HAHA.
clean: TEXS=$(patsubst %.tex,%,\
	$(filter-out %.pp.tex %.handout.tex %.notes.tex %.text.tex,\
	$(wildcard *.tex)))
clean: PRESENTATION_TMPS=$(wildcard \
	$(addsuffix .pp.tex,$(TEXS)) \
	$(addsuffix .handout.tex,$(TEXS)) \
	$(addsuffix .notes.tex,$(TEXS)) \
	$(addsuffix .text.tex,$(TEXS)))
clean: TEX_TMPS=$(filter-out %.tex %.png %.orig %.zal, \
	$(wildcard $(addsuffix .*,$(TEXS))))
clean:
	$(RM) $(wildcard $(PRESENTATION_TMPS) $(TEX_TMPS)) *~

%.pdf: %.tex
	$(LATEX) $<
	$(LATEX) $<
	if [ "$(SHOW)" == "yes" ]; then $(PDFVIEWER) $@; fi

%.png: %.pdf
	pstoimg -depth 8 -density 120 -antialias -aaliastext -multipage -out $@ $<
	touch $@

%.eps: %.svg
	inkscape -z -f $< -D --export-area-snap -E $@

%.pdf: %.eps
	epstopdf --outfile=$@ $<


# presentation/article texs/pdfs
%.text.tex: %.tex
	echo '\def\RHpresentationHead#1{}\def\RHarticleHead#1{#1}' >$@
	echo '\input $<' >>$@

%.pp.tex: %.tex
	echo '\def\RHpresentationHead#1{#1}\def\RHarticleHead#1{}' >$@
	echo '\input $<' >>$@

%.handout.tex: %.tex
	echo '\def\RHpresentationHead#1{#1}\def\RHarticleHead#1{}' >$@
	echo '\PassOptionsToClass{handout}{beamer}' >>$@
	echo '\input $<' >>$@

%.notes.tex: %.tex
	echo '\def\RHpresentationHead#1{#1\setbeameroption{show only notes}}' >$@
	echo '\def\RHarticleHead#1{}' >>$@
	echo '\PassOptionsToClass{handout}{beamer}' >>$@
	echo '\input $<' >>$@

%.text.pdf: %.text.tex %.tex
%.pp.pdf: %.pp.tex %.tex
%.handout.pdf: %.handout.tex %.tex
%.notes.pdf: %.notes.tex %.tex