]> git.donarmstrong.com Git - lilypond.git/blob - mf/GNUmakefile
Add improved shape note support
[lilypond.git] / mf / GNUmakefile
1 # mf/GNUmakefile
2
3 depth = ..
4
5 STEPMAKE_TEMPLATES = metafont \
6                      install \
7                      install-out
8 LOCALSTEPMAKE_TEMPLATES = lilypond
9
10 include $(depth)/make/stepmake.make
11
12
13 EXTRA_DIST_FILES += README mf2pt1.mp
14
15 # We don't use $(MF_FILES), because there's more .mf cruft here
16 FETA_MF_FILES = $(call src-wildcard,feta[0-9]*.mf) \
17                 $(call src-wildcard,feta-braces-[a-z].mf) \
18                 $(call src-wildcard,feta-alphabet*[0-9].mf) \
19                 $(call src-wildcard,feta-notehead*[0-9].mf) \
20                 $(call src-wildcard,parmesan[0-9]*.mf)
21
22 STAFF_SIZES = 11 13 14 16 18 20 23 26
23 BRACES = a b c d e f g h i
24
25 OTF_FILES = $(STAFF_SIZES:%=$(outdir)/emmentaler-%.otf) \
26             $(outdir)/emmentaler-brace.otf
27 PE_SCRIPTS = $(STAFF_SIZES:%=$(outdir)/emmentaler-%.pe)
28 OTF_TABLES = $(STAFF_SIZES:%=$(outdir)/feta%.otf-table) \
29              $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
30 FETA_FONTS = $(FETA_MF_FILES:.mf=)
31 SVG_FILES = $(OTF_FILES:%.otf=%.svg)
32
33 FC_FIND = $(shell $(FCMATCH) --verbose 'Century Schoolbook L:style=$(1)' \
34                   | grep 'file:' \
35                   | sed 's/.*"\([^"]*\)".*/\1/g')
36
37 NCSB_OTFS = $(addprefix $(outdir)/,CenturySchL-Ital.otf \
38                                    CenturySchL-BoldItal.otf \
39                                    CenturySchL-Roma.otf \
40                                    CenturySchL-Bold.otf)
41 NCSB_INSTALL_DIR = $(local_lilypond_datadir)/fonts/otf
42
43 LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log)
44 LISP_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.lisp)
45 ENC_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.enc)
46 TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm)
47
48 $(outdir)/emmentaler-brace.otf-table: $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
49         cat $^ > $@
50
51 $(outdir)/emmentaler-brace.otf-gtable: $(BRACES:%=$(outdir)/feta-braces-%.otf-gtable)
52         echo '(design_size . 20)' > $@
53
54
55 # only for fonts which
56 #
57 # 1. are mentioned in font.scm
58 #
59 # 2. are not included with teTeX
60 #
61
62 $(outdir)/emmentaler-%.otf \
63 $(outdir)/emmentaler-%.svg: $(outdir)/emmentaler-%.pe \
64                             $(outdir)/feta%.pfb \
65                             $(outdir)/feta-noteheads%.pfb \
66                             $(outdir)/feta-alphabet%.pfb \
67                             $(outdir)/parmesan%.pfb \
68                             $(outdir)/feta%.otf-table \
69                             $(outdir)/feta%.otf-gtable
70         cd $(outdir) && $(FONTFORGE) -script $(notdir $(basename ,$@).pe)
71
72 $(outdir)/emmentaler-brace.otf \
73 $(outdir)/emmentaler-brace.svg: $(outdir)/emmentaler-brace.pe \
74                        $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).pfb) \
75                        $(outdir)/emmentaler-brace.otf-table $(outdir)/emmentaler-brace.otf-gtable
76         cd $(outdir) && $(FONTFORGE) -script emmentaler-brace.pe
77
78 $(outdir)/%.pfb: $(outdir)/%.log
79
80 $(outdir)/%.otf-table: $(outdir)/%.lisp
81         cat $< $(if $(findstring brace,$<),,$(subst feta,parmesan,$<)) \
82                $(if $(findstring brace,$<),,$(subst feta,feta-noteheads,$<)) \
83                $(if $(findstring brace,$<),,$(subst feta,feta-alphabet,$<)) > $@
84
85
86 ## ugh -- we want this to prevent failing -j2 compiles.
87 $(outdir)/feta26.otf-table: $(outdir)/feta26.lisp \
88                             $(outdir)/feta-noteheads26.lisp \
89                             $(outdir)/parmesan26.lisp \
90                             $(outdir)/feta-alphabet26.lisp
91 $(outdir)/feta23.otf-table: $(outdir)/feta23.lisp \
92                             $(outdir)/feta-noteheads23.lisp \
93                             $(outdir)/parmesan23.lisp \
94                             $(outdir)/feta-alphabet23.lisp
95 $(outdir)/feta20.otf-table: $(outdir)/feta20.lisp \
96                             $(outdir)/feta-noteheads23.lisp \
97                             $(outdir)/parmesan20.lisp \
98                             $(outdir)/feta-alphabet20.lisp
99 $(outdir)/feta18.otf-table: $(outdir)/feta18.lisp \
100                             $(outdir)/feta-noteheads18.lisp \
101                             $(outdir)/parmesan18.lisp \
102                             $(outdir)/feta-alphabet18.lisp
103 $(outdir)/feta16.otf-table: $(outdir)/feta16.lisp \
104                             $(outdir)/feta-noteheads16.lisp \
105                             $(outdir)/parmesan16.lisp \
106                             $(outdir)/feta-alphabet16.lisp
107 $(outdir)/feta14.otf-table: $(outdir)/feta14.lisp \
108                             $(outdir)/feta-noteheads14.lisp \
109                             $(outdir)/parmesan14.lisp \
110                             $(outdir)/feta-alphabet14.lisp
111 $(outdir)/feta13.otf-table: $(outdir)/feta13.lisp \
112                             $(outdir)/feta-noteheads13.lisp \
113                             $(outdir)/parmesan13.lisp \
114                             $(outdir)/feta-alphabet13.lisp
115 $(outdir)/feta11.otf-table: $(outdir)/feta11.lisp \
116                             $(outdir)/feta-noteheads11.lisp \
117                             $(outdir)/parmesan11.lisp \
118                             $(outdir)/feta-alphabet11.lisp
119
120 $(outdir)/emmentaler-brace.otf: $(outdir)/emmentaler-brace.subfonts \
121                                 $(outdir)/emmentaler-brace.fontname \
122                                 $(outdir)/emmentaler-brace.otf-table \
123                                 $(outdir)/emmentaler-brace.otf-gtable \
124                                 $(outdir)/emmentaler-brace.pe
125
126 $(outdir)/emmentaler-brace.otf \
127 $(outdir)/emmentaler-brace.svg: $(BRACES:%=$(outdir)/feta-braces-%.pfb)
128
129 $(outdir)/emmentaler-brace.fontname:
130         echo -n 'emmentaler-brace' > $@
131 $(outdir)/emmentaler-brace.subfonts:
132         echo $(subst .mf,,$(call src-wildcard,feta-braces-[a-z].mf)) > $@
133
134 $(PE_SCRIPTS): $(buildscript-dir)/gen-emmentaler-scripts
135         $< --dir=$(outdir)
136
137 ALL_FONTS = $(FETA_FONTS)
138 PFB_FILES = $(ALL_FONTS:%=$(outdir)/%.pfb)
139
140 .PRECIOUS: $(PFB_FILES)
141
142
143 # Make tfm files first, log files last,
144 # so that normally log files aren't made twice
145 ALL_GEN_FILES = $(LOG_FILES) \
146                 $(ENC_FILES) \
147                 $(LISP_FILES) \
148                 $(OTF_TABLES) \
149                 $(NCSB_OTFS) \
150                 $(OTF_FILES) \
151                 $(SVG_FILES)
152
153 # PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
154
155 INSTALLATION_DIR = $(local_lilypond_datadir)/fonts/source
156 INSTALLATION_FILES = $(MF_FILES)
157
158 INSTALLATION_OUT_SUFFIXES = 1 2 3
159
160 INSTALLATION_OUT_DIR1 = $(local_lilypond_datadir)/fonts/otf
161 INSTALLATION_OUT_FILES1 = $(OTF_FILES) \
162                           $(NCSB_OTFS)
163
164 INSTALLATION_OUT_DIR2 = $(local_lilypond_datadir)/fonts/svg
165 INSTALLATION_OUT_FILES2 = $(SVG_FILES)
166
167 export MFINPUTS := .:$(MFINPUTS)
168
169
170 default: $(PFB_FILES) $(ALL_GEN_FILES) \
171          $(outdir)/emmentaler-20.otf \
172          tree-regen \
173          $(outdir)/fonts.conf
174
175 .PHONY: tree-regen
176
177 # FIXME: temporary hack: must regenerate after building fonts
178 tree-regen: $(ALL_GEN_FILES)
179         ${MAKE} -C $(top-build-dir) link-mf-tree
180
181 ##
182 ## todo: this also depends on .tfm, FIXME.
183 $(outdir)/%.lisp \
184 $(outdir)/%.otf-gtable \
185 $(outdir)/%.enc \
186 $(outdir)/%.pe: $(outdir)/%.log
187         $(buildscript-dir)/mf-to-table \
188                 --global-lisp=$(outdir)/$(<F:.log=.otf-gtable) \
189                 --lisp=$(outdir)/$(<F:.log=.lisp) \
190                 --outdir=$(outdir) \
191                 --enc $(outdir)/$(<F:.log=.enc) \
192                 $<
193
194 local-clean:
195         rm -f mfplain.mem mfplain.log
196         rm -f *.tfm *.log
197
198
199 $(outdir)/fonts.conf:
200         echo '<fontconfig><dir>'$(shell cd $(outdir); pwd)'</dir></fontconfig>' > $@
201
202 $(NCSB_OTFS): $(NCSB_SOURCE_FILES) \
203               $(auxscript-dir)/pfx2ttf.fontforge
204         $(foreach i, $(basename $(NCSB_SOURCE_FILES)), \
205                 $(FONTFORGE) -script $(auxscript-dir)/pfx2ttf.fontforge \
206                         $(i).pfb $(i).afm $(outdir)/ && ) true
207
208 # eof