webshob target, quiet pdflatex, etc. in the template
[orchestrallily.git] / Templates / EK_Full / Makefile
blob909ebc0de054b5f6e902622b936944fc88de34e7
1 OUT=out
3 <$ for w in works -$>
4 base<< w.nr >> = << w.basename >>
5 SRCS<< w.nr >> = << [w.srcfiles.parts|join (" "), w.srcfiles.settings|join (" ")]|join(" ")|replace ( w.basename, "$(base" ~ w.nr ~ ")" ) >>
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 distfiles = $(instruments:%=$(OUT)/$(base)_Instrument_%.pdf) $(texpdfs)
22 <$ set jj = joiner(" ") -$>
23 additionalscores =<$ for s in additionalscores $> << jj() >>$(OUT)/<< s >>.pdf<$ endfor $>
25 .PHONY: all clean
26 all: $(OUT)<$ for w in works $> $(instruments<< w.nr >>) $(scores<< w.nr >>)<$ endfor $> $(additionalscores)<$ if latex $> tex<$ endif $>
27 <$ for w in works -$>
28 instruments<<w.nr>>: $(instruments<<w.nr>>)
29 scores<<w.nr>>: $(scores<<w.nr>>)
30 <$ endfor $>
32 clean:
33 rm -rf $(OUT)
35 lily: <$ for w in works $>$(pdfs<< w.nr >>) <$ endfor $>$(additionalscores)
37 $(OUT) :
38 mkdir -p $(OUT)
40 <$ for w in works -$>
41 $(instruments<< w.nr >>): % : $(OUT)/$(base<< w.nr >>)_Instrument_%.pdf $(SRCS<< w.nr >>)
42 $(scores<< w.nr >>): % : $(OUT)/$(base<< w.nr >>)_Score_%.pdf $(SRCS<< w.nr >>)
43 <$ endfor $>
45 $(OUT)/%.pdf : %.ly
46 lilypond -o $(basename $@) $<
48 $(OUT)/%.mp3 : %.midi
49 timidity -c /etc/timidity/fluidr3_gm.cfg -OwM $< -o $@
51 $(additionalscores): $(OUT)/%.pdf: %.ly
52 lilypond -dbackend=eps -o $(basename $@) $<
54 <$ if latex -$>
55 tex: $(additionalscores) latex
56 latex: <$ for w in works $>$(pdfs<< w.nr >>) <$ endfor $>$(texpdfs)
57 latexpdf: $(texpdfs)
59 $(OUT)/TeX_%.pdf : TeX_%.tex
60 TEXINPUTS=$(OUT):orchestrallily/:.//: pdflatex -interaction=batchmode --output-directory=$(OUT)/ $<
61 <$- endif $>
63 zipdir = $(base)_Final
64 dist: $(distfiles)
65 mkdir -p $(zipdir)
66 cp -r $(distfiles) $(zipdir)
67 rename 's/TeX_//' $(zipdir)/*
68 rename 's/Score_(Full|Long)\./Score./' $(zipdir)/*
69 zip -jr $(base).zip $(zipdir)
70 rm -rf $(zipdir)
73 webshop: $(distfiles)
74 python ../../Diverses/Webshop/EditionKainhofer_CSVI_Generate.py "<< settings_file >>" $(distfiles)