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

Delta Between Two Patch Sets: mf/GNUmakefile

Issue 553580043: mf: use python scripting for generating Emmentaler fonts (Closed)
Left Patch Set: fix Created 4 years ago
Right Patch Set: remove grouped rule Created 3 years, 12 months 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/README » ('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 = metafont 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!
24 # we want to see botched results as well.
25 # TODO: use the dependency scanning from invoke-mf2pt1.sh here too.
26 $(outdir)/%.dvi: %.mf
27 $(call ly_progress,Making,$@,< mf)
28 MFINPUTS=$(src-dir) \
29 max_print_line=1000 \
30 $(METAFONT) "\scrollmode; input $<;" $(METAFONT_QUIET)
31 gftodvi $(basename $<)
32 mv $(basename $<).dvi $(outdir)
33 rm $(basename $<).*gf
23 34
24 EXTRA_DIST_FILES += README mf2pt1.mp 35 $(outdir)/%.tfm $(outdir)/%.log $(outdir)/%.pfb: %.mf $(outdir)/mf2pt1.mem invok e-mf2pt1.sh
36 » $(call ly_progress,Making,$(outdir)/$*.pfb,< mf)
37 » $(src-dir)/invoke-mf2pt1.sh $(buildscript-dir)/mf2pt1 $< $(outdir)/$*.pf b $(METAFONT_QUIET)
38
39 # since recent mpost versions no longer create a mem file, we create a dummy
40 # file to satisfy the dependency (which gets overwritten in case an older
41 # mpost creates a real mem file)
42 $(outdir)/mf2pt1.mem: mf2pt1.mp
43 » $(call ly_progress,Making,$@,< mp)
44 » cd $(outdir) \
45 » && touch mf2pt1.mem \
46 » && mpost -progname=mpost -ini $(top-src-dir)/mf/mf2pt1.mp \\dump $(ME TAFONT_QUIET)
47
48 ifndef VERBOSE
49 METAFONT_QUIET = >/dev/null
50 else
51 METAFONT_QUIET =
52 endif
53
54 $(outdir)/emmentaler-brace.subfonts:
55 » $(call ly_progress,Making,$@,)
56 » echo $(subst .mf,,$(call src-wildcard,feta-braces-[a-z].mf)) > $@
57
58 $(outdir)/emmentaler-%.genpe: $(buildscript-dir)/gen-emmentaler-scripts
59 » $(call ly_progress,Making,$@,)
60 » $< --dir=$(outdir) --design-size=$(patsubst emmentaler-%.genpe,%,$(notdi r $@))
61
62
63 EXTRA_DIST_FILES += README mf2pt1.mp invoke-mf2pt.sh
25 64
26 STAFF_SIZES = 11 13 14 16 18 20 23 26 65 STAFF_SIZES = 11 13 14 16 18 20 23 26
27 BRACES = a b c d e f g h i 66 BRACES = a b c d e f g h i
28 67
29 OTF_FILES = $(STAFF_SIZES:%=$(outdir)/emmentaler-%.otf) \ 68 OTF_FILES = $(STAFF_SIZES:%=$(outdir)/emmentaler-%.otf) \
30 » $(outdir)/emmentaler-brace.otf 69 $(outdir)/emmentaler-brace.otf
31 OTF_TABLES = $(STAFF_SIZES:%=$(outdir)/feta%.otf-table) \
32 » $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
33 SVG_FILES = $(OTF_FILES:%.otf=%.svg) 70 SVG_FILES = $(OTF_FILES:%.otf=%.svg)
34 WOFF_FILES = $(OTF_FILES:%.otf=%.woff) 71 WOFF_FILES = $(OTF_FILES:%.otf=%.woff)
35 72
36 TEXGYRE_OTFS = $(addprefix $(TEXGYRE_DIR)/,$(TEXGYRE_FILES)) 73 TEXGYRE_OTFS = $(addprefix $(TEXGYRE_DIR)/,$(TEXGYRE_FILES))
37 URWOTF_OTFS = $(addprefix $(URWOTF_DIR)/,$(URWOTF_FILES)) 74 URWOTF_OTFS = $(addprefix $(URWOTF_DIR)/,$(URWOTF_FILES))
38 75
39 LILYPOND_FONTS_CONF = $(outdir)/00-lilypond-fonts.conf \ 76 LILYPOND_FONTS_CONF = $(outdir)/00-lilypond-fonts.conf \
40 $(outdir)/99-lilypond-fonts.conf 77 $(outdir)/99-lilypond-fonts.conf
41 78
42 LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log) 79 LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log)
43 LISP_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.lisp)
44 TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm)
45 80
46 ALL_GEN_FILES = $(OTF_FILES) \ 81 ALL_GEN_FILES = $(OTF_FILES) \
47 $(SVG_FILES) \ 82 $(SVG_FILES) \
48 $(WOFF_FILES) \ 83 $(WOFF_FILES) \
49 $(LILYPOND_FONTS_CONF) 84 $(LILYPOND_FONTS_CONF)
50 85
51 # PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
52
53 INSTALLATION_DIR = $(local_lilypond_datadir)/fonts/source 86 INSTALLATION_DIR = $(local_lilypond_datadir)/fonts/source
54 INSTALLATION_FILES = $(MF_FILES) 87 INSTALLATION_FILES = $(call src-wildcard,*.mf)
55 88
56 INSTALLATION_OUT_SUFFIXES = 1 2 3 89 INSTALLATION_OUT_SUFFIXES = 1 2 3
57 90
58 INSTALLATION_OUT_DIR1 = $(local_lilypond_datadir)/fonts/otf 91 INSTALLATION_OUT_DIR1 = $(local_lilypond_datadir)/fonts/otf
59 INSTALLATION_OUT_FILES1 = $(OTF_FILES) \ 92 INSTALLATION_OUT_FILES1 = $(OTF_FILES) \
60 $(TEXGYRE_OTFS) \ 93 $(TEXGYRE_OTFS) \
61 $(URWOTF_OTFS) 94 $(URWOTF_OTFS)
62 95
63 INSTALLATION_OUT_DIR2 = $(local_lilypond_datadir)/fonts/svg 96 INSTALLATION_OUT_DIR2 = $(local_lilypond_datadir)/fonts/svg
64 INSTALLATION_OUT_FILES2 = $(SVG_FILES) $(WOFF_FILES) 97 INSTALLATION_OUT_FILES2 = $(SVG_FILES) $(WOFF_FILES)
65 98
66 INSTALLATION_OUT_DIR3 = $(local_lilypond_datadir)/fonts 99 INSTALLATION_OUT_DIR3 = $(local_lilypond_datadir)/fonts
67 INSTALLATION_OUT_FILES3 = $(LILYPOND_FONTS_CONF) 100 INSTALLATION_OUT_FILES3 = $(LILYPOND_FONTS_CONF)
68 101
69 export MFINPUTS := .:$(MFINPUTS)
70
71 # A few rules here generate multiple files from one command line. For
72 # treating this case, we only declare one output explicitly, and use a
73 # dummy rules for the other outputs. The dummy rule uses
74 # $(UPDATE_TARGET) so the order of writing in the real command does
75 # not confuse make.
76 UPDATE_TARGET = if test -f $@; then touch $@ ; fi
77
78 102
79 # only for fonts which 103 # only for fonts which
80 # 104 #
81 # 1. are mentioned in font.scm 105 # 1. are mentioned in font.scm
82 # 106 #
83 # 2. are not included with teTeX 107 # 2. are not included with teTeX
84 # 108 #
85 $(outdir)/%.lisp: $(outdir)/%.log $(outdir)/%.tfm 109 $(outdir)/%.global-lisp $(outdir)/%.lisp: $(outdir)/%.log $(outdir)/%.tfm
86 » $(call ly_progress,Making,$@,< log) 110 » $(call ly_progress,Making,$(outdir)/$*.lisp,< log)
87 $(buildscript-dir)/mf-to-table \ 111 $(buildscript-dir)/mf-to-table \
88 --global-lisp=$(outdir)/$(<F:.log=.global-lisp) \ 112 --global-lisp=$(outdir)/$(<F:.log=.global-lisp) \
89 --lisp=$(outdir)/$(<F:.log=.lisp) \ 113 --lisp=$(outdir)/$(<F:.log=.lisp) \
90 --outdir=$(outdir) \
91 $< 114 $<
92 115
93 $(outdir)/%.global-lisp: $(outdir)/%.lisp 116 $(outdir)/emmentaler-%.svg $(outdir)/emmentaler-%.woff $(outdir)/emmentaler-%.ot f: gen-emmentaler.fontforge.py\
94 » $(UPDATE_TARGET) 117 » » » $(outdir)/feta%.pfb \
95
96 $(outdir)/emmentaler-%.otf: gen-emmentaler.fontforge.py $(outdir)/feta%.pfb \
97 $(outdir)/feta-noteheads%.pfb \ 118 $(outdir)/feta-noteheads%.pfb \
98 $(outdir)/feta-flags%.pfb \ 119 $(outdir)/feta-flags%.pfb \
99 $(outdir)/feta-alphabet%.pfb \ 120 $(outdir)/feta-alphabet%.pfb \
100 $(outdir)/parmesan%.pfb \ 121 $(outdir)/parmesan%.pfb \
101 $(outdir)/parmesan-noteheads%.pfb \ 122 $(outdir)/parmesan-noteheads%.pfb \
102 $(outdir)/feta%.lisp \ 123 $(outdir)/feta%.lisp \
103 $(outdir)/feta-noteheads%.lisp \ 124 $(outdir)/feta-noteheads%.lisp \
104 $(outdir)/feta-flags%.lisp \ 125 $(outdir)/feta-flags%.lisp \
105 $(outdir)/feta-alphabet%.lisp \ 126 $(outdir)/feta-alphabet%.lisp \
106 $(outdir)/parmesan%.lisp \ 127 $(outdir)/parmesan%.lisp \
107 $(outdir)/parmesan-noteheads%.lisp \ 128 $(outdir)/parmesan-noteheads%.lisp \
108 $(outdir)/feta%.global-lisp 129 $(outdir)/feta%.global-lisp
109 $(call ly_progress,Making,$@,) 130 $(call ly_progress,Making,$@,)
110 » $(FONTFORGE) -lang=py -script $< --version=$(VERSION) --in $(outdir)/ -- out $@ 131 » $(FONTFORGE) -lang=py -script $< --version=$(VERSION) --in $(outdir)/ -- out $(outdir)/emmentaler-$*.otf
111 132
112 $(outdir)/emmentaler-%.svg $(outdir)/emmentaler-%.woff: $(outdir)/emmentaler-%.o tf
113 $(UPDATE_TARGET)
114 133
115 $(outdir)/emmentaler-brace.otf: gen-emmentaler-brace.fontforge.py \ 134 $(outdir)/emmentaler-brace.otf: gen-emmentaler-brace.fontforge.py \
116 $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).pfb) \ 135 $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).pfb) \
117 $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).lisp) 136 $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).lisp)
118 $(call ly_progress,Making,$@,) 137 $(call ly_progress,Making,$@,)
119 » $(FONTFORGE) -lang=py -script $< --version $(VERSION) --out=$@ --in $(ou tdir) 138 » $(FONTFORGE) -lang=py -script $< --version $(VERSION) --out=$(outdir)/em mentaler-brace.otf --in $(outdir)
139 » touch $@ $(outdir)/emmentaler-brace.woff $(outdir)/emmentaler-brace.svg
120 140
121 $(outdir)/emmentaler-brace.svg $(outdir)/emmentaler-brace.woff: $(outdir)/emment aler-brace.otf 141 $(outdir)/emmentaler-brace.woff $(outdir)/emmentaler-brace.svg: $(outdir)/emment aler-brace.otf
122 » $(UPDATE_TARGET) 142 » @true
123 143
124 default: tree-regen \ 144 default: tree-regen $(outdir)/fonts.conf
125 » $(outdir)/fonts.conf
126 145
127 .PHONY: tree-regen 146 .PHONY: tree-regen
128 147
129 tree-regen: $(ALL_GEN_FILES) 148 tree-regen: $(ALL_GEN_FILES)
130 ${MAKE} -C $(top-build-dir) link-mf-tree 149 ${MAKE} -C $(top-build-dir) link-mf-tree
131 150
132 local-clean:
133 rm -f mfplain.mem mfplain.log
134 rm -f *.tfm *.log
135
136 $(outdir)/fonts.conf: 151 $(outdir)/fonts.conf:
137 $(call ly_progress,Making,$@,) 152 $(call ly_progress,Making,$@,)
138 echo '<fontconfig><dir>'$(shell cd $(outdir); pwd)'</dir></fontconfig>' > $@ 153 echo '<fontconfig><dir>'$(shell cd $(outdir); pwd)'</dir></fontconfig>' > $@
LEFTRIGHT
« no previous file | mf/README » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

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