summaryrefslogtreecommitdiff
path: root/Bewahr_die_Erde_Gott/Makefile
blob: 6b6ed915e4f3d1e038352c4d5a391806bea9b1b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
CURDOC=$(shell basename "$(CURDIR)")

EXTRAS=$(shell ../.meta/find-extras)

all: $(CURDOC)$(EXTRAS).pdf $(CURDOC)$(EXTRAS)-tolino.pdf

clean:
	rm -f *.pre *.post

Clean: clean
	rm -f *.pdf *.midi

include ../.meta/*.mk

%.pre: %.ly
	cat "$<" > "$@"

%.post: %.pre $(patsubst %.ly,%.pre, $(shell find . -name '*.ly')) ../.meta/header.ly
	cat ../.meta/header.ly "$<" \
	|m4 \
	>"$@"

%.pdf: %.post
	lilypond $<
	pkill -SIGHUP -xf "mupdf(-x11)? $@" || true

%.midi: %-midi.post
	lilypond $<
	for s in *-midi*.midi; do \
	  mv "$$s" "$${s%-midi*.midi}$${s##*-midi}"; \
	done

%.wav: %.midi
	fluidsynth --audio-driver=file -o audio.file.name=$@ -i $<