Keep generation commands in Makefile

This commit is contained in:
Jip J. Dekker 2021-02-09 14:08:57 +11:00
parent 04a0f91ef9
commit 33072b7758
No known key found for this signature in database
GPG Key ID: 517DF4A00618C9C3
2 changed files with 18 additions and 8 deletions

View File

@ -6,13 +6,11 @@ $bibtex_use = 2;
$clean_ext = "run.xml %R-blx.bib %R-blx.aux ist xdy";
# Rule to typeset minizinc files
add_cus_dep('mzn', 'mzntex', 0, 'run_pygmentize_mzn');
sub run_pygmentize_mzn {
system "pipenv run pygmentize -f latex -Olinenos=True,texcomments=True,mathescape=True $_[0].mzn > $_[0].mzntex";
}
add_cus_dep('py', 'pytex', 0, 'run_pygmentize_py');
sub run_pygmentize_py {
system "pipenv run pygmentize -f latex -Olinenos=True,texcomments=True,mathescape=True $_[0].py > $_[0].pytex";
add_cus_dep('mzn', 'mzntex', 0, 'run_make');
add_cus_dep('py', 'pytex', 0, 'run_make');
sub run_make {
my $dest = $$Pdest;
system "make $dest"
}
# Rule to generate glossaries

View File

@ -1,13 +1,25 @@
PROJECT=dekker_thesis
MZN_LISTINGS := $(addsuffix tex, $(wildcard assets/mzn/*.mzn) )
PY_LISTINGS := $(addsuffix tex, $(wildcard assets/py/*.py) )
.PHONY: $(PROJECT).pdf clean clobber
$(PROJECT).pdf: $(PROJECT).tex
latexmk -use-make $<
listings: $(MZN_LISTINGS) $(PY_LISTINGS)
%.mzntex : %.mzn
pipenv run pygmentize -f latex -Olinenos=True,texcomments=True,escapeinside="@@",envname="BVerbatim" $< > $@
%.pytex : %.py
pipenv run pygmentize -f latex -Olinenos=True,texcomments=True,escapeinside="@@",envname="BVerbatim" $< > $@
clean:
latexmk -c
clobber:
latexmk -C
rm -f assets/mzn/*.mzntex
rm -f assets/py/*.pytex