curriculum-vitae/Makefile

63 lines
1.8 KiB
Makefile
Raw Normal View History

2019-07-01 19:40:34 +02:00
## ---- user config ----
2019-06-27 20:14:41 +02:00
2019-07-01 19:40:34 +02:00
# Set to anything non-empty to suppress most of latex's messaging. To diagnose
# LaTeX errors, you may want to do `make latex_quiet=""` to get verbose output
latex_quiet := true
2019-06-27 20:14:41 +02:00
2019-07-01 19:40:34 +02:00
# Set to anything non-empty to reprocess TeX files every time we make a PDF.
# Otherwise these files will be regenerated only when the source markdown
# changes; in that case, if you change other dependencies (e.g. a
# bibliography), use the -B option to make in order to force regeneration.
always_latexmk := true
# Set to anything non-empty to use xelatex rather than pdflatex. I always do
# this in order to use system fonts and better Unicode support. pdflatex is
# faster, and there are some packages with which xelatex is incompatible.
xelatex := true
# Extra options to pandoc (e.g. "-H mypreamble.tex")
PANDOC_OPTIONS :=
## ---- special external file ----
# Normally this does not need to be changed:
# works if the template is local or in ~/.pandoc/templates
2021-01-10 11:35:29 +01:00
PANDOC_TMPL := assets/one-column.tex
2019-07-01 19:40:34 +02:00
## ---- subdirectories (normally, no need to change) ----
# temporary file subdirectory; will be removed after every latex run
2021-02-01 00:53:14 +01:00
TEMP_DIR := tmp
2019-07-01 19:40:34 +02:00
## ---- commands ----
# Change these only to really change the behavior of the whole setup
PANDOC := pandoc --template $(PANDOC_TMPL) $(PANDOC_OPTIONS)
LATEXMK := latexmk $(if $(xelatex),-xelatex,-pdflatex="pdflatex %O %S") \
2019-12-05 20:38:45 +01:00
$(if $(latex_quiet),-silent,-verbose)
2019-07-01 19:40:34 +02:00
## ---- build rules ----
texs := $(patsubst %.yml,%.tex, $(wildcard *.yml))
pdfs := $(patsubst %.yml,%.pdf, $(wildcard *.yml))
bibs := $(wildcard *.bib)
2019-07-01 19:40:34 +02:00
$(texs): %.tex: %.yml $(bibs) $(PANDOC_TMPL)
2020-05-21 02:48:18 +02:00
$(PANDOC) -o $@ $<
2019-07-01 19:40:34 +02:00
2021-02-01 00:53:14 +01:00
.PHONY: all clean
2019-07-01 19:40:34 +02:00
$(pdfs): %.pdf: %.tex
@echo $(bibs)
$(LATEXMK) $<
all: $(pdfs) clean
2019-07-01 19:40:34 +02:00
# clean up everything except final pdfs
clean:
2021-02-22 09:32:11 +01:00
rm *.log *.xdv *.aux *.fls *.fdb_latexmk *.out
2019-07-01 19:40:34 +02:00
.DEFAULT_GOAL := all