2017-12-04 13:31:47 +01:00
|
|
|
###########################################################################
|
|
|
|
# Automating LaTeX-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).
|
|
|
|
###########################################################################
|
2020-03-26 08:08:27 +01:00
|
|
|
# To use this file, set these variables in a local Makefile
|
2017-12-04 13:31:47 +01:00
|
|
|
# PROPOSAL = ???? # the base name of the top-level proposal file(s)
|
|
|
|
# REPORT = ???? # the base name of the top-level report file(s)
|
|
|
|
# BIB = ????? # directory of the bibTeX databases
|
|
|
|
# PROP.dir = ???? # The LaTeX-proposal class directory
|
|
|
|
###########################################################################
|
2020-03-26 08:08:27 +01:00
|
|
|
# The following variables can be used to customize things furhter
|
|
|
|
LATEXMODE ?= batchmode
|
|
|
|
PDFLATEX = pdflatex -interaction $(LATEXMODE) -file-line-error
|
|
|
|
###########################################################################
|
|
|
|
# the following variables are computed from these settings
|
2017-12-04 13:31:47 +01:00
|
|
|
TARGET = $(PROPOSAL) $(REPORT) # all pdflatex targets
|
|
|
|
TARGET.pdf = $(TARGET:%.tex=%.pdf) # PDFs to be produced
|
|
|
|
TARGET.aux = $(TARGET:%.tex=%.aux) # their aux files.
|
|
|
|
PDATA = $(PROPOSAL:%.tex=%.pdata) # the proposal project data
|
|
|
|
SRC = $(filter-out $(TARGET),$(shell ls *.tex)) # included files
|
|
|
|
BBL = $(PROPOSAL:%.tex=%.bbl)
|
|
|
|
PROPCLS.dir = $(PROP.dir)/base
|
|
|
|
DFGPROPCLS.dir = $(PROP.dir)/dfg
|
2020-08-19 14:57:48 +02:00
|
|
|
TEXINPUTS := $(PROPCLS.dir)//:$(DFGPROPCLS.dir)//:
|
2017-12-04 13:31:47 +01:00
|
|
|
BIBINPUTS := $(BIB):$(BIBINPUTS)
|
2020-08-19 15:11:21 +02:00
|
|
|
BIBS := $(shell ls *.bib 2>/dev/null) $(shell ls $(BIB)/*.bib 2>/dev/null)
|
2017-12-04 13:31:47 +01:00
|
|
|
PROPCLS.clssty = proposal.cls pdata.sty reporting.cls
|
|
|
|
DFGPROPCLS.clssty = dfgproposal.cls dfgpdata.sty dfgreporting.cls
|
2020-08-19 14:57:48 +02:00
|
|
|
PROPCLS = $(PROPCLS.clssty:%=$(PROPCLS.dir)/%) $(DFGPROPCLS.clssty:%=$(DFGPROPCLS.dir)/%)
|
2017-12-04 13:31:47 +01:00
|
|
|
|
|
|
|
all: $(TARGET.pdf)
|
|
|
|
|
|
|
|
submit:
|
|
|
|
$(MAKE) -w PROPOSAL=submit.tex all
|
|
|
|
|
|
|
|
public:
|
|
|
|
$(MAKE) -w PROPOSAL=public.tex all
|
|
|
|
|
|
|
|
cd: # make cd will prepare CD for burning
|
|
|
|
mkdir CD;make $(TARGET.pdf); cp $(TARGET.pdf) CD
|
|
|
|
|
|
|
|
bbl: $(BBL)
|
|
|
|
$(BBL): %.bbl: %.aux
|
2019-12-22 06:40:12 +01:00
|
|
|
biber -min-crossrefs=100 -terse $<
|
2017-12-04 13:31:47 +01:00
|
|
|
|
|
|
|
$(PDATA): %.pdata: %.tex
|
|
|
|
$(PDFLATEX) $<
|
|
|
|
|
|
|
|
$(TARGET.aux): %.aux: %.tex
|
|
|
|
$(PDFLATEX) $<
|
|
|
|
|
|
|
|
$(TARGET.pdf): %.pdf: %.tex $(SRC) $(BIBS) $(PROPCLS)
|
|
|
|
$(PDFLATEX) $< || $(RM) $@
|
|
|
|
# sort $(PROPOSAL:%.tex=%.delivs) > $(PROPOSAL:%.tex=%.deliverables)
|
|
|
|
@if (test -e $(patsubst %.tex, %.idx, $<));\
|
|
|
|
then makeindex $(patsubst %.tex, %.idx, $<); fi
|
|
|
|
# bbl is up to date $(MAKE) -$(MAKEFLAGS) $(BBL)
|
2019-01-22 09:33:58 +01:00
|
|
|
@if (grep "(re)run" $(patsubst %.tex, %.log, $<)> /dev/null);\
|
|
|
|
then biber $(basename $<); fi
|
2017-12-04 13:31:47 +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:
|
|
|
|
rm -f *~ *.log *.ilg *.out *.glo *.idx *.ilg *.blg *.run.xml *.synctex.gz *.cut
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
rm -f *.aux *.ind *.gls *.ps *.dvi *.thm *.out *.run.xml *.bbl *.toc *.deliv* *.pdata *-blx.bib
|
|
|
|
rm -Rf auto
|
|
|
|
|
|
|
|
echo:
|
|
|
|
@echo $(BIBS)
|