Created
May 6, 2022 09:12
-
-
Save 25077667/63af56430e90db993f00430ec80b147a to your computer and use it in GitHub Desktop.
Universal pdflatex Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src=$(wildcard *.tex) | |
target=$(patsubst %.tex,%.pdf,$(src)) | |
middles=$(shell pwd)/build | |
.PHONY:mkdir all clean deepclean | |
%.pdf: %.tex mkdir | |
pdflatex -no-shell-escape -output-directory="$(middles)" $< | |
pdflatex -no-shell-escape -output-directory="$(middles)" $< | |
all: $(target) | |
mv $(middles)/$< . | |
mkdir: | |
mkdir -p $(middles) | |
clean: | |
$(RM) -r $(middles) | |
deepclean: clean | |
$(RM) *.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment