]> git.donarmstrong.com Git - lilypond.git/blob - mf/GNUmakefile
Misc small administrative changes.
[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,parmesan[0-9]*.mf)
20
21 STAFF_SIZES = 11 13 14 16 18 20 23 26
22 BRACES = a b c d e f g h i
23
24 OTF_FILES = $(STAFF_SIZES:%=$(outdir)/emmentaler-%.otf) \
25             $(outdir)/aybabtu.otf
26 PE_SCRIPTS = $(STAFF_SIZES:%=$(outdir)/emmentaler-%.pe) \
27              $(STAFF_SIZES:%=$(outdir)/emmentaler-%.dep)
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)/aybabtu.otf-table: $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
49         cat $^ > $@
50
51 $(outdir)/aybabtu.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-alphabet%.pfb \
66                             $(outdir)/parmesan%.pfb \
67                             $(outdir)/feta%.otf-table \
68                             $(outdir)/feta%.otf-gtable
69         cd $(outdir) && $(FONTFORGE) -script $(notdir $(basename ,$@).pe)
70
71 $(outdir)/aybabtu.otf \
72 $(outdir)/aybabtu.svg: $(outdir)/aybabtu.pe \
73                        $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).pfb) \
74                        $(outdir)/aybabtu.otf-table $(outdir)/aybabtu.otf-gtable
75         cd $(outdir) && $(FONTFORGE) -script aybabtu.pe
76
77 $(outdir)/%.pfb: $(outdir)/%.log
78
79 $(outdir)/%.otf-table: $(outdir)/%.lisp
80         cat $< $(if $(findstring brace,$<),,$(subst feta,parmesan,$<)) \
81                $(if $(findstring brace,$<),,$(subst feta,feta-alphabet,$<)) > $@
82
83
84 ## ugh -- we want this to prevent failing -j2 compiles.
85 $(outdir)/feta26.otf-table: $(outdir)/feta26.lisp \
86                             $(outdir)/parmesan26.lisp \
87                             $(outdir)/feta-alphabet26.lisp
88 $(outdir)/feta23.otf-table: $(outdir)/feta23.lisp \
89                             $(outdir)/parmesan23.lisp \
90                             $(outdir)/feta-alphabet23.lisp
91 $(outdir)/feta20.otf-table: $(outdir)/feta20.lisp \
92                             $(outdir)/parmesan20.lisp \
93                             $(outdir)/feta-alphabet20.lisp
94 $(outdir)/feta18.otf-table: $(outdir)/feta18.lisp \
95                             $(outdir)/parmesan18.lisp \
96                             $(outdir)/feta-alphabet18.lisp
97 $(outdir)/feta16.otf-table: $(outdir)/feta16.lisp \
98                             $(outdir)/parmesan16.lisp \
99                             $(outdir)/feta-alphabet16.lisp
100 $(outdir)/feta14.otf-table: $(outdir)/feta14.lisp \
101                             $(outdir)/parmesan14.lisp \
102                             $(outdir)/feta-alphabet14.lisp
103 $(outdir)/feta13.otf-table: $(outdir)/feta13.lisp \
104                             $(outdir)/parmesan13.lisp \
105                             $(outdir)/feta-alphabet13.lisp
106 $(outdir)/feta11.otf-table: $(outdir)/feta11.lisp \
107                             $(outdir)/parmesan11.lisp \
108                             $(outdir)/feta-alphabet11.lisp
109
110 $(outdir)/aybabtu.otf: $(outdir)/aybabtu.subfonts \
111                        $(outdir)/aybabtu.fontname \
112                        $(outdir)/aybabtu.otf-table \
113                        $(outdir)/aybabtu.otf-gtable \
114                        $(outdir)/aybabtu.pe
115
116 $(outdir)/aybabtu.otf \
117 $(outdir)/aybabtu.svg: $(BRACES:%=$(outdir)/feta-braces-%.pfb)
118
119 $(outdir)/aybabtu.fontname:
120         echo -n 'aybabtu' > $@
121 $(outdir)/aybabtu.subfonts:
122         echo $(subst .mf,,$(call src-wildcard,feta-braces-[a-z].mf)) > $@
123
124 $(PE_SCRIPTS): $(top-build-dir)/buildscripts/$(outdir)/gen-emmentaler-scripts
125         $(PYTHON) $< --dir=$(outdir)
126
127 ALL_FONTS = $(FETA_FONTS)
128 PFB_FILES = $(ALL_FONTS:%=$(outdir)/%.pfb)
129
130 # Make tfm files first, log files last,
131 # so that normally log files aren't made twice
132 ALL_GEN_FILES = $(LOG_FILES) \
133                 $(ENC_FILES) \
134                 $(LISP_FILES) \
135                 $(OTF_TABLES) \
136                 $(NCSB_OTFS) \
137                 $(PFB_FILES) \
138                 $(OTF_FILES) \
139                 $(SVG_FILES)
140
141 # PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
142
143 INSTALLATION_DIR = $(local_lilypond_datadir)/fonts/source
144 INSTALLATION_FILES = $(MF_FILES)
145
146 INSTALLATION_OUT_SUFFIXES = 1 2 3
147
148 INSTALLATION_OUT_DIR1 = $(local_lilypond_datadir)/fonts/otf
149 INSTALLATION_OUT_FILES1 = $(OTF_FILES) \
150                           $(NCSB_OTFS)
151
152 INSTALLATION_OUT_DIR2 = $(local_lilypond_datadir)/fonts/svg
153 INSTALLATION_OUT_FILES2 = $(SVG_FILES)
154
155 INSTALLATION_OUT_DIR3 = $(local_lilypond_datadir)/fonts/type1
156 INSTALLATION_OUT_FILES3 = $(PFB_FILES)
157
158 export MFINPUTS := .:$(MFINPUTS)
159
160
161 default: $(ALL_GEN_FILES) \
162          $(outdir)/emmentaler-20.otf \
163          tree-regen \
164          $(outdir)/fonts.conf
165
166 .PHONY: tree-regen
167
168 # FIXME: temporary hack: must regenerate after building fonts
169 tree-regen:
170         ${MAKE} -C $(top-build-dir) link-mf-tree
171
172 ##
173 ## todo: this also depends on .tfm, FIXME.
174 $(outdir)/%.lisp \
175 $(outdir)/%.otf-gtable \
176 $(outdir)/%.enc \
177 $(outdir)/%.dep: $(outdir)/%.log
178         $(PYTHON) $(buildscript-dir)/mf-to-table.py \
179                   --global-lisp=$(outdir)/$(<F:.log=.otf-gtable) \
180                   --lisp=$(outdir)/$(<F:.log=.lisp) \
181                   --outdir=$(outdir) \
182                   --dep $(outdir)/$(<F:.log=.dep) \
183                   --enc $(outdir)/$(<F:.log=.enc) \
184                   $<
185
186 local-clean:
187         rm -f mfplain.mem mfplain.log
188         rm -f *.tfm *.log
189
190
191 $(outdir)/fonts.conf:
192         echo '<fontconfig><dir>'$(shell cd $(outdir); pwd)'</dir></fontconfig>' > $@
193
194 $(NCSB_OTFS): $(NCSB_SOURCE_FILES) \
195               $(buildscript-dir)/pfx2ttf.fontforge
196         $(foreach i, $(basename $(NCSB_SOURCE_FILES)), \
197                 $(FONTFORGE) -script $(buildscript-dir)/pfx2ttf.fontforge \
198                         $(i).pfb $(i).afm $(outdir)/ && ) true
199
200 # eof