]> git.donarmstrong.com Git - lilypond.git/blob - make/ly.make
patch::: 1.3.130.jcn2
[lilypond.git] / make / ly.make
1 #!/usr/bin/make
2 # Mutopia Makefile Project
3 #
4
5 #
6 # For testing installed lily
7 #
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)
11
12 ifneq ($(make-root),)
13
14 depth=$(make-root)/..
15 LOCALSTEPMAKE_TEMPLATES=mutopia
16 include $(make-root)/stepmake.make
17
18 else
19         burp
20 #
21 # Minimalistic standalone part.  I'd very much like to install make/*
22 # and stepmake/stepmake/* in /usr/share/lilypond, and junk this.
23 #
24
25 outdir=out
26 PAPERSIZE=
27 LY_FILES=$(wildcard *.ly)
28
29 default:
30         echo $(DEP_FILES)
31         $(examples)
32 clean:
33         rm -f $(outdir)/* $(outdir)-letter/*
34
35
36 #
37 # stepmake/stepmake/files.ly
38 #
39 DEP_FILES:=$(wildcard $(outdir)/*.dep)
40
41 #
42 # stepmake/stepmake/generic-targets.make
43 #
44 include $(outdir)/dummy.dep $(DEP_FILES)
45
46 $(outdir)/dummy.dep:
47         -mkdir -p $(outdir)
48         touch $(outdir)/dummy.dep
49
50 #
51 # make/mutopia-rules.make
52 #
53
54 # don't junk intermediate .dvi files.  They're easier to view than
55 # .ps or .png
56 .PRECIOUS: $(outdir)/%.dvi
57
58 #
59 # should we dist ps-to-pngs?
60 #
61 $(outdir)/%.png: $(outdir)/%.ps
62         ps-to-pngs $<
63         -mv $(name-stem)-page*.png $(outdir)/
64         touch $@
65
66 $(outdir)/%.dvi: %.ly
67         ly2dvi --outdir=$(outdir) --dependencies $< 
68         -mv $(basename $<)*.midi $(outdir)
69
70 $(outdir)-$(PAPERSIZE)/%.dvi: %.ly
71         ly2dvi.py --outdir=$(outdir)-$(PAPERSIZE) --dependencies --papersize=$(PAPERSIZE) $< 
72         -mv $(basename $<)*.midi $(outdir)-$(PAPERSIZE)
73
74
75 #
76 # stepmake/stepmake/tex-rules.make
77 #
78 $(outdir)/%.tex: %.tex
79         cp $< $@
80
81 $(outdir)/%.dvi: $(outdir)/%.tex
82         (cd $(outdir); tex \\nonstopmode \\input $(<F))
83
84 $(outdir)/%.dvi: $(outdir)/%.latex
85         (cd $(outdir)&& \
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) )
91
92 $(outdir)/%.ps: $(outdir)/%.dvi
93         cd $(outdir) && dvips -ta4 -o $(@F) $(<F)
94
95 $(outdir)-$(PAPERSIZE)/%.ps: $(outdir)-$(PAPERSIZE)/%.dvi
96         cd $(outdir) && dvips -t$(PAPERSIZE) -o $(@F) $(<F)
97
98
99 #
100 # make/ly-rules.make
101 #
102
103 $(outdir)/%.latex: %.doc
104         rm -f $@
105         lilypond-book --outdir=$(outdir) --dependencies $<
106         chmod -w $@
107
108 endif
109
110
111 #
112 # Mutopia/user targets.
113 # This needs some work.
114 #
115
116
117 parts=$(patsubst %.ly,%,$(wildcard *-part.ly))
118
119 tarball=coriolan
120 mutopia-examples=coriolan $(parts)
121 mutopia-letter=$(mutopia-examples:%=out-letter/%.ps.gz)
122
123
124 mutopia:
125         $(MAKE) examples="$(mutopia-examples)" PAPERSIZE=letter local-WWW $(mutopia-letter)
126