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