]> git.donarmstrong.com Git - lilypond.git/blob - mf/GNUmakefile
* scm/auto-beam.scm (score-override-auto-beam-setting): New function.
[lilypond.git] / mf / GNUmakefile
1 depth = ..
2
3 STEPMAKE_TEMPLATES=metafont install install-out
4
5 include $(depth)/make/stepmake.make 
6
7 AF_FILES = $(wildcard *.af) 
8
9 EXTRA_DIST_FILES += README feta.tex
10
11 # We don't use $(MF_FILES), because there's more .mf cruft here
12 FETA_MF_FILES = $(wildcard feta[0-9]*.mf)\
13         $(wildcard feta-braces-[a-z].mf)\
14         $(wildcard feta-alphabet*[0-9].mf)\
15         $(wildcard parmesan[0-9]*.mf)
16
17 STAFF_SIZES = 11 13 14 16 18 20 23 26
18 BRACES = a b c d e f g h i
19
20 OTF_FILES = $(addsuffix .otf, $(addprefix $(outdir)/emmentaler, $(STAFF_SIZES)))\
21  $(outdir)/aybabtu.otf
22 PE_SCRIPTS = $(addsuffix .pe, $(addprefix $(outdir)/emmentaler, $(STAFF_SIZES))) \
23   $(addsuffix .dep, $(addprefix $(outdir)/emmentaler, $(STAFF_SIZES))) 
24 OTF_TABLES = $(addsuffix .otf-table, $(addprefix $(outdir)/feta, $(STAFF_SIZES))) \
25  $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
26 FETA_FONTS = $(FETA_MF_FILES:.mf=)
27 SVG_FILES = $(OTF_FILES:%.otf=%.svg) $(ALL_FONTS:%=$(outdir)/%.svg)
28 CFF_FILES = $(OTF_FILES:%.otf=%.cff) $(ALL_FONTS:%=$(outdir)/%.cff)
29
30
31 $(outdir)/aybabtu.otf-table: $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
32         cat $^ > $@
33
34 $(outdir)/aybabtu.otf-gtable: $(BRACES:%=$(outdir)/feta-braces-%.otf-gtable)
35         echo '(design_size . 20)' > $@
36
37 LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log)
38 LISP_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.lisp)
39 TEXTABLES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tex)
40 ENC_FILES = $(TEXTABLES:.tex=.enc) $(outdir)/cmr.enc
41 TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm) $(addprefix $(outdir)/,$(addsuffix .tfm,$(SAUTER_FONTS)))
42 FETA_LIST_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%list.ly)
43
44
45 ENCODING_FILE=$(findstring $(<:.mf=.enc), $(FETA_MF_FILES:.mf=.enc))
46 MFTRACE_FLAGS=$(if $(ENCODING_FILE),--encoding $(ENCODING_FILE),)
47
48 # only for fonts which
49 #
50 # 1. are mentioned in font.scm
51 #
52 # 2. are not included with teTeX
53 #
54
55 foe:
56         echo $(MFINPUTS)
57         echo $(TEXMF)
58         kpsewhich exbase.mf
59
60 $(outdir)/%.cff $(outdir)/%.otf $(outdir)/%.svg: $(outdir)/%.pe
61         (cd $(outdir) && fontforge -script $(notdir $<)) 
62
63 $(outdir)/%.otf-table: $(outdir)/%.lisp $(if $(findstring brace,$<),,$(subst feta,parmesan,$<)) 
64         cat $< \
65                 $(if $(findstring brace,$<),,$(subst feta,parmesan,$<)) \
66                 $(if $(findstring brace,$<),,$(subst feta,feta-alphabet,$<)) > $@
67
68 $(outdir)/aybabtu.otf: $(outdir)/aybabtu.subfonts $(outdir)/aybabtu.otf-table $(outdir)/aybabtu.otf-gtable
69
70 $(outdir)/aybabtu.subfonts: 
71          echo $(subst .mf,,$(wildcard feta-braces-[a-z].mf)) > $@
72
73 $(PE_SCRIPTS): $(buildscript-dir)/gen-emmentaler-scripts.py
74         $(PYTHON) $< --dir=$(outdir)
75
76
77 ALL_FONTS = $(FETA_FONTS) $(SAUTER_FONTS)
78 PFA_FILES = $(ALL_FONTS:%=$(outdir)/%.pfa)
79
80 # Make tfm files first, log files last, 
81 # so that normally log files aren't made twice
82 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)
83
84 #PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
85 INSTALLATION_DIR=$(local_lilypond_datadir)/fonts/source
86 INSTALLATION_FILES=$(MF_FILES) $(AF_FILES)
87
88 INSTALLATION_OUT_SUFFIXES=1 2 3 4 5 6 7 8 9
89
90 INSTALLATION_OUT_DIR1=$(local_lilypond_datadir)/tex
91 INSTALLATION_OUT_FILES1=$(TEXTABLES)
92
93 # must not be installed with .cff, pango/fontconfig does not like .cff fonts 
94 INSTALLATION_OUT_DIR2=$(local_lilypond_datadir)/otf
95 INSTALLATION_OUT_FILES2=$(OTF_FILES)
96
97 INSTALLATION_OUT_DIR3=$(local_lilypond_datadir)/fonts/tfm
98 INSTALLATION_OUT_FILES3=$(TFM_FILES)
99
100 INSTALLATION_OUT_DIR4=$(local_lilypond_datadir)/ly
101 INSTALLATION_OUT_FILES4=$(FETA_LIST_FILES)
102
103 INSTALLATION_OUT_DIR5=$(local_lilypond_datadir)/fonts/type1
104 INSTALLATION_OUT_FILES5=$(PFA_FILES)
105
106 INSTALLATION_OUT_DIR6=$(local_lilypond_datadir)/dvips/
107 INSTALLATION_OUT_FILES6=$(outdir)/lilypond.map
108
109 INSTALLATION_OUT_DIR7=$(local_lilypond_datadir)/ps/
110 INSTALLATION_OUT_FILES7=$(ENC_FILES)
111
112 # install in fonts/cff or ps/ directory?
113 INSTALLATION_OUT_DIR8=$(local_lilypond_datadir)/cff
114 INSTALLATION_OUT_FILES8=$(CFF_FILES)
115
116 INSTALLATION_OUT_DIR9=$(local_lilypond_datadir)/svg
117 INSTALLATION_OUT_FILES9=$(SVG_FILES)
118
119
120 export MFINPUTS:=.:$(MFINPUTS)
121
122 default: pfa_warning $(ALL_GEN_FILES) $(outdir)/emmentaler20.otf
123
124 pfa_warning:
125 ifneq ($(shell $(MFTRACE) --version | sed 's/ .*//'),mftrace)
126         @echo ""
127         @echo "ERROR: mftrace not found"
128         @echo ""
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: "
132         @echo ""
133         @echo " make get-pfa "
134         @echo " make get-rpm-pfa "
135         @echo " make get-deb-pfa "
136         @echo ""
137         @echo "These commands will try to download the files from internet."
138         @false
139 endif
140
141
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)
146
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)/
152
153
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)
157
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)/
162
163 # change this dependency 
164 get-pfa: get-rpm-pfa
165
166
167 ##
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) $<
171
172 fontdir: $(addprefix $(outdir)/, lilypond.map lilypond.sfd private-fonts fonts.scale fonts.dir Fontmap.lily)
173
174
175 $(outdir)/lilypond.map: $(AFM_FILES)
176         for i in $(FETA_FONTS); do echo $$i $$i '<'$$i.pfa; done > $@
177
178
179 local-clean:
180         rm -f mfplain.mem mfplain.log 
181         rm -f *.tfm *.log
182
183 $(outdir)/%.enc.in: %.enc
184         cp $< $@