-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakefile
50 lines (40 loc) · 2.2 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
IMAGE ?= docker.dragonfly.co.nz/texlive-deb-22.04
TEXINPUTS := .///:..//latex//:..//graphics//:
RUN ?= docker run -it --rm --net=host --user=$$(id -u):$$(id -g) -e RUN= -e TEXINPUTS=$(TEXINPUTS) -v$$(pwd):/work -w /work $(IMAGE)
#SHELL := /bin/bash
#LATEXMK_VERSION=$(strip $(patsubst Version,,$(shell latexmk -v | grep -oi "version.*")))
#ifeq ($(LATEXMK_VERSION),4.24)
# LATEXMK_OPTIONS=-pdflatex=xelatex -latex=xelatex -pdf
#else
# LATEXMK_OPTIONS=-xelatex
#endif
#
all: package/.build
.SECONDARY:
examples/%.tex: examples/%.rnw
cd examples && $(RUN) Rscript --vanilla -e "library(knitr);opts_chunk\$$set(warning=F, message = FALSE,echo=F,results='asis',fig.lp='fig:',fig.path='images/'); knit('$(<F)',output='$(@F)')"
examples/%.pdf: examples/%.tex examples/mpi-tables.tex examples/test.bib latex/mpi.pdf graphics/FAR.jpg latex/affiliation.dbx clean_examples
$(RUN) bash -c "cd examples && xelatex $(*) && biber $(*) && xelatex $(*) && xelatex $(*)"
latex/mpi.pdf: latex/mpi.dtx latex/mpi.ins latex/affiliation.dbx clean_latex
$(RUN) bash -c "cd latex && latex mpi.ins"
$(RUN) bash -c "cd latex && xelatex mpi.dtx"
.PRECIOUS: package/.build
package/.build: examples/mpi-far.pdf examples/mpi-plenary.pdf examples/mpi-far-draft.pdf examples/mpi-aebr.pdf examples/mpi-tables.pdf
$(RUN) bash -c "cd package && debuild -us -uc && mv ../mpi-latex*{.dsc,.changes,.build,tar.xz} . && touch .build"
.PHONY: clean
clean: clean_examples clean_latex
rm -rf package/debian/mpi-latex-templates/
rm -f package/mpi-latex* package/debian/mpi-latex-templates.substvars package/debian/files
rm -f package/debian/debhelper-build-stamp package/debian/mpi-latex-templates.debhelper.log
rm -f mpi-latex-templates_*
.PHONY: clean_examples
clean_examples:
rm -f examples/*.log examples/*.aux examples/*.out examples/*.bbl examples/*.pdf examples/*.blg \
examples/*.bcf examples/*.run.xml examples/*.toc examples/*-self.bib examples/*.nav examples/*.snm \
examples/*.fdb_latexmk examples/*.fls
.PHONY: clean_latex
clean_latex:
rm -f latex/*.cls latex/*.idx latex/*.sty latex/*.fdb_latexmk latex/*.log latex/*.fls latex/*.ind \
latex/*.out latex/*.aux latex/*.glo latex/*.pdf latex/*.toc latex/*.ilg
docker:
docker build -t $(IMAGE) texlive-deb