3 STEPMAKE_TEMPLATES=metafont install install-out
4 LOCALSTEPMAKE_TEMPLATES=lilypond
6 include $(depth)/make/stepmake.make
8 AF_FILES = $(wildcard *.af)
10 EXTRA_DIST_FILES += README feta.tex
12 # We don't use $(MF_FILES), because there's more .mf cruft here
13 FETA_MF_FILES = $(wildcard feta[0-9]*.mf)\
14 $(wildcard feta-braces-[a-z].mf)\
15 $(wildcard feta-alphabet*[0-9].mf)\
16 $(wildcard parmesan[0-9]*.mf)
18 STAFF_SIZES = 11 13 14 16 18 20 23 26
19 BRACES = a b c d e f g h i
21 OTF_FILES = $(addsuffix .otf, $(addprefix $(outdir)/emmentaler-, $(STAFF_SIZES)))\
23 PE_SCRIPTS = $(addsuffix .pe, $(addprefix $(outdir)/emmentaler-, $(STAFF_SIZES))) \
24 $(addsuffix .dep, $(addprefix $(outdir)/emmentaler-, $(STAFF_SIZES)))
25 OTF_TABLES = $(addsuffix .otf-table, $(addprefix $(outdir)/feta, $(STAFF_SIZES))) \
26 $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
27 FETA_FONTS = $(FETA_MF_FILES:.mf=)
28 SVG_FILES = $(OTF_FILES:%.otf=%.svg) $(ALL_FONTS:%=$(outdir)/%.svg)
29 CFF_FILES = $(OTF_FILES:%.otf=%.cff)
30 CFF_PS_FILES = $(OTF_FILES:%.otf=%.cff.ps)
33 $(outdir)/aybabtu.otf-table: $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
36 $(outdir)/aybabtu.otf-gtable: $(BRACES:%=$(outdir)/feta-braces-%.otf-gtable)
37 echo '(design_size . 20)' > $@
39 LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log)
40 LISP_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.lisp)
41 TEXTABLES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tex)
42 ENC_FILES = $(TEXTABLES:.tex=.enc) $(outdir)/cmr.enc
43 TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm) $(addprefix $(outdir)/,$(addsuffix .tfm,$(SAUTER_FONTS)))
44 FETA_LIST_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%list.ly)
47 ENCODING_FILE=$(findstring $(<:.mf=.enc), $(FETA_MF_FILES:.mf=.enc))
48 MFTRACE_FLAGS=$(if $(ENCODING_FILE),--encoding $(ENCODING_FILE),) --no-afm
50 # only for fonts which
52 # 1. are mentioned in font.scm
54 # 2. are not included with teTeX
57 $(outdir)/%.cff.ps $(outdir)/%.cff $(outdir)/%.otf $(outdir)/%.svg: $(outdir)/%.pe
58 (cd $(outdir) && $(FONTFORGE) -script $(notdir $<))
59 $(PYTHON) $(buildscript-dir)/ps-embed-cff.py $(basename $<).cff `cat $(basename $<).fontname` $(basename $<).cff.ps
62 $(outdir)/%.otf-table: $(outdir)/%.lisp $(if $(findstring brace,$<),,$(subst feta,parmesan,$<))
64 $(if $(findstring brace,$<),,$(subst feta,parmesan,$<)) \
65 $(if $(findstring brace,$<),,$(subst feta,feta-alphabet,$<)) > $@
67 $(outdir)/aybabtu.otf: $(outdir)/aybabtu.subfonts $(outdir)/aybabtu.fontname $(outdir)/aybabtu.otf-table $(outdir)/aybabtu.otf-gtable $(outdir)/aybabtu.pe
69 $(outdir)/aybabtu.fontname:
70 echo -n 'aybabtu' > $@
71 $(outdir)/aybabtu.subfonts:
72 echo $(subst .mf,,$(wildcard feta-braces-[a-z].mf)) > $@
74 $(PE_SCRIPTS): $(buildscript-dir)/gen-emmentaler-scripts.py
75 $(PYTHON) $< --dir=$(outdir)
78 ALL_FONTS = $(FETA_FONTS) $(SAUTER_FONTS)
79 PFA_FILES = $(ALL_FONTS:%=$(outdir)/%.pfa)
81 # Make tfm files first, log files last,
82 # so that normally log files aren't made twice
83 ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(FETA_LIST_FILES) $(OTF_TABLES) $(PFA_FILES) $(outdir)/lilypond.map $(OTF_FILES) $(SVG_FILES) $(CFF_PS_FILES) $(CFF_FILES)
85 #PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
86 INSTALLATION_DIR=$(local_lilypond_datadir)/fonts/source
87 INSTALLATION_FILES=$(MF_FILES) $(AF_FILES)
89 INSTALLATION_OUT_SUFFIXES=1 2 3 4 5 6 7 8 9
91 INSTALLATION_OUT_DIR1=$(local_lilypond_datadir)/tex
92 INSTALLATION_OUT_FILES1=$(TEXTABLES)
94 # must not be installed with .cff, pango/fontconfig does not like .cff fonts
95 INSTALLATION_OUT_DIR2=$(local_lilypond_datadir)/fonts/otf
96 INSTALLATION_OUT_FILES2=$(OTF_FILES)
98 INSTALLATION_OUT_DIR3=$(local_lilypond_datadir)/fonts/tfm
99 INSTALLATION_OUT_FILES3=$(TFM_FILES)
101 INSTALLATION_OUT_DIR4=$(local_lilypond_datadir)/ps
102 INSTALLATION_OUT_FILES4=$(CFF_PS_FILES)
104 INSTALLATION_OUT_DIR5=$(local_lilypond_datadir)/fonts/type1
105 INSTALLATION_OUT_FILES5=$(PFA_FILES)
107 INSTALLATION_OUT_DIR6=$(local_lilypond_datadir)/fonts/map
108 INSTALLATION_OUT_FILES6=$(outdir)/lilypond.map
110 INSTALLATION_OUT_DIR7=$(local_lilypond_datadir)/fonts/cff/
111 INSTALLATION_OUT_FILES7=$(CFF_FILES)
113 INSTALLATION_OUT_DIR7=$(local_lilypond_datadir)/ps/
114 INSTALLATION_OUT_FILES7=$(ENC_FILES)
116 INSTALLATION_OUT_DIR9=$(local_lilypond_datadir)/fonts/svg
117 INSTALLATION_OUT_FILES9=$(SVG_FILES)
120 export MFINPUTS:=.:$(MFINPUTS)
122 default: pfa_warning $(ALL_GEN_FILES) $(outdir)/emmentaler-20.otf
125 ifneq ($(shell $(MFTRACE) --version | sed 's/ .*//'),mftrace)
127 @echo "ERROR: mftrace not found"
129 @echo "For obtaining PFA fonts, either install mftrace "
130 @echo "(see http://www.xs4all.nl/~hanwen/mftrace/ ),"
131 @echo "or try one of the following commands in this directory: "
133 @echo " make get-pfa "
134 @echo " make get-rpm-pfa "
135 @echo " make get-deb-pfa "
137 @echo "These commands will try to download the files from internet."
142 debian-mirror=http://ftp.us.debian.org
143 debian-package =lilypond_$(TOPLEVEL_VERSION)-1_i386.deb
144 $(outdir)/$(debian-package):
145 wget --passive-ftp -P $(outdir) $(debian-mirror)/debian/pool/main/l/lilypond/$(debian-package)
147 get-deb-pfa: $(outdir)/$(debian-package)
148 rm -rf $(outdir)/./usr
149 ar p $< data.tar.gz | \
150 tar -C $(outdir) -zvxf - '*.pfa'
151 cp `find $(outdir)/usr/ -name '*.pfa'` $(outdir)/
154 redhat-package=lilypond-$(TOPLEVEL_VERSION)-1.i386.rpm
155 $(outdir)/$(redhat-package):
156 wget --passive-ftp -P $(outdir) http://lilypond.org/download/binaries/Fedora-3/$(redhat-package)
158 get-rpm-pfa: $(outdir)/$(redhat-package)
159 cd $(outdir) ; rm -rf usr/ # (root alert!)
160 cd $(outdir) ; rpm2cpio $(redhat-package) | cpio -uid '*.pfa'
161 cp `find $(outdir)/usr/ -name '*.pfa'` $(outdir)/
163 # change this dependency
168 ## todo: this also depends on .tfm, FIXME.
169 $(outdir)/%.lisp $(outdir)/%.otf-gtable $(outdir)/%.enc $(outdir)/%.tex $(outdir)/%list.ly $(outdir)/%.dep: $(outdir)/%.log $(outdir)/%.tfm
170 $(PYTHON) $(buildscript-dir)/mf-to-table.py --global-lisp=$(outdir)/$(<F:.log=.otf-gtable) --lisp=$(outdir)/$(<F:.log=.lisp) --outdir=$(outdir) --dep $(outdir)/$(<F:.log=.dep) --enc $(outdir)/$(<F:.log=.enc) --tex $(outdir)/$(<F:.log=.tex) --ly $(outdir)/$(<F:.log=list.ly) $<
172 fontdir: $(addprefix $(outdir)/, lilypond.map lilypond.sfd private-fonts fonts.scale fonts.dir Fontmap.lily)
175 $(outdir)/lilypond.map: $(AFM_FILES)
176 for i in $(FETA_FONTS); do echo $$i $$i '<'$$i.pfa; done > $@
177 for i in $(STAFF_SIZES); \
178 do echo "Emmentaler-$$i Emmentaler-$$i <emmentaler-$$i.cff.ps" ; done \
180 echo "Aybabtu Aybabtu <aybabtu.cff.ps" >> $@
182 $(outdir)/Fontmap.lily:
183 for i in $(FETA_FONTS); do echo "/$$i ($$i.pfa);" ; done > $@
184 for i in $(STAFF_SIZES); \
185 do echo "/Emmentaler-$$i (emmentaler-$$i.cff.ps);" ; done \
187 echo "/Aybabtu (aybabtu.cff.ps);" >> $@
191 rm -f mfplain.mem mfplain.log
194 $(outdir)/%.enc.in: %.enc
197 # teTeX-2.0.x compatibility.
199 -$(INSTALL) -d $(DESTDIR)$(local_lilypond_datadir)/dvips
200 (cd $(DESTDIR)$(local_lilypond_datadir)/dvips && ln -sf ../fonts/map .)
203 -rm -f $(DESTDIR)$(local_lilypond_datadir)/dvips/map
204 -rmdir $(DESTDIR)$(local_lilypond_datadir)/dvips