Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(814)

Delta Between Two Patch Sets: mf/GNUmakefile

Issue 553700043: scripts/build/scan-mf-deps: script to generate MF dependencies (Closed)
Left Patch Set: more cleanup Created 4 years ago
Right Patch Set: Jonas' nits Created 4 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | mf/invoke-mf2pt1.sh » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 # mf/GNUmakefile 1 # mf/GNUmakefile
2 2
3 depth = .. 3 depth = ..
4 4
5 STEPMAKE_TEMPLATES = install install-out 5 STEPMAKE_TEMPLATES = install install-out
6 LOCALSTEPMAKE_TEMPLATES = lilypond 6 LOCALSTEPMAKE_TEMPLATES = lilypond
7 7
8 # These are the main .mf files. We don't use $(MF_FILES) here, 8 # These are the main .mf files. We don't use $(MF_FILES) here,
9 # because there are more .mf files, input'ed into the main files. 9 # because there are more .mf files, input'ed into the main files.
10 FETA_MF_FILES = $(call src-wildcard,feta[0-9]*.mf) \ 10 FETA_MF_FILES = $(call src-wildcard,feta[0-9]*.mf) \
11 $(call src-wildcard,feta-braces-[a-z].mf) \ 11 $(call src-wildcard,feta-braces-[a-z].mf) \
12 $(call src-wildcard,feta-alphabet*[0-9].mf) \ 12 $(call src-wildcard,feta-alphabet*[0-9].mf) \
13 $(call src-wildcard,feta-noteheads*[0-9].mf) \ 13 $(call src-wildcard,feta-noteheads*[0-9].mf) \
14 $(call src-wildcard,feta-flags*[0-9].mf) \ 14 $(call src-wildcard,feta-flags*[0-9].mf) \
15 $(call src-wildcard,parmesan[0-9]*.mf) \ 15 $(call src-wildcard,parmesan[0-9]*.mf) \
16 $(call src-wildcard,parmesan-noteheads*[0-9].mf) 16 $(call src-wildcard,parmesan-noteheads*[0-9].mf)
17 FETA_FONTS = $(FETA_MF_FILES:.mf=) 17 FETA_FONTS = $(FETA_MF_FILES:.mf=)
18 ALL_FONTS = $(FETA_FONTS) 18 ALL_FONTS = $(FETA_FONTS)
19 PFB_FILES = $(ALL_FONTS:%=$(outdir)/%.pfb) 19 PFB_FILES = $(ALL_FONTS:%=$(outdir)/%.pfb)
20 20
21 include $(depth)/make/stepmake.make 21 include $(depth)/make/stepmake.make
22 22
23 # Don't remove $(outdir)/.log's. Logs are a target! 23 # Don't remove $(outdir)/.log's. Logs are a target!
24 # we want to see botched results as well. 24 # we want to see botched results as well.
25 # TODO: use the dependency scanning from invoke-mf2pt1.sh here too.
25 $(outdir)/%.dvi: %.mf 26 $(outdir)/%.dvi: %.mf
26 $(call ly_progress,Making,$@,< mf) 27 $(call ly_progress,Making,$@,< mf)
27 » -$(DO_MF_DEP) \ 28 » MFINPUTS=$(src-dir) \
28 » MFINPUTS=$(src-dir) \
29 max_print_line=1000 \ 29 max_print_line=1000 \
30 $(METAFONT) "\scrollmode; input $<;" $(METAFONT_QUIET) 30 $(METAFONT) "\scrollmode; input $<;" $(METAFONT_QUIET)
31 gftodvi $(basename $<) 31 gftodvi $(basename $<)
32 mv $(basename $<).dvi $(outdir) 32 mv $(basename $<).dvi $(outdir)
33 rm $(basename $<).*gf 33 rm $(basename $<).*gf
34 34
35 $(outdir)/%.pfb: %.mf $(outdir)/mf2pt1.mem 35 $(outdir)/%.tfm $(outdir)/%.log $(outdir)/%.pfb: %.mf $(outdir)/mf2pt1.mem invok e-mf2pt1.sh
36 » $(call ly_progress,Making,$@,< mf) 36 » $(call ly_progress,Making,$(outdir)/$*.pfb,< mf)
37 » $(DO_MF_DEP) $(src-dir)/invoke-mf2pt.sh $(buildscript-dir)/mf2pt1 $< $@ $(METAFONT_QUIET) 37 » $(src-dir)/invoke-mf2pt1.sh $(buildscript-dir)/mf2pt1 $< $(outdir)/$*.pf b $(METAFONT_QUIET)
38
39 $(outdir)/%.tfm $(outdir)/%.log: $(outdir)/%.pfb
40 » $(UPDATE_TARGET)
41
42 38
43 # since recent mpost versions no longer create a mem file, we create a dummy 39 # since recent mpost versions no longer create a mem file, we create a dummy
44 # file to satisfy the dependency (which gets overwritten in case an older 40 # file to satisfy the dependency (which gets overwritten in case an older
45 # mpost creates a real mem file) 41 # mpost creates a real mem file)
46 $(outdir)/mf2pt1.mem: mf2pt1.mp 42 $(outdir)/mf2pt1.mem: mf2pt1.mp
47 $(call ly_progress,Making,$@,< mp) 43 $(call ly_progress,Making,$@,< mp)
48 cd $(outdir) \ 44 cd $(outdir) \
49 && touch mf2pt1.mem \ 45 && touch mf2pt1.mem \
50 && mpost -progname=mpost -ini $(top-src-dir)/mf/mf2pt1.mp \\dump $(ME TAFONT_QUIET) 46 && mpost -progname=mpost -ini $(top-src-dir)/mf/mf2pt1.mp \\dump $(ME TAFONT_QUIET)
51 47
52 ifndef VERBOSE 48 ifndef VERBOSE
53 METAFONT_QUIET = >/dev/null 49 METAFONT_QUIET = >/dev/null
54 else 50 else
55 METAFONT_QUIET = 51 METAFONT_QUIET =
56 endif 52 endif
57 53
58 # Find dependencies for the target $@, based on the metafont source file $<,
59 # and write the dependencies to a .dep file. We cannot strip the extension of $@ ,
60 # because we have multiple rules generating .dep files.
61 DO_MF_DEP = ( $(PYTHON) $(src-dir)/scan-mf-deps.py \
62 --target=$@ --include= --include=$(src-dir) --include=$(top-src-dir)/mf \
63 --include=$(outdir) $< > $@.dep ) &&
64
65 EXTRA_DIST_FILES += README mf2pt1.mp invoke-mf2pt.sh scan-mf-deps.py
66
67 STAFF_SIZES = 11 13 14 16 18 20 23 26
68 BRACES = a b c d e f g h i
69
70 OTF_FILES = $(STAFF_SIZES:%=$(outdir)/emmentaler-%.otf) \
71 $(outdir)/emmentaler-brace.otf
72 OTF_TABLES = $(STAFF_SIZES:%=$(outdir)/feta%.otf-table) \
73 $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
74 SVG_FILES = $(OTF_FILES:%.otf=%.svg)
75 WOFF_FILES = $(OTF_FILES:%.otf=%.woff)
76
77 TEXGYRE_OTFS = $(addprefix $(TEXGYRE_DIR)/,$(TEXGYRE_FILES))
78 URWOTF_OTFS = $(addprefix $(URWOTF_DIR)/,$(URWOTF_FILES))
79
80 LILYPOND_FONTS_CONF = $(outdir)/00-lilypond-fonts.conf \
81 $(outdir)/99-lilypond-fonts.conf
82
83 LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log)
84 LISP_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.lisp)
85
86 $(outdir)/emmentaler-brace.otf-gtable: $(BRACES:%=$(outdir)/feta-braces-%.otf-gt able)
87 $(call ly_progress,Making,$@,)
88 echo '(design_size . 20)' > $@
89
90 $(outdir)/feta%.otf-table: $(outdir)/feta%.lisp $(outdir)/parmesan%.lisp \
91 $(outdir)/parmesan-noteheads%.lisp \
92 $(outdir)/feta-noteheads%.lisp \
93 $(outdir)/feta-flags%.lisp \
94 $(outdir)/feta-alphabet%.lisp
95 $(call ly_progress,Making,$@,< lisp)
96 cat $^ > $@
97
98 $(outdir)/emmentaler-brace.otf-table: $(foreach x, a b c d e f g h i,$(outdir)/f eta-braces-$(x).lisp)
99 $(call ly_progress,Making,$@,< lisp)
100 cat $^ > $@
101
102 $(outdir)/emmentaler-brace.otf: $(outdir)/emmentaler-brace.subfonts \
103 $(outdir)/emmentaler-brace.fontname \
104 $(outdir)/emmentaler-brace.otf-table \
105 $(outdir)/emmentaler-brace.otf-gtable \
106 $(outdir)/emmentaler-brace.pe
107
108 $(outdir)/emmentaler-brace.fontname:
109 $(call ly_progress,Making,$@,)
110 printf 'emmentaler-brace' > $@
111
112 $(outdir)/emmentaler-brace.subfonts: 54 $(outdir)/emmentaler-brace.subfonts:
113 $(call ly_progress,Making,$@,) 55 $(call ly_progress,Making,$@,)
114 echo $(subst .mf,,$(call src-wildcard,feta-braces-[a-z].mf)) > $@ 56 echo $(subst .mf,,$(call src-wildcard,feta-braces-[a-z].mf)) > $@
115 57
116 $(outdir)/emmentaler-%.genpe: $(buildscript-dir)/gen-emmentaler-scripts 58 $(outdir)/emmentaler-%.genpe: $(buildscript-dir)/gen-emmentaler-scripts
117 $(call ly_progress,Making,$@,) 59 $(call ly_progress,Making,$@,)
118 $< --dir=$(outdir) --design-size=$(patsubst emmentaler-%.genpe,%,$(notdi r $@)) 60 $< --dir=$(outdir) --design-size=$(patsubst emmentaler-%.genpe,%,$(notdi r $@))
119 61
120 ALL_GEN_FILES = $(ENC_FILES) \ 62
121 » » $(OTF_FILES) \ 63 EXTRA_DIST_FILES += README mf2pt1.mp invoke-mf2pt.sh
64
65 STAFF_SIZES = 11 13 14 16 18 20 23 26
66 BRACES = a b c d e f g h i
67
68 OTF_FILES = $(STAFF_SIZES:%=$(outdir)/emmentaler-%.otf) \
69 $(outdir)/emmentaler-brace.otf
70 SVG_FILES = $(OTF_FILES:%.otf=%.svg)
71 WOFF_FILES = $(OTF_FILES:%.otf=%.woff)
72
73 TEXGYRE_OTFS = $(addprefix $(TEXGYRE_DIR)/,$(TEXGYRE_FILES))
74 URWOTF_OTFS = $(addprefix $(URWOTF_DIR)/,$(URWOTF_FILES))
75
76 LILYPOND_FONTS_CONF = $(outdir)/00-lilypond-fonts.conf \
77 $(outdir)/99-lilypond-fonts.conf
78
79 ALL_GEN_FILES = $(OTF_FILES) \
122 $(SVG_FILES) \ 80 $(SVG_FILES) \
123 $(WOFF_FILES) \ 81 $(WOFF_FILES) \
124 $(LILYPOND_FONTS_CONF) 82 $(LILYPOND_FONTS_CONF)
125 83
126 INSTALLATION_DIR = $(local_lilypond_datadir)/fonts/source 84 INSTALLATION_DIR = $(local_lilypond_datadir)/fonts/source
127 INSTALLATION_FILES = $(call src-wildcard,*.mf) 85 INSTALLATION_FILES = $(call src-wildcard,*.mf)
128 86
129 INSTALLATION_OUT_SUFFIXES = 1 2 3 87 INSTALLATION_OUT_SUFFIXES = 1 2 3
130 88
131 INSTALLATION_OUT_DIR1 = $(local_lilypond_datadir)/fonts/otf 89 INSTALLATION_OUT_DIR1 = $(local_lilypond_datadir)/fonts/otf
132 INSTALLATION_OUT_FILES1 = $(OTF_FILES) \ 90 INSTALLATION_OUT_FILES1 = $(OTF_FILES) \
133 $(TEXGYRE_OTFS) \ 91 $(TEXGYRE_OTFS) \
134 $(URWOTF_OTFS) 92 $(URWOTF_OTFS)
135 93
136 INSTALLATION_OUT_DIR2 = $(local_lilypond_datadir)/fonts/svg 94 INSTALLATION_OUT_DIR2 = $(local_lilypond_datadir)/fonts/svg
137 INSTALLATION_OUT_FILES2 = $(SVG_FILES) $(WOFF_FILES) 95 INSTALLATION_OUT_FILES2 = $(SVG_FILES) $(WOFF_FILES)
138 96
139 INSTALLATION_OUT_DIR3 = $(local_lilypond_datadir)/fonts 97 INSTALLATION_OUT_DIR3 = $(local_lilypond_datadir)/fonts
140 INSTALLATION_OUT_FILES3 = $(LILYPOND_FONTS_CONF) 98 INSTALLATION_OUT_FILES3 = $(LILYPOND_FONTS_CONF)
141 99
142 # A few rules here generate multiple files from one command line. For 100
143 # treating this case, we only declare one output explicitly, and use a 101 $(outdir)/emmentaler-brace.otf-gtable: $(BRACES:%=$(outdir)/feta-braces-%.otf-gt able)
144 # dummy rules for the other outputs. The dummy rule uses 102 » $(call ly_progress,Making,$@,)
145 # $(UPDATE_TARGET) so the order of writing in the real command does 103 » echo '(design_size . 20)' > $@
146 # not confuse make. 104
147 UPDATE_TARGET = if test -f $@; then touch $@ ; fi 105 $(outdir)/feta%.otf-table: $(outdir)/feta%.lisp $(outdir)/parmesan%.lisp \
106 » $(outdir)/parmesan-noteheads%.lisp \
107 » $(outdir)/feta-noteheads%.lisp \
108 » $(outdir)/feta-flags%.lisp \
109 » $(outdir)/feta-alphabet%.lisp
110 » $(call ly_progress,Making,$@,< lisp)
111 » cat $^ > $@
112
113 $(outdir)/emmentaler-brace.otf-table: $(foreach x, a b c d e f g h i,$(outdir)/f eta-braces-$(x).lisp)
114 » $(call ly_progress,Making,$@,< lisp)
115 » cat $^ > $@
148 116
149 # only for fonts which 117 # only for fonts which
150 # 118 #
151 # 1. are mentioned in font.scm 119 # 1. are mentioned in font.scm
152 # 120 #
153 # 2. are not included with teTeX 121 # 2. are not included with teTeX
154 # 122 #
155 $(outdir)/%.lisp: $(outdir)/%.log $(outdir)/%.tfm 123 $(outdir)/%.otf-gtable $(outdir)/%.enc $(outdir)/%.lisp: $(outdir)/%.log $(outdi r)/%.tfm
156 » $(call ly_progress,Making,$@,< log) 124 » $(call ly_progress,Making,$(outdir)/$*.lisp,< log)
157 $(buildscript-dir)/mf-to-table \ 125 $(buildscript-dir)/mf-to-table \
158 --global-lisp=$(outdir)/$(<F:.log=.otf-gtable) \ 126 --global-lisp=$(outdir)/$(<F:.log=.otf-gtable) \
159 --lisp=$(outdir)/$(<F:.log=.lisp) \ 127 --lisp=$(outdir)/$(<F:.log=.lisp) \
160 --outdir=$(outdir) \ 128 --outdir=$(outdir) \
161 --enc $(outdir)/$(<F:.log=.enc) \ 129 --enc $(outdir)/$(<F:.log=.enc) \
162 $< 130 $<
163 131
164 $(outdir)/%.otf-gtable $(outdir)/%.enc: $(outdir)/%.lisp 132 $(outdir)/emmentaler-%.svg $(outdir)/emmentaler-%.woff $(outdir)/emmentaler-%.ot f: $(outdir)/emmentaler-%.genpe \
165 » $(UPDATE_TARGET)
166
167 $(outdir)/emmentaler-%.otf: $(outdir)/emmentaler-%.genpe \
168 $(outdir)/feta%.pfb \ 133 $(outdir)/feta%.pfb \
169 $(outdir)/feta-noteheads%.pfb \ 134 $(outdir)/feta-noteheads%.pfb \
170 $(outdir)/feta-flags%.pfb \ 135 $(outdir)/feta-flags%.pfb \
171 $(outdir)/feta-alphabet%.pfb \ 136 $(outdir)/feta-alphabet%.pfb \
172 $(outdir)/parmesan%.pfb \ 137 $(outdir)/parmesan%.pfb \
173 $(outdir)/parmesan-noteheads%.pfb \ 138 $(outdir)/parmesan-noteheads%.pfb \
174 $(outdir)/feta%.otf-table \ 139 $(outdir)/feta%.otf-table \
175 $(outdir)/feta%.otf-gtable 140 $(outdir)/feta%.otf-gtable
176 » $(call ly_progress,Making,$@,) 141 » $(call ly_progress,Making,$(outdir)/emmentaler-$*.otf,)
177 cd $(outdir) && $(FONTFORGE) -script $(notdir $<) 142 cd $(outdir) && $(FONTFORGE) -script $(notdir $<)
178 143
179 $(outdir)/emmentaler-%.svg $(outdir)/emmentaler-%.woff: $(outdir)/emmentaler-%.o tf 144 $(outdir)/emmentaler-brace.svg $(outdir)/emmentaler-brace.woff $(outdir)/emmenta ler-brace.otf: $(outdir)/emmentaler-brace.pe\
180 » $(UPDATE_TARGET)
181
182 $(outdir)/emmentaler-brace.otf: $(outdir)/emmentaler-brace.pe\
183 $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).pfb) \ 145 $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).pfb) \
184 » » $(outdir)/emmentaler-brace.otf-table $(outdir)/emmentaler -brace.otf-gtable 146 » » $(outdir)/emmentaler-brace.otf-table \
185 » $(call ly_progress,Making,$@,) 147 » » » $(outdir)/emmentaler-brace.otf-gtable \
148 » » » $(outdir)/emmentaler-brace.subfonts
149 » $(call ly_progress,Making,$(outdir)/emmentaler-brace.otf,)
186 cd $(outdir) && $(FONTFORGE) -script emmentaler-brace.pe 150 cd $(outdir) && $(FONTFORGE) -script emmentaler-brace.pe
187
188 $(outdir)/emmentaler-brace.svg $(outdir)/emmentaler-brace.woff: $(outdir)/emment aler-brace.otf
189 $(UPDATE_TARGET)
190 151
191 default: tree-regen \ 152 default: tree-regen \
192 $(outdir)/fonts.conf 153 $(outdir)/fonts.conf
193 154
194 .PHONY: tree-regen 155 .PHONY: tree-regen
195 156
196 tree-regen: $(ALL_GEN_FILES) 157 tree-regen: $(ALL_GEN_FILES)
197 ${MAKE} -C $(top-build-dir) link-mf-tree 158 ${MAKE} -C $(top-build-dir) link-mf-tree
198 159
199
200 local-clean:
201 rm -f mfplain.mem mfplain.log
202 rm -f *.tfm *.log
203
204
205 $(outdir)/fonts.conf: 160 $(outdir)/fonts.conf:
206 $(call ly_progress,Making,$@,) 161 $(call ly_progress,Making,$@,)
207 echo '<fontconfig><dir>'$(shell cd $(outdir); pwd)'</dir></fontconfig>' > $@ 162 echo '<fontconfig><dir>'$(shell cd $(outdir); pwd)'</dir></fontconfig>' > $@
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b