This make file finds the most recently changed tex file and compile it.
Last active
December 23, 2017 20:55
-
-
Save gongzhitaao/fd2e87024a2ea37cc892 to your computer and use it in GitHub Desktop.
Compile the most recently changed tex file
This file contains hidden or 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
TEXI2PDF = texi2pdf | |
FLAGS = -c -p | |
# find the most recently changed tex file in 1 minute. If more than | |
# one files are changed within 1 minute, list only the most recent one. | |
cur := "$(shell find . -name '*.tex' -mmin -1 -printf '%TT\t%p\n' | sort | tail -1 | awk '{print $$2}')" | |
cur := "$(shell basename $(cur))" | |
all : recent | |
recent : | |
ifneq ($(cur),"") | |
$(TEXI2PDF) $(FLAGS) $(cur) | |
endif | |
.PHONY : all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment