aboutsummaryrefslogtreecommitdiffstats
path: root/2013/Makefile
blob: 883e9bbfaa7f8d4cb9a379ea225be42be7e3e18a (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
noarg:
	echo -e '\nThis script do not run without arguments. Run for example:\n\n    make 2011-02-13-board-notes.pdf\n    make all\n'

# Normal minutes
all: \
2013-03-26-board.pdf \
2013-03-23-annual.pdf \
2013-03-12-board-notes.pdf \
2013-02-12-board.pdf

# Minutes with information from external sources
completes: 2013-03-26-board-complete.pdf

# The most general latex compilation command
%.pdf: %.tex ../preamble/preamble.tex
	latex_count=5 ;\
	latex_log=$$(echo $@ | sed 's/.pdf/.log/') ;\
	pdflatex $< ;\
	while egrep -s 'Rerun (LaTeX|to get cross-references right)' $$latex_log && [ $$latex_count -gt 0 ] ;\
	   do echo "Rerunning latex...." ;  pdflatex $< ;\
	   latex_count=`expr $$latex_count - 1`;\
	done;

# Special treatment of minutes complemented with secrets
%-complete.tex: %.tex %.sed.gpg
	source=$$(echo $< | sed 's/.tex//') ; \
	gpg --decrypt < $${source}.sed.gpg > $${source}.sed_ ; \
	sed -f $${source}.sed_ < $< > $@ ;\
	rm -f $${source}.sed_

# Treat annual meeting minutes specially
2013-03-23-annual.pdf: 2013-03-23-annual.tex \
../preamble/preamble.tex \
../annual-reports/annual-report-2013.tex \
../by-laws/by-laws-2013.tex \
../operational-plans/operational-plan-2013.tex \
../annual-reports/2013-03-23-revisionsberaettelse.jpg
	latex_count=5 ;\
	latex_log=$$(echo $@ | sed 's/.pdf/.log/') ;\
	pdflatex $< ;\
	while egrep -s 'Rerun (LaTeX|to get cross-references right)' $$latex_log && [ $$latex_count -gt 0 ] ;\
	   do echo "Rerunning latex...." ;  pdflatex $< ;\
	   latex_count=`expr $$latex_count - 1`;\
	done;

# Sends to fripost.org for publication
send:
	rsync -ruvp --chmod=Dugo+rx,Fugo+r *-board.pdf *-notes.pdf *-annual.pdf fripost@fripost.org:fripost.org/minutes/

# Clean up
clean:
	rm -f *.aux *.bbl *.dvi *.log *.nav *.out *.snm *.toc *~;\
	rm -f *complete.tex