Finished the transition of the template system to jinja
[orchestrallily.git] / Templates / EK_Full / Makefile
blob1b38f89eb0f1901dfb9b01927dccf71f604a92ff
1 OUT=out
3 <$ for w in works -$>
4 base<< w.nr >> = << w.basename >>
5 SRCS<< w.nr >> = << w.srcfiles.settings|join (" ") >> << w.srcfiles.parts|join (" ") >> $(base)_Settings.ily
6 instruments<< w.nr >> = << w.instruments|join (" ") >>
7 scores<< w.nr >> = << w.scores|join (" ") >>
8 pdfs<< w.nr >> = $(instruments<<w.nr>>:%=$(OUT)/$(base<<w.nr>>)_Instrument_%.pdf) \
9 $(scores<<w.nr>>:%%=$(OUT)/$(base<<w.nr>>)_Score_%.pdf)
11 <$ endfor $>
12 <$ if latex -$>
13 texbase = << latex.basename >>
14 texscores = << latex.scores|join (" ") >>
15 texs = $(texscores:%=TeX_$(texbase)_Score_%.tex)
16 texpdfs = $(texs:%.tex=$(OUT)/%.pdf) \
17 $(OUT)/TeX_$(texbase)_Score_Instruments.pdf
18 <$ endif $>
20 additionalscores = <$ for s in additionalscores $>$(OUT)/<< s >>.pdf <$ endfor $>
22 .PHONY: all clean
23 all: $(OUT) <$ for w in works $>$(instruments<< w.nr >>) $(scores<< w.nr >>) <$ endfor $>$(additionalscores)<$ if latex $> tex <$ endif $>
24 <$ for w in works -$>
25 instruments<<w.nr>>: $(instruments<<w.nr>>)
26 scores<<w.nr>>: $(scores<<w.nr>>)
27 <$ endfor $>
29 clean:
30 rm -rf $(OUT)
32 $(OUT) :
33 mkdir -p $(OUT)
35 <$ for w in works -$>
36 $(instruments<< w.nr >>): % : $(OUT)/$(base<< w.nr >>)_Instrument_%.pdf $(SRCS<< w.nr >>)
37 $(scores<< w.nr >>): % : $(OUT)/$(base<< w.nr >>)_Score_%.pdf $(SRCS<< w.nr >>)
38 <$ endfor $>
40 $(OUT)/%.pdf : %.ly
41 lilypond -o $(basename $@) $<
43 $(OUT)/%.mp3 : %.midi
44 timidity -c /etc/timidity/fluidr3_gm.cfg -OwM $< -o $@
46 $(additionalscores): $(OUT)/%.pdf: %.ly
47 lilypond -dbackend=eps -o $(basename $@) $<
49 <$ if latex -$>
50 tex: $(additionalscores) latex
51 latex: <$ for w in works $>$(pdfs<< w.nr >>) <$ endfor $>$(texpdfs)
52 latexpdf: $(texpdfs)
54 $(OUT)/TeX_%.pdf : TeX_%.tex
55 TEXINPUTS=$(OUT): latex --output-directory=$(OUT)/ $<
56 <$ endif $>