# Latexmk is configured in .latexmkrc BUILD_DIR=build CLEANED_PDF=$(BUILD_DIR)/these.pdf MAIN_PDF=$(BUILD_DIR)/main.pdf ALL=$(CLEANED_PDF) all: $(ALL) $(CLEANED_PDF): $(MAIN_PDF) qpdf "$<" --linearize "$@" exiftool -all:all= "$@" @ pdffonts "$@" | grep -q ' no' && echo -e "\033[0;1;31mSOME FONTS NOT EMBEDDED\033[0m" || true @ !(pdffonts "$@" | grep -q ' no') .PHONY: $(MAIN_PDF) # hack-ish: latexmk knows better when to run. $(MAIN_PDF): latexmk $($(notdir $@):.pdf=.tex) clean: latexmk -C fullclean: rm -rf $(BUILD_DIR)