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.

24 lines
982 B

BUILD_DIR=build
build: $(BUILD_DIR)/report.pdf
.PHONY: build
$(BUILD_DIR)/report.aux: report.tex references.bib
@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