You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.2 KiB

BUILD_DIR=build
DOT_FILES=$(wildcard figures/*.dot)
PDF_FILES=$(DOT_FILES:figures/%.dot=$(BUILD_DIR)/figures/%.pdf)
build: $(BUILD_DIR)/report.pdf
.PHONY: build
$(PDF_FILES):$(BUILD_DIR)/figures/%.pdf: figures/%.dot
@mkdir -p $(BUILD_DIR)/figures
@dot -Tpdf -o $@ $^ -Nfontname='Source Sans Pro'
$(BUILD_DIR)/report.aux: report.tex references.bib $(PDF_FILES)
@mkdir -p $(BUILD_DIR)
@xelatex -interaction=nonstopmode -halt-on-error -shell-escape -output-directory=$(BUILD_DIR) report.tex
$(BUILD_DIR)/report.bbl: $(BUILD_DIR)/report.aux references.bib
@mkdir -p $(BUILD_DIR)
@if ! (cmp -s $(BUILD_DIR)/report.aux $(BUILD_DIR)/report.aux.old && cmp -s references.bib $(BUILD_DIR)/references.bib.old); then \
echo "# Rebuilding $(BUILD_DIR)/report.bbl"; \
bibtex $(BUILD_DIR)/report; \
xelatex -interaction=batchmode -halt-on-error -shell-escape -output-directory=$(BUILD_DIR) report.tex >/dev/null; \
fi
@cp $(BUILD_DIR)/report.aux $(BUILD_DIR)/report.aux.old
@cp references.bib $(BUILD_DIR)/references.bib.old
$(BUILD_DIR)/report.pdf: report.tex $(BUILD_DIR)/report.bbl
@mkdir -p $(BUILD_DIR)
@xelatex -interaction=batchmode -halt-on-error -shell-escape -output-directory=$(BUILD_DIR) report.tex >/dev/null