-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile
148 lines (122 loc) · 5.58 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
###########################################################################
# Automating proposal management by make.
# The participants work on proposal.tex in "draft" mode, which gives a lot
# of information to the developers. Variants submit.tex and public.tex are
# used to prepare official versions (hiding development/private info).
###########################################################################
# possibly customize the following variables to your setting
PROPOSAL = proposal.tex # the proposal
BIB = bibliography.bib # bibTeX databases
PROP.dir = LaTeX-proposal
###########################################################################
# the following are computed
TSIMP = # pdflatex Targets without bibTeX
TSIMP.pdf = $(TSIMP:%.tex=%.pdf) # PDFs to be produced
TBIB = $(PROPOSAL) # pdflatex Targets with bibTeX
TARGET = $(TSIMP) $(TBIB) # all pdflatex targets
TBIB.pdf = $(TBIB:%.tex=%.pdf) # PDFs to be produced
TBIB.aux = $(TBIB:%.tex=%.aux) # their aux files.
PDATA = $(PROPOSAL:%.tex=%.pdata) # the proposal project data
SRC = $(filter-out $(TARGET),$(shell ls *.tex */*.tex)) # included files
PDFLATEX = pdflatex -interaction scrollmode -file-line-error -halt-on-error -synctex=1
BBL = $(PROPOSAL:%.tex=%.bbl)
PROPCLS.dir = $(PROP.dir)/base
PROPETC.dir = $(PROP.dir)/etc
EUPROPCLS.dir = $(PROP.dir)/eu
TEXINPUTS := .//:$(PROPCLS.dir)//:$(EUPROPCLS.dir)//:$(PROPETC.dir)//:
BIBINPUTS := ../lib:$(BIBINPUTS)
export TEXINPUTS
export BIBINPUTS
PROPCLS.clssty = proposal.cls pdata.sty
PROPETC.sty = workaddress.sty metakeys.sty sref.sty
EUPROPCLS.clssty = euproposal.cls
PROPCLS = $(PROPCLS.clssty:%=$(PROPCLS.dir)/%) $(EUPROPCLS.clssty:%=$(EUPROPCLS.dir)/%) $(PROPETC.sty:%=$(PROPETC.dir)/%)
all: $(TBIB.pdf) $(TSIMP.pdf)
check:
test -f draft.pdf
test -f draft.pdata
python3 ./check-pdata
final:
$(MAKE) $(MAKEFLAGS) -w PROPOSAL=final.tex all
final-split: final
pdftk final.pdf cat 1-69 output final-123.pdf
pdftk final.pdf cat 70-end output final-45.pdf
draft: $(SRC)
$(MAKE) $(MAKEFLAGS) -w PROPOSAL=draft.tex all
test -f draft.pdf && echo "draft.pdf has been created: OK"
grantagreement:
$(MAKE) $(MAKEFLAGS) -w PROPOSAL=grantagreement.tex -W grantagreement.tex all
pdftk grantagreement.pdf cat 1-35 61-end output grantagreement-striped.pdf
mv grantagreement-striped.pdf grantagreement.pdf
install: final
cp final.pdf proposal-www.pdf
git commit -m "Updated pdf" proposal-www.pdf
git push
bbl: $(BBL)
$(BBL): %.bbl: %.aux
bibtex -min-crossrefs=100 -terse $<
$(TSIMP.pdf): %.pdf: %.tex $(PROPCLS) $(PDATA)
$(PDFLATEX) $< || $(RM) $@
$(PDATA): %.pdata: %.tex
$(PDFLATEX) $<
$(TBIB.aux): %.aux: %.tex
$(PDFLATEX) $<
$(TBIB.pdf): %.pdf: %.tex $(SRC) $(BIB) $(PROPCLS)
$(PDFLATEX) $< || $(RM) $@
sort $(PROPOSAL:%.tex=%.delivs) > $(PROPOSAL:%.tex=%.deliverables)
@if (test -e $(patsubst %.tex, %.idx, $<));\
then makeindex $(patsubst %.tex, %.idx, $<); fi
$(MAKE) -$(MAKEFLAGS) $(BBL)
@if (grep "(re)run BibTeX" $(patsubst %.tex, %.log, $<)> /dev/null);\
then $(MAKE) -B $(BBL); fi
$(PDFLATEX) $< || $(RM) $@
@if (grep Rerun $(patsubst %.tex, %.log, $<) > /dev/null);\
then $(PDFLATEX) $< || $(RM) $@; fi
@if (grep Rerun $(patsubst %.tex, %.log, $<) > /dev/null);\
then $(PDFLATEX) $< || $(RM) $@; fi
clean:
rm -f *~ *.log *.ilg *.out *.glo *.idx *.ilg *.blg *.run.xml *.synctex.gz *.cut *.toc draft.pdf final.pdf
distclean: clean
rm -f *.aux *.ind *.gls *.ps *.dvi *.thm *.out *.run.xml *.bbl *.toc *.deliv* *.pdata *-blx.bib
rm -Rf auto
rm -f proposal.fls
echo:
echo $(BBL)
singlerun:
$(PDFLATEX) draft
TOWRITE: *.tex */*.tex
fgrep 'TOWRITE{' *.tex */*.tex | perl -p -e 's/^(.*):.*TOWRITE\{(.*?)\}(.*)$$/$$2\t$$1: $$3/' - | grep -v XXX | sort > TOWRITE
# git commit -m "Updated TOWRITE" TOWRITE
# git push
TAGS: *.tex */*.tex
etags *.tex */*.tex
# Proposal metadata in YAML format, in particular for the web page
final.pdata.yaml: final.pdata
../bin/pdata-latex-to-yaml $< > $@
install-proposal-metadata: final.pdata.yaml
cp $< ../WWW/_data/proposal.yml
cd ../WWW/_data; git pull; git add proposal.yml; git commit -m "Updated proposal metadata" proposal.yml; git push
CollaborativeWritingOfTheOpenDreamKitProposal.mp4:
gource -s .4 -1280x720 --auto-skip-seconds .4 --multi-sampling --stop-at-end --highlight-users --hide mouse,progress --file-idle-time 0 --max-files 80 --background-colour 111111 --font-size 20 --title "Collaborative writing of the OpenDreamKit European H2020 proposal" --output-ppm-stream - --output-framerate 60 | avconv -y -r 60 -f image2pipe -vcodec ppm -i - -b 8192K $@
proposal.html:
latexmlc --includestyles --log proposal.ltxlog --destination $@ --path LaTeX-proposal/base --path LaTeX-proposal/eu proposal.tex
allinone.tex:
latexexpand final.tex -o $@
diff: allinone.tex
# in the old checkout
# cd Proposal
# latexexpand final.tex -o allinone-old.tex
# copy the result to this directory
-rm diff.*
latexdiff allinone-old.tex allinone.tex > diff.tex
sed -i s/blue/DarkGreen/ diff.tex
sed -i "s/^.milestonetable/%milestonetable/" diff.tex
make PROPOSAL=diff.tex all
# Comment out the \milestonetable line
# Change color from blue to DarkGreen in the preamble:
# \providecommand{\DIFadd}[1]{{\protect\color{DarkGreen}\uwave{#1}}} %DIF PREAMBLE
# make PROPOSAL=diff.tex all
# To view the differences in the tables: use diffpdf, set pages as 31-36,38 vs 32-37,38 , export
LaTeX-proposal/base/proposal.cls:
@# not a real target, but if this file is missing, we need to get the git submodule
git submodule init; git submodule update