CURDOC=$(shell basename "$(CURDIR)") DIRS=../Geh_aus_mein_Herz ../In_dieser_lieben_Sommerzeit EXTRAS=-mit-Texthinweisen all: $(CURDOC)$(EXTRAS).pdf print: @echo $(CURDOC)$(EXTRAS).pdf clean: rm -f *.pre *.post Clean: clean rm -f *.pdf *.midi include ../.meta/*.mk %.pre: %.ly cat "$<" > "$@" Geh_aus_mein_Herz_%.pre: ../Geh_aus_mein_Herz/%.ly cat "$<" > "$@" In_dieser_lieben_Sommerzeit_%.pre: ../In_dieser_lieben_Sommerzeit/%.ly cat "$<" > "$@" %.post: %.pre $(patsubst %.ly,%.pre,$(shell find $(DIRS) -name '*.ly' | cut -d/ -f2,3 | tr '/' '_')) ../.meta/header.ly cat ../.meta/header.ly "$<" \ |m4 \ >"$@" %.pdf: %.post lilypond $< pkill -SIGHUP -xf "mupdf(-x11)? $@" || true