aboutsummaryrefslogtreecommitdiffstats
path: root/annual-meetings/motions/Makefile
blob: 683f2f403d8e377722a88029ea53e8f5627b294e (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
PREFIX = motions
TEX = $(addsuffix _.tex, $(basename $(wildcard *.mdwn)))
PDF = $(addprefix $(PREFIX)-, $(subst .main.tex,.pdf,$(wildcard *.main.tex)))
ALL = $(TEX) $(PDF)

PREAMBLE = preamble_.tex acronyms_.tex attendants_.tex

all: $(ALL)

%_.tex: %.mdwn
	cat < $< | sed -e 's/^$$/\\mypar\n/' |\
	sed -f ../../preamble/acronyms.sed \
	    -f ../../preamble/attendants.sed \
	    -f ../../preamble/snippets.sed |\
	pandoc -f markdown -t latex > $@




motions-%.pdf: %.main.tex $(TEX) $(PREAMBLE)
	pdflatex -jobname=$(basename $@) $<
	! grep -q  "Rerun.*right" $(basename $@).log ||\
	 pdflatex -jobname=$(basename $@) $<

clean:
	rm -f $(ALL)

$(PREAMBLE): %_.tex: ../../preamble/%.tex
	sed 's/..\/preamble\/\([a-z]*\)/\1_/g' < $< > $@