]> git.donarmstrong.com Git - lilypond.git/blob - mf/GNUmakefile
Merge branch 'master' of git://git.sv.gnu.org/lilypond
[lilypond.git] / mf / GNUmakefile
1 depth = ..
2
3 STEPMAKE_TEMPLATES=metafont install install-out
4 LOCALSTEPMAKE_TEMPLATES=lilypond
5
6 include $(depth)/make/stepmake.make
7
8
9 MFTRACE_FLAGS=  --simplify
10
11 EXTRA_DIST_FILES += README 
12
13 # We don't use $(MF_FILES), because there's more .mf cruft here
14 FETA_MF_FILES = $(call src-wildcard,feta[0-9]*.mf)\
15         $(call src-wildcard,feta-braces-[a-z].mf)\
16         $(call src-wildcard,feta-alphabet*[0-9].mf)\
17         $(call src-wildcard,parmesan[0-9]*.mf)
18
19 STAFF_SIZES = 11 13 14 16 18 20 23 26
20 BRACES = a b c d e f g h i
21
22 OTF_FILES = $(STAFF_SIZES:%=$(outdir)/emmentaler-%.otf)\
23  $(outdir)/aybabtu.otf
24 PE_SCRIPTS = $(STAFF_SIZES:%=$(outdir)/emmentaler-%.pe)\
25  $(STAFF_SIZES:%=$(outdir)/emmentaler-%.dep)
26 OTF_TABLES = $(STAFF_SIZES:%=$(outdir)/feta%.otf-table)\
27  $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
28 FETA_FONTS = $(FETA_MF_FILES:.mf=)
29 SVG_FILES = $(OTF_FILES:%.otf=%.svg) $(ALL_FONTS:%=$(outdir)/%.svg)
30
31 FC_FIND=$(shell $(FCMATCH) --verbose 'Century Schoolbook L:style=$(1)' | grep 'file:' | sed 's/.*"\([^"]*\)".*/\1/g')
32
33 NCSB_OTFS=$(addprefix $(outdir)/,CenturySchL-Ital.otf CenturySchL-BoldItal.otf CenturySchL-Roma.otf CenturySchL-Bold.otf)
34 NCSB_INSTALL_DIR=$(local_lilypond_datadir)/fonts/otf
35
36 LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log)
37 LISP_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.lisp)
38 ENC_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.enc)
39 TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm)
40
41 ENCODING_FILE=$(findstring $(<F:.mf=.enc), $(FETA_MF_FILES:.mf=.enc))
42 MFTRACE_FLAGS=$(if $(ENCODING_FILE),--encoding $(outdir)/$(ENCODING_FILE),) --no-afm
43
44 $(outdir)/aybabtu.otf-table: $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
45         cat $^ > $@
46
47 $(outdir)/aybabtu.otf-gtable: $(BRACES:%=$(outdir)/feta-braces-%.otf-gtable)
48         echo '(design_size . 20)' > $@
49
50
51 # only for fonts which
52 #
53 # 1. are mentioned in font.scm
54 #
55 # 2. are not included with teTeX
56 #
57
58
59 $(outdir)/emmentaler-%.otf $(outdir)/emmentaler-%.svg: $(outdir)/emmentaler-%.pe $(outdir)/feta%.pfa  $(outdir)/feta-alphabet%.pfa  $(outdir)/parmesan%.pfa $(outdir)/feta%.otf-table $(outdir)/feta%.otf-gtable
60         cd $(outdir) && $(FONTFORGE) -script $(notdir $(basename ,$@).pe)
61
62 $(outdir)/aybabtu.otf $(outdir)/aybabtu.svg: $(outdir)/aybabtu.pe $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).pfa) $(outdir)/aybabtu.otf-table $(outdir)/aybabtu.otf-gtable
63         cd $(outdir) && $(FONTFORGE) -script aybabtu.pe
64
65 $(outdir)/%.pfa: $(outdir)/%.log
66
67 $(outdir)/%.otf-table: $(outdir)/%.lisp
68         cat $< \
69                 $(if $(findstring brace,$<),,$(subst feta,parmesan,$<)) \
70                 $(if $(findstring brace,$<),,$(subst feta,feta-alphabet,$<)) > $@
71
72
73 ## ugh -- we want this to prevent failing -j2 compiles. 
74 $(outdir)/feta26.otf-table: $(outdir)/feta26.lisp $(outdir)/parmesan26.lisp $(outdir)/feta-alphabet26.lisp 
75 $(outdir)/feta23.otf-table: $(outdir)/feta23.lisp $(outdir)/parmesan23.lisp $(outdir)/feta-alphabet23.lisp 
76 $(outdir)/feta20.otf-table: $(outdir)/feta20.lisp $(outdir)/parmesan20.lisp $(outdir)/feta-alphabet20.lisp 
77 $(outdir)/feta18.otf-table: $(outdir)/feta18.lisp $(outdir)/parmesan18.lisp $(outdir)/feta-alphabet18.lisp 
78 $(outdir)/feta16.otf-table: $(outdir)/feta16.lisp $(outdir)/parmesan16.lisp $(outdir)/feta-alphabet16.lisp 
79 $(outdir)/feta14.otf-table: $(outdir)/feta14.lisp $(outdir)/parmesan14.lisp $(outdir)/feta-alphabet14.lisp 
80 $(outdir)/feta13.otf-table: $(outdir)/feta13.lisp $(outdir)/parmesan13.lisp $(outdir)/feta-alphabet13.lisp 
81 $(outdir)/feta11.otf-table: $(outdir)/feta11.lisp $(outdir)/parmesan11.lisp $(outdir)/feta-alphabet11.lisp 
82
83
84
85 $(outdir)/aybabtu.otf: $(outdir)/aybabtu.subfonts $(outdir)/aybabtu.fontname $(outdir)/aybabtu.otf-table $(outdir)/aybabtu.otf-gtable $(outdir)/aybabtu.pe
86
87 $(outdir)/aybabtu.otf $(outdir)/aybabtu.svg: $(BRACES:%=$(outdir)/feta-braces-%.pfa)
88
89 $(outdir)/aybabtu.fontname:
90         echo -n 'aybabtu' > $@
91 $(outdir)/aybabtu.subfonts:
92         echo $(subst .mf,,$(call src-wildcard,feta-braces-[a-z].mf)) > $@
93
94 $(PE_SCRIPTS): $(buildscript-dir)/gen-emmentaler-scripts.py
95         $(PYTHON) $< --dir=$(outdir)
96
97 ALL_FONTS = $(FETA_FONTS)
98 PFA_FILES = $(ALL_FONTS:%=$(outdir)/%.pfa)
99
100 # Make tfm files first, log files last,
101 # so that normally log files aren't made twice
102 ALL_GEN_FILES=$(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(OTF_TABLES) $(NCSB_OTFS) $(PFA_FILES) $(OTF_FILES) $(SVG_FILES) 
103
104 #PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
105
106 INSTALLATION_DIR=$(local_lilypond_datadir)/fonts/source
107 INSTALLATION_FILES=$(MF_FILES)
108
109 INSTALLATION_OUT_SUFFIXES=1 2 3 4 5 6
110
111 INSTALLATION_OUT_DIR2=$(local_lilypond_datadir)/fonts/otf
112 INSTALLATION_OUT_FILES2=$(OTF_FILES) $(NCSB_OTFS)
113
114 INSTALLATION_OUT_DIR4=$(local_lilypond_datadir)/fonts/svg
115 INSTALLATION_OUT_FILES4=$(SVG_FILES)
116
117 INSTALLATION_OUT_DIR5=$(local_lilypond_datadir)/fonts/type1
118 INSTALLATION_OUT_FILES5=$(PFA_FILES)
119
120 export MFINPUTS:=.:$(MFINPUTS)
121
122
123
124 default: $(ALL_GEN_FILES) $(outdir)/emmentaler-20.otf tree-regen
125
126 .PHONY: tree-regen
127
128 # FIXME: temporary hack: must regenerate after building fonts
129 tree-regen:
130         ${MAKE} -C $(top-build-dir) link-mf-tree
131
132 ##
133 ## todo: this also depends on .tfm, FIXME.
134 $(outdir)/%.lisp $(outdir)/%.otf-gtable $(outdir)/%.enc  $(outdir)/%.tex $(outdir)/%.dep: $(outdir)/%.log
135         $(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) $<
136
137 local-clean:
138         rm -f mfplain.mem mfplain.log
139         rm -f *.tfm *.log
140
141 $(outdir)/%.enc.in: %.enc
142         cp $< $@
143
144
145 $(NCSB_OTFS): $(NCSB_SOURCE_FILES)  $(buildscript-dir)/pfx2ttf.fontforge
146         $(foreach i, $(basename $(NCSB_SOURCE_FILES)), \
147                 $(FONTFORGE) -script $(buildscript-dir)/pfx2ttf.fontforge \
148                         $(i).pfb $(i).afm $(outdir)/ && ) true