]> git.donarmstrong.com Git - lilypond.git/blob - mf/GNUmakefile
2cddd187e12b8082b1bc7c354f948fd3d84bf392
[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 # These are the main .mf files.  We don't use $(MF_FILES) here,
11 # because there are more .mf files, input'ed into the main files.
12 FETA_MF_FILES = $(call src-wildcard,feta[0-9]*.mf) \
13                 $(call src-wildcard,feta-braces-[a-z].mf) \
14                 $(call src-wildcard,feta-alphabet*[0-9].mf) \
15                 $(call src-wildcard,feta-noteheads*[0-9].mf) \
16                 $(call src-wildcard,feta-flags*[0-9].mf) \
17                 $(call src-wildcard,parmesan[0-9]*.mf) \
18                 $(call src-wildcard,parmesan-noteheads*[0-9].mf)
19 FETA_FONTS = $(FETA_MF_FILES:.mf=)
20 ALL_FONTS = $(FETA_FONTS)
21 PFB_FILES = $(ALL_FONTS:%=$(outdir)/%.pfb)
22
23 include $(depth)/make/stepmake.make
24
25
26 EXTRA_DIST_FILES += README mf2pt1.mp
27
28 STAFF_SIZES = 11 13 14 16 18 20 23 26
29 BRACES = a b c d e f g h i
30
31 OTF_FILES = $(STAFF_SIZES:%=$(outdir)/emmentaler-%.otf) \
32             $(outdir)/emmentaler-brace.otf
33 OTF_TABLES = $(STAFF_SIZES:%=$(outdir)/feta%.otf-table) \
34              $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
35 SVG_FILES = $(OTF_FILES:%.otf=%.svg)
36 WOFF_FILES = $(OTF_FILES:%.otf=%.woff)
37
38 NCSB_OTFS = $(addprefix $(outdir)/,CenturySchL-Ital.otf \
39                                    CenturySchL-BoldItal.otf \
40                                    CenturySchL-Roma.otf \
41                                    CenturySchL-Bold.otf)
42
43 HELV_OTFS = $(addprefix $(outdir)/,NimbusSanL-ReguItal.otf \
44                                    NimbusSanL-BoldItal.otf \
45                                    NimbusSanL-Regu.otf \
46                                    NimbusSanL-Bold.otf)
47
48 COUR_OTFS = $(addprefix $(outdir)/,NimbusMonL-ReguObli.otf \
49                                    NimbusMonL-BoldObli.otf \
50                                    NimbusMonL-Regu.otf \
51                                    NimbusMonL-Bold.otf)
52
53 TEXGYRE_OTFS = $(addprefix $(TEXGYRE_DIR)/,$(TEXGYRE_FILES))
54
55 LILYPOND_FONTS_CONF = $(outdir)/00-lilypond-fonts.conf \
56                       $(outdir)/99-lilypond-fonts.conf
57
58 LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log)
59 LISP_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.lisp)
60 ENC_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.enc)
61 TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm)
62
63 $(outdir)/emmentaler-brace.otf-gtable: $(BRACES:%=$(outdir)/feta-braces-%.otf-gtable)
64         echo '(design_size . 20)' > $@
65
66 $(outdir)/feta%.otf-table: $(outdir)/feta%.lisp $(outdir)/parmesan%.lisp \
67         $(outdir)/parmesan-noteheads%.lisp \
68         $(outdir)/feta-noteheads%.lisp \
69         $(outdir)/feta-flags%.lisp \
70         $(outdir)/feta-alphabet%.lisp
71         cat $^ > $@
72
73 $(outdir)/emmentaler-brace.otf-table: $(foreach x, a b c d e f g h i,$(outdir)/feta-braces-$(x).lisp)
74         cat $^ > $@
75
76 $(outdir)/emmentaler-brace.otf: $(outdir)/emmentaler-brace.subfonts \
77                                 $(outdir)/emmentaler-brace.fontname \
78                                 $(outdir)/emmentaler-brace.otf-table \
79                                 $(outdir)/emmentaler-brace.otf-gtable \
80                                 $(outdir)/emmentaler-brace.pe
81
82 $(outdir)/emmentaler-brace.fontname:
83         printf 'emmentaler-brace' > $@
84 $(outdir)/emmentaler-brace.subfonts:
85         echo $(subst .mf,,$(call src-wildcard,feta-braces-[a-z].mf)) > $@
86
87 $(outdir)/emmentaler-%.genpe: $(buildscript-dir)/gen-emmentaler-scripts
88         $< --dir=$(outdir) --design-size=$(patsubst emmentaler-%.genpe,%,$(notdir $@))
89
90 ALL_GEN_FILES = $(ENC_FILES) \
91                 $(NCSB_OTFS) \
92                 $(HELV_OTFS) \
93                 $(COUR_OTFS) \
94                 $(OTF_FILES) \
95                 $(SVG_FILES) \
96                 $(WOFF_FILES) \
97                 $(LILYPOND_FONTS_CONF)
98
99 # PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
100
101 INSTALLATION_DIR = $(local_lilypond_datadir)/fonts/source
102 INSTALLATION_FILES = $(MF_FILES)
103
104 INSTALLATION_OUT_SUFFIXES = 1 2 3
105
106 INSTALLATION_OUT_DIR1 = $(local_lilypond_datadir)/fonts/otf
107 INSTALLATION_OUT_FILES1 = $(OTF_FILES) \
108                           $(NCSB_OTFS) $(HELV_OTFS) $(COUR_OTFS) $(TEXGYRE_OTFS)
109
110 INSTALLATION_OUT_DIR2 = $(local_lilypond_datadir)/fonts/svg
111 INSTALLATION_OUT_FILES2 = $(SVG_FILES) $(WOFF_FILES)
112
113 INSTALLATION_OUT_DIR3 = $(local_lilypond_datadir)/fonts
114 INSTALLATION_OUT_FILES3 = $(LILYPOND_FONTS_CONF)
115
116 export MFINPUTS := .:$(MFINPUTS)
117
118 # A few rules here generate multiple files from one command line.  For
119 # treating this case, we only declare one output explicitly, and use a
120 # dummy rules for the other outputs. The dummy rule uses
121 # $(UPDATE_TARGET) so the order of writing in the real command does
122 # not confuse make.
123 UPDATE_TARGET = if test -f $@; then touch $@ ; fi
124
125 # only for fonts which
126 #
127 # 1. are mentioned in font.scm
128 #
129 # 2. are not included with teTeX
130 #
131 $(outdir)/%.lisp: $(outdir)/%.log $(outdir)/%.tfm
132         $(buildscript-dir)/mf-to-table \
133                 --global-lisp=$(outdir)/$(<F:.log=.otf-gtable) \
134                 --lisp=$(outdir)/$(<F:.log=.lisp) \
135                 --outdir=$(outdir) \
136                 --enc $(outdir)/$(<F:.log=.enc) \
137                 $<
138
139 $(outdir)/%.otf-gtable $(outdir)/%.enc: $(outdir)/%.lisp
140         $(UPDATE_TARGET)
141
142 ## Putting pfb here forces all .pfb fonts to be built before
143 # fontforge starts generating emmentaler-*.* fonts.
144 $(outdir)/emmentaler-%.otf: $(outdir)/emmentaler-%.genpe \
145                             $(outdir)/feta%.pfb \
146                             $(outdir)/feta-noteheads%.pfb \
147                             $(outdir)/feta-flags%.pfb \
148                             $(outdir)/feta-alphabet%.pfb \
149                             $(outdir)/parmesan%.pfb \
150                             $(outdir)/parmesan-noteheads%.pfb \
151                             $(outdir)/feta%.otf-table \
152                             $(outdir)/feta%.otf-gtable \
153                             | pfb
154         cd $(outdir) && $(FONTFORGE) -script $(notdir $<)
155
156 $(outdir)/emmentaler-%.svg $(outdir)/emmentaler-%.woff: $(outdir)/emmentaler-%.otf
157         $(UPDATE_TARGET)
158
159 $(outdir)/emmentaler-brace.otf: $(outdir)/emmentaler-brace.pe\
160                        $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).pfb) \
161                        $(outdir)/emmentaler-brace.otf-table $(outdir)/emmentaler-brace.otf-gtable \
162                        | pfb
163         cd $(outdir) && $(FONTFORGE) -script emmentaler-brace.pe
164
165 $(outdir)/emmentaler-brace.svg $(outdir)/emmentaler-brace.woff: $(outdir)/emmentaler-brace.otf
166         $(UPDATE_TARGET)
167
168 default: tree-regen \
169          $(outdir)/fonts.conf
170
171 .PHONY: tree-regen
172
173 tree-regen: $(ALL_GEN_FILES)
174         ${MAKE} -C $(top-build-dir) link-mf-tree
175
176
177 local-clean:
178         rm -f mfplain.mem mfplain.log
179         rm -f *.tfm *.log
180
181
182 $(outdir)/fonts.conf:
183         echo '<fontconfig><dir>'$(shell cd $(outdir); pwd)'</dir></fontconfig>' > $@
184
185
186 $(outdir)/CenturySchL-Roma.otf: $(NCSB_SOURCE_FILES) \
187               $(auxscript-dir)/pfx2ttf.fontforge
188         $(foreach i, $(basename $(NCSB_SOURCE_FILES)), \
189                 $(FONTFORGE) -script $(auxscript-dir)/pfx2ttf.fontforge \
190                         $(i).pfb $(i).afm $(outdir)/ && ) true
191
192 $(addprefix $(outdir)/,CenturySchL-Ital.otf \
193         CenturySchL-Bold.otf \
194         CenturySchL-BoldItal.otf): $(outdir)/CenturySchL-Roma.otf
195         $(UPDATE_TARGET)
196
197 $(outdir)/NimbusSanL-Regu.otf: $(HELV_SOURCE_FILES) \
198               $(auxscript-dir)/pfx2ttf.fontforge
199         $(foreach i, $(basename $(HELV_SOURCE_FILES)), \
200                 $(FONTFORGE) -script $(auxscript-dir)/pfx2ttf.fontforge \
201                         $(i).pfb $(i).afm $(outdir)/ && ) true
202
203 $(addprefix $(outdir)/,NimbusSanL-ReguItal.otf \
204         NimbusSanL-Bold.otf \
205         NimbusSanL-BoldItal.otf): $(outdir)/NimbusSanL-Regu.otf
206         $(UPDATE_TARGET)
207
208 $(outdir)/NimbusMonL-Regu.otf: $(COUR_SOURCE_FILES) \
209               $(auxscript-dir)/pfx2ttf-mono.fontforge
210         $(foreach i, $(basename $(COUR_SOURCE_FILES)), \
211                 $(FONTFORGE) -script $(auxscript-dir)/pfx2ttf-mono.fontforge \
212                         $(i).pfb $(i).afm $(outdir)/ && ) true
213
214 $(addprefix $(outdir)/,NimbusMonL-ReguObli.otf \
215         NimbusMonL-Bold.otf \
216         NimbusMonL-BoldObli.otf): $(outdir)/NimbusMonL-Regu.otf
217         $(UPDATE_TARGET)