]> git.donarmstrong.com Git - lilypond.git/blob - mf/GNUmakefile
Generate a .pe script for one design size at a time.
[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 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-gtable: $(BRACES:%=$(outdir)/feta-braces-%.otf-gtable)
49         echo '(design_size . 20)' > $@
50
51 $(outdir)/feta%.otf-table: $(outdir)/feta%.lisp $(outdir)/parmesan%.lisp \
52         $(outdir)/parmesan-noteheads%.lisp \
53         $(outdir)/feta-noteheads%.lisp \
54         $(outdir)/feta-flags%.lisp \
55         $(outdir)/feta-alphabet%.lisp
56         cat $^ > $@
57
58 $(outdir)/emmentaler-brace.otf-table: $(foreach x, a b c d e f g h i,$(outdir)/feta-braces-$(x).lisp)
59         cat $^ > $@
60
61 $(outdir)/emmentaler-brace.otf: $(outdir)/emmentaler-brace.subfonts \
62                                 $(outdir)/emmentaler-brace.fontname \
63                                 $(outdir)/emmentaler-brace.otf-table \
64                                 $(outdir)/emmentaler-brace.otf-gtable \
65                                 $(outdir)/emmentaler-brace.pe
66
67 $(outdir)/emmentaler-brace.fontname:
68         printf 'emmentaler-brace' > $@
69 $(outdir)/emmentaler-brace.subfonts:
70         echo $(subst .mf,,$(call src-wildcard,feta-braces-[a-z].mf)) > $@
71
72 $(outdir)/emmentaler-%.genpe: $(buildscript-dir)/gen-emmentaler-scripts
73         $< --dir=$(outdir) --design-size=$(patsubst emmentaler-%.genpe,%,$(notdir $@))
74
75 ALL_GEN_FILES = $(ENC_FILES) \
76                 $(NCSB_OTFS) \
77                 $(OTF_FILES) \
78                 $(SVG_FILES) \
79                 $(WOFF_FILES)
80
81 # PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
82
83 INSTALLATION_DIR = $(local_lilypond_datadir)/fonts/source
84 INSTALLATION_FILES = $(MF_FILES)
85
86 INSTALLATION_OUT_SUFFIXES = 1 2
87
88 INSTALLATION_OUT_DIR1 = $(local_lilypond_datadir)/fonts/otf
89 INSTALLATION_OUT_FILES1 = $(OTF_FILES) \
90                           $(NCSB_OTFS)
91
92 INSTALLATION_OUT_DIR2 = $(local_lilypond_datadir)/fonts/svg
93 INSTALLATION_OUT_FILES2 = $(SVG_FILES) $(WOFF_FILES)
94
95 export MFINPUTS := .:$(MFINPUTS)
96
97 # A few rules here generate multiple files from one command line.  For
98 # treating this case, we only declare one output explicitly, and use a
99 # dummy rules for the other outputs. The dummy rule uses
100 # $(UPDATE_TARGET) so the order of writing in the real command does
101 # not confuse make.
102 UPDATE_TARGET = if test -f $@; then touch $@ ; fi
103
104 # only for fonts which
105 #
106 # 1. are mentioned in font.scm
107 #
108 # 2. are not included with teTeX
109 #
110 $(outdir)/%.lisp: $(outdir)/%.log $(outdir)/%.tfm
111         $(buildscript-dir)/mf-to-table \
112                 --global-lisp=$(outdir)/$(<F:.log=.otf-gtable) \
113                 --lisp=$(outdir)/$(<F:.log=.lisp) \
114                 --outdir=$(outdir) \
115                 --enc $(outdir)/$(<F:.log=.enc) \
116                 $<
117
118 $(outdir)/%.otf-gtable $(outdir)/%.enc: $(outdir)/%.lisp
119         $(UPDATE_TARGET)
120
121 ## Putting pfb here forces all .pfb fonts to be built before
122 # fontforge starts generating emmentaler-*.* fonts.
123 $(outdir)/emmentaler-%.otf: $(outdir)/emmentaler-%.genpe \
124                             $(outdir)/feta%.pfb \
125                             $(outdir)/feta-noteheads%.pfb \
126                             $(outdir)/feta-flags%.pfb \
127                             $(outdir)/feta-alphabet%.pfb \
128                             $(outdir)/parmesan%.pfb \
129                             $(outdir)/parmesan-noteheads%.pfb \
130                             $(outdir)/feta%.otf-table \
131                             $(outdir)/feta%.otf-gtable \
132                             | pfb
133         cd $(outdir) && $(FONTFORGE) -script $(notdir $<)
134
135 $(outdir)/emmentaler-%.svg $(outdir)/emmentaler-%.woff: $(outdir)/emmentaler-%.otf
136         $(UPDATE_TARGET)
137
138 $(outdir)/emmentaler-brace.otf: $(outdir)/emmentaler-brace.pe\
139                        $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).pfb) \
140                        $(outdir)/emmentaler-brace.otf-table $(outdir)/emmentaler-brace.otf-gtable \
141                        | pfb
142         cd $(outdir) && $(FONTFORGE) -script emmentaler-brace.pe
143
144 $(outdir)/emmentaler-brace.svg $(outdir)/emmentaler-brace.woff: $(outdir)/emmentaler-brace.otf
145         $(UPDATE_TARGET)
146
147 default: tree-regen \
148          $(outdir)/fonts.conf
149
150 .PHONY: tree-regen
151
152 tree-regen: $(ALL_GEN_FILES)
153         ${MAKE} -C $(top-build-dir) link-mf-tree
154
155
156 local-clean:
157         rm -f mfplain.mem mfplain.log
158         rm -f *.tfm *.log
159
160
161 $(outdir)/fonts.conf:
162         echo '<fontconfig><dir>'$(shell cd $(outdir); pwd)'</dir></fontconfig>' > $@
163
164
165 $(outdir)/CenturySchL-Roma.otf: $(NCSB_SOURCE_FILES) \
166               $(auxscript-dir)/pfx2ttf.fontforge
167         $(foreach i, $(basename $(NCSB_SOURCE_FILES)), \
168                 $(FONTFORGE) -script $(auxscript-dir)/pfx2ttf.fontforge \
169                         $(i).pfb $(i).afm $(outdir)/ && ) true
170
171 $(addprefix $(outdir)/,CenturySchL-Ital.otf \
172         CenturySchL-Bold.otf \
173         CenturySchL-BoldItal.otf): $(outdir)/CenturySchL-Roma.otf
174         $(UPDATE_TARGET)