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