SOURCES=$(wildcard *.ly) INCLUDES=$(wildcard *.tly) PARTS=$(SOURCES:.ly=.pdf) TDIR=out book: book-print.pdf parts: $(PARTS) %.pdf: %.ly $(INCLUDES) lilypond --pdf $< $(TDIR)/book.tex: book.lytex $(SOURCES) $(INCLUDES) lilypond-book --output=$(TDIR) -I ../ --latex-program=lualatex $< $(TDIR)/book-sr.tex: book-sr.lytex $(SOURCES) $(INCLUDES) lilypond-book --output=$(TDIR) -I ../ --latex-program=lualatex $< %.pdf: %.tex cd $(@D); lualatex $(