2 # Mutopia Makefile Project
6 # For testing installed lily
8 make-root=$(wildcard $(HOME)/tmp/test/usr/share/lilypond/make)
9 #make-root=$(wildcard $(HOME)/usr/src/lilypond/make)
10 make-root?=$(wildcard /usr/share/lilypond/make)
15 LOCALSTEPMAKE_TEMPLATES=mutopia
16 include $(make-root)/stepmake.make
21 # Minimalistic standalone part. I'd very much like to install make/*
22 # and stepmake/stepmake/* in /usr/share/lilypond, and junk this.
27 LY_FILES=$(wildcard *.ly)
33 rm -f $(outdir)/* $(outdir)-letter/*
37 # stepmake/stepmake/files.ly
39 DEP_FILES:=$(wildcard $(outdir)/*.dep)
42 # stepmake/stepmake/generic-targets.make
44 include $(outdir)/dummy.dep $(DEP_FILES)
48 touch $(outdir)/dummy.dep
51 # make/mutopia-rules.make
54 # don't junk intermediate .dvi files. They're easier to view than
56 .PRECIOUS: $(outdir)/%.dvi
59 # should we dist ps-to-pngs?
61 $(outdir)/%.png: $(outdir)/%.ps
63 -mv $(name-stem)-page*.png $(outdir)/
67 ly2dvi --outdir=$(outdir) --dependencies $<
68 -mv $(basename $<)*.midi $(outdir)
70 $(outdir)-$(PAPERSIZE)/%.dvi: %.ly
71 ly2dvi.py --outdir=$(outdir)-$(PAPERSIZE) --dependencies --papersize=$(PAPERSIZE) $<
72 -mv $(basename $<)*.midi $(outdir)-$(PAPERSIZE)
76 # stepmake/stepmake/tex-rules.make
78 $(outdir)/%.tex: %.tex
81 $(outdir)/%.dvi: $(outdir)/%.tex
82 (cd $(outdir); tex \\nonstopmode \\input $(<F))
84 $(outdir)/%.dvi: $(outdir)/%.latex
86 latex \\nonstopmode \\input $(<F)&&\
87 (bibtex $(basename $(<F)) || true) && \
88 latex \\nonstopmode \\input $(<F)&&\
89 (makeindex $(basename $(<F)) || true) && \
90 latex \\nonstopmode \\input $(<F) )
92 $(outdir)/%.ps: $(outdir)/%.dvi
93 cd $(outdir) && dvips -ta4 -o $(@F) $(<F)
95 $(outdir)-$(PAPERSIZE)/%.ps: $(outdir)-$(PAPERSIZE)/%.dvi
96 cd $(outdir) && dvips -t$(PAPERSIZE) -o $(@F) $(<F)
103 $(outdir)/%.latex: %.doc
105 lilypond-book --outdir=$(outdir) --dependencies $<
112 # Mutopia/user targets.
113 # This needs some work.
117 parts=$(patsubst %.ly,%,$(wildcard *-part.ly))
120 mutopia-examples=coriolan $(parts)
121 mutopia-letter=$(mutopia-examples:%=out-letter/%.ps.gz)
125 $(MAKE) examples="$(mutopia-examples)" PAPERSIZE=letter local-WWW $(mutopia-letter)