Docs: use lists for nested overrides.
[lilypond.git] / mf / GNUmakefile
blob898a4c245b132bce3aa155ee0260f6c3d837dc76
1 # mf/GNUmakefile
3 depth = ..
5 STEPMAKE_TEMPLATES = metafont \
6 install \
7 install-out
8 LOCALSTEPMAKE_TEMPLATES = lilypond
10 include $(depth)/make/stepmake.make
13 EXTRA_DIST_FILES += README mf2pt1.mp
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)
21 STAFF_SIZES = 11 13 14 16 18 20 23 26
22 BRACES = a b c d e f g h i
24 OTF_FILES = $(STAFF_SIZES:%=$(outdir)/emmentaler-%.otf) \
25 $(outdir)/aybabtu.otf
26 PE_SCRIPTS = $(STAFF_SIZES:%=$(outdir)/emmentaler-%.pe)
27 OTF_TABLES = $(STAFF_SIZES:%=$(outdir)/feta%.otf-table) \
28 $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
29 FETA_FONTS = $(FETA_MF_FILES:.mf=)
30 SVG_FILES = $(OTF_FILES:%.otf=%.svg)
32 FC_FIND = $(shell $(FCMATCH) --verbose 'Century Schoolbook L:style=$(1)' \
33 | grep 'file:' \
34 | sed 's/.*"\([^"]*\)".*/\1/g')
36 NCSB_OTFS = $(addprefix $(outdir)/,CenturySchL-Ital.otf \
37 CenturySchL-BoldItal.otf \
38 CenturySchL-Roma.otf \
39 CenturySchL-Bold.otf)
40 NCSB_INSTALL_DIR = $(local_lilypond_datadir)/fonts/otf
42 LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log)
43 LISP_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.lisp)
44 ENC_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.enc)
45 TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm)
47 $(outdir)/aybabtu.otf-table: $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
48 cat $^ > $@
50 $(outdir)/aybabtu.otf-gtable: $(BRACES:%=$(outdir)/feta-braces-%.otf-gtable)
51 echo '(design_size . 20)' > $@
54 # only for fonts which
56 # 1. are mentioned in font.scm
58 # 2. are not included with teTeX
61 $(outdir)/emmentaler-%.otf \
62 $(outdir)/emmentaler-%.svg: $(outdir)/emmentaler-%.pe \
63 $(outdir)/feta%.pfb \
64 $(outdir)/feta-alphabet%.pfb \
65 $(outdir)/parmesan%.pfb \
66 $(outdir)/feta%.otf-table \
67 $(outdir)/feta%.otf-gtable
68 cd $(outdir) && $(FONTFORGE) -script $(notdir $(basename ,$@).pe)
70 $(outdir)/aybabtu.otf \
71 $(outdir)/aybabtu.svg: $(outdir)/aybabtu.pe \
72 $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).pfb) \
73 $(outdir)/aybabtu.otf-table $(outdir)/aybabtu.otf-gtable
74 cd $(outdir) && $(FONTFORGE) -script aybabtu.pe
76 $(outdir)/%.pfb: $(outdir)/%.log
78 $(outdir)/%.otf-table: $(outdir)/%.lisp
79 cat $< $(if $(findstring brace,$<),,$(subst feta,parmesan,$<)) \
80 $(if $(findstring brace,$<),,$(subst feta,feta-alphabet,$<)) > $@
83 ## ugh -- we want this to prevent failing -j2 compiles.
84 $(outdir)/feta26.otf-table: $(outdir)/feta26.lisp \
85 $(outdir)/parmesan26.lisp \
86 $(outdir)/feta-alphabet26.lisp
87 $(outdir)/feta23.otf-table: $(outdir)/feta23.lisp \
88 $(outdir)/parmesan23.lisp \
89 $(outdir)/feta-alphabet23.lisp
90 $(outdir)/feta20.otf-table: $(outdir)/feta20.lisp \
91 $(outdir)/parmesan20.lisp \
92 $(outdir)/feta-alphabet20.lisp
93 $(outdir)/feta18.otf-table: $(outdir)/feta18.lisp \
94 $(outdir)/parmesan18.lisp \
95 $(outdir)/feta-alphabet18.lisp
96 $(outdir)/feta16.otf-table: $(outdir)/feta16.lisp \
97 $(outdir)/parmesan16.lisp \
98 $(outdir)/feta-alphabet16.lisp
99 $(outdir)/feta14.otf-table: $(outdir)/feta14.lisp \
100 $(outdir)/parmesan14.lisp \
101 $(outdir)/feta-alphabet14.lisp
102 $(outdir)/feta13.otf-table: $(outdir)/feta13.lisp \
103 $(outdir)/parmesan13.lisp \
104 $(outdir)/feta-alphabet13.lisp
105 $(outdir)/feta11.otf-table: $(outdir)/feta11.lisp \
106 $(outdir)/parmesan11.lisp \
107 $(outdir)/feta-alphabet11.lisp
109 $(outdir)/aybabtu.otf: $(outdir)/aybabtu.subfonts \
110 $(outdir)/aybabtu.fontname \
111 $(outdir)/aybabtu.otf-table \
112 $(outdir)/aybabtu.otf-gtable \
113 $(outdir)/aybabtu.pe
115 $(outdir)/aybabtu.otf \
116 $(outdir)/aybabtu.svg: $(BRACES:%=$(outdir)/feta-braces-%.pfb)
118 $(outdir)/aybabtu.fontname:
119 echo -n 'aybabtu' > $@
120 $(outdir)/aybabtu.subfonts:
121 echo $(subst .mf,,$(call src-wildcard,feta-braces-[a-z].mf)) > $@
123 $(PE_SCRIPTS): $(top-build-dir)/buildscripts/$(outdir)/gen-emmentaler-scripts
124 $(PYTHON) $< --dir=$(outdir)
126 ALL_FONTS = $(FETA_FONTS)
127 PFB_FILES = $(ALL_FONTS:%=$(outdir)/%.pfb)
129 # Make tfm files first, log files last,
130 # so that normally log files aren't made twice
131 ALL_GEN_FILES = $(LOG_FILES) \
132 $(ENC_FILES) \
133 $(LISP_FILES) \
134 $(OTF_TABLES) \
135 $(NCSB_OTFS) \
136 $(PFB_FILES) \
137 $(OTF_FILES) \
138 $(SVG_FILES)
140 # PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
142 INSTALLATION_DIR = $(local_lilypond_datadir)/fonts/source
143 INSTALLATION_FILES = $(MF_FILES)
145 INSTALLATION_OUT_SUFFIXES = 1 2 3
147 INSTALLATION_OUT_DIR1 = $(local_lilypond_datadir)/fonts/otf
148 INSTALLATION_OUT_FILES1 = $(OTF_FILES) \
149 $(NCSB_OTFS)
151 INSTALLATION_OUT_DIR2 = $(local_lilypond_datadir)/fonts/svg
152 INSTALLATION_OUT_FILES2 = $(SVG_FILES)
154 INSTALLATION_OUT_DIR3 = $(local_lilypond_datadir)/fonts/type1
155 INSTALLATION_OUT_FILES3 = $(PFB_FILES)
157 export MFINPUTS := .:$(MFINPUTS)
160 default: $(ALL_GEN_FILES) \
161 $(outdir)/emmentaler-20.otf \
162 tree-regen \
163 $(outdir)/fonts.conf
165 .PHONY: tree-regen
167 # FIXME: temporary hack: must regenerate after building fonts
168 tree-regen: $(ALL_GEN_FILES)
169 ${MAKE} -C $(top-build-dir) link-mf-tree
172 ## todo: this also depends on .tfm, FIXME.
173 $(outdir)/%.lisp \
174 $(outdir)/%.otf-gtable \
175 $(outdir)/%.enc \
176 $(outdir)/%.pe: $(outdir)/%.log
177 $(PYTHON) $(buildscript-dir)/mf-to-table.py \
178 --global-lisp=$(outdir)/$(<F:.log=.otf-gtable) \
179 --lisp=$(outdir)/$(<F:.log=.lisp) \
180 --outdir=$(outdir) \
181 --enc $(outdir)/$(<F:.log=.enc) \
184 local-clean:
185 rm -f mfplain.mem mfplain.log
186 rm -f *.tfm *.log
189 $(outdir)/fonts.conf:
190 echo '<fontconfig><dir>'$(shell cd $(outdir); pwd)'</dir></fontconfig>' > $@
192 $(NCSB_OTFS): $(NCSB_SOURCE_FILES) \
193 $(buildscript-dir)/pfx2ttf.fontforge
194 $(foreach i, $(basename $(NCSB_SOURCE_FILES)), \
195 $(FONTFORGE) -script $(buildscript-dir)/pfx2ttf.fontforge \
196 $(i).pfb $(i).afm $(outdir)/ && ) true
198 # eof