LILY = lilypond LILY_FLAGS = --loglevel=WARNING FILES_IN = $(wildcard *.ly ./**/*.ly) FILES_OUT = $(FILES_IN:%.ly=$(BUILD_DIR)/$(notdir %).pdf) BUILD_DIR = ./build $(BUILD_DIR)/%.pdf: %.ly mkdir -p $(dir $@) $(LILY) $(LILY_FLAGS) --output $(@:.pdf=) $< all: $(FILES_OUT) clean: rm -r $(BUILD_DIR) dryrun: echo $(FILES_OUT) .PHONY: clean dryrun all