2015-01-13 11:25:06 +01:00
|
|
|
###########################################################################
|
|
|
|
# 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).
|
|
|
|
###########################################################################
|
2014-02-15 12:01:14 +01:00
|
|
|
# possibly customize the following variables to your setting
|
|
|
|
PROPOSAL = propB.tex # the proposal
|
2019-01-22 09:33:58 +01:00
|
|
|
PROP.dir = ../../..# # The LaTeX-proposal class directory
|
2019-01-26 14:41:18 +01:00
|
|
|
BIB = ../lib/dummy.bib# # bibTeX databases
|
2014-02-15 12:01:14 +01:00
|
|
|
###########################################################################
|
|
|
|
# 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
|
2019-01-27 11:06:56 +01:00
|
|
|
SRC = $(filter-out $(TARGET),$(shell ls *.tex)) # included files
|
2019-03-21 16:01:06 +01:00
|
|
|
PDFLATEX = pdflatex -interaction batchmode -file-line-error
|
2014-02-15 12:01:14 +01:00
|
|
|
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)
|
2017-09-21 16:52:20 +02:00
|
|
|
export TEXINPUTS
|
|
|
|
export BIBINPUTS
|
2014-02-15 12:01:14 +01:00
|
|
|
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)
|
|
|
|
|
2015-01-13 11:25:06 +01:00
|
|
|
submit:
|
2019-01-27 11:06:56 +01:00
|
|
|
$(MAKE) -$(MAKEFLAGS) -w PROPOSAL=submit.tex
|
2015-01-13 11:25:06 +01:00
|
|
|
|
2019-01-27 10:36:27 +01:00
|
|
|
SPLIT.at = $(shell cat SPLIT.at)
|
|
|
|
SPLIT = $$(($(SPLIT.at) + 1))
|
|
|
|
SSPLIT = $$(($(SPLIT.at) + 2))
|
2019-01-27 11:06:56 +01:00
|
|
|
split: submit
|
2019-01-27 10:36:27 +01:00
|
|
|
qpdf --pages submit.pdf 1-$(SPLIT) -- submit.pdf submit-123.pdf
|
|
|
|
qpdf --pages submit.pdf $(SSPLIT)-z -- submit.pdf submit-45.pdf
|
|
|
|
|
|
|
|
public: $(SRC)
|
2019-01-27 11:06:56 +01:00
|
|
|
$(MAKE) -$(MAKEFLAGS) -w PROPOSAL=public.tex all
|
2017-09-21 16:52:20 +02:00
|
|
|
|
|
|
|
grantagreement:
|
2019-01-27 11:06:56 +01:00
|
|
|
$(MAKE) -$(MAKEFAGS) -w PROPOSAL=grantagreement.tex -W grantagreement.tex all
|
2019-01-27 10:36:27 +01:00
|
|
|
pdftk grantagreement.pdf cat 1-35 61-end output grantagreement-striped.pdf
|
|
|
|
mv grantagreement-striped.pdf grantagreement.pdf
|
|
|
|
|
|
|
|
|
2019-01-27 11:06:56 +01:00
|
|
|
install: submit
|
|
|
|
cp submit.pdf proposal-www.pdf
|
2019-01-27 10:36:27 +01:00
|
|
|
git commit -m "Updated pdf" proposal-www.pdf
|
|
|
|
git push
|
2014-02-15 12:01:14 +01:00
|
|
|
|
|
|
|
$(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
|
2019-01-22 09:33:58 +01:00
|
|
|
biber $(basename $<)
|
|
|
|
@if (grep "(re)run" $(patsubst %.tex, %.log, $<)> /dev/null);\
|
|
|
|
then biber $(basename $<); fi
|
2014-02-15 12:01:14 +01:00
|
|
|
$(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:
|
2019-01-27 10:36:27 +01:00
|
|
|
rm -f *~ *.log *.ilg *.out *.glo *.idx *.ilg *.blg *.run.xml *.synctex.gz *.cut *.toc
|
2014-02-15 12:01:14 +01:00
|
|
|
|
|
|
|
distclean: clean
|
2016-06-12 11:02:32 +02:00
|
|
|
rm -f *.aux *.ind *.gls *.ps *.dvi *.thm *.out *.run.xml *.bbl *.toc *.deliv* *.pdata *-blx.bib
|
2014-02-15 12:01:14 +01:00
|
|
|
rm -Rf auto
|
2019-01-27 10:36:27 +01:00
|
|
|
rm -f proposal.fls
|