]> git.donarmstrong.com Git - lilypond.git/blobdiff - mf/GNUmakefile
($(outdir)/lilypond.map): add aybabtu to .map file.
[lilypond.git] / mf / GNUmakefile
index 79ade05fc4f8ea0e2a5a286e0c24b3889530b116..e34ad641a6d869b95886c229798dbe5e55feba18 100644 (file)
@@ -1,6 +1,7 @@
 depth = ..
 
 STEPMAKE_TEMPLATES=metafont install install-out
+LOCALSTEPMAKE_TEMPLATES=lilypond
 
 include $(depth)/make/stepmake.make 
 
@@ -17,13 +18,17 @@ FETA_MF_FILES = $(wildcard feta[0-9]*.mf)\
 STAFF_SIZES = 11 13 14 16 18 20 23 26
 BRACES = a b c d e f g h i
 
-CHEESES = $(addsuffix .otf, $(addprefix $(outdir)/bigcheese, $(STAFF_SIZES)))\
+OTF_FILES = $(addsuffix .otf, $(addprefix $(outdir)/emmentaler, $(STAFF_SIZES)))\
  $(outdir)/aybabtu.otf
-PE_SCRIPTS = $(addsuffix .pe, $(addprefix $(outdir)/bigcheese, $(STAFF_SIZES))) \
-  $(addsuffix .dep, $(addprefix $(outdir)/bigcheese, $(STAFF_SIZES))) 
+PE_SCRIPTS = $(addsuffix .pe, $(addprefix $(outdir)/emmentaler, $(STAFF_SIZES))) \
+  $(addsuffix .dep, $(addprefix $(outdir)/emmentaler, $(STAFF_SIZES))) 
 OTF_TABLES = $(addsuffix .otf-table, $(addprefix $(outdir)/feta, $(STAFF_SIZES))) \
  $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
 FETA_FONTS = $(FETA_MF_FILES:.mf=)
+SVG_FILES = $(OTF_FILES:%.otf=%.svg) $(ALL_FONTS:%=$(outdir)/%.svg)
+CFF_FILES = $(OTF_FILES:%.otf=%.cff)
+CFF_PS_FILES = $(OTF_FILES:%.otf=%.cff.ps)
+
 
 $(outdir)/aybabtu.otf-table: $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
        cat $^ > $@
@@ -40,7 +45,7 @@ FETA_LIST_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%list.ly)
 
 
 ENCODING_FILE=$(findstring $(<:.mf=.enc), $(FETA_MF_FILES:.mf=.enc))
-MFTRACE_FLAGS=$(if $(ENCODING_FILE),--encoding $(ENCODING_FILE),)
+MFTRACE_FLAGS=$(if $(ENCODING_FILE),--encoding $(ENCODING_FILE),) --no-afm
 
 # only for fonts which
 #
@@ -54,53 +59,55 @@ foe:
        echo $(TEXMF)
        kpsewhich exbase.mf
 
-$(outdir)/%.otf: $(outdir)/%.pe
+$(outdir)/%.cff $(outdir)/%.otf $(outdir)/%.svg: $(outdir)/%.pe
        (cd $(outdir) && fontforge -script $(notdir $<)) 
 
-$(outdir)/%.otf-table: $(outdir)/%.lisp
-       cat $< $(subst parmesan,feta,$<) $(subst feta-alphabet,feta,$<) > $@
+$(CFF_PS_FILES): $(CFF_FILES)
+       cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond --verbose $(abs-srcdir)/ly/generate-embedded-cff
+
+$(outdir)/%.otf-table: $(outdir)/%.lisp $(if $(findstring brace,$<),,$(subst feta,parmesan,$<)) 
+       cat $< \
+               $(if $(findstring brace,$<),,$(subst feta,parmesan,$<)) \
+               $(if $(findstring brace,$<),,$(subst feta,feta-alphabet,$<)) > $@
 
 $(outdir)/aybabtu.otf: $(outdir)/aybabtu.subfonts $(outdir)/aybabtu.otf-table $(outdir)/aybabtu.otf-gtable
 
 $(outdir)/aybabtu.subfonts: 
         echo $(subst .mf,,$(wildcard feta-braces-[a-z].mf)) > $@
 
-$(PE_SCRIPTS):
-       $(PYTHON) $(buildscript-dir)/gen-bigcheese-scripts.py --dir=$(outdir)
-
-include $(outdir)/bigcheese20.dep
+$(PE_SCRIPTS): $(buildscript-dir)/gen-emmentaler-scripts.py
+       $(PYTHON) $< --dir=$(outdir)
 
 
-foo:
-       echo $(CHEESES)
-## use separate package sauter-fonts-mftraced.
-SAUTER_FONTS = 
-
 ALL_FONTS = $(FETA_FONTS) $(SAUTER_FONTS)
 PFA_FILES = $(ALL_FONTS:%=$(outdir)/%.pfa)
-PFB_FILES = $(PFA_FILES:%.pfa=%.pfb)
 
 # Make tfm files first, log files last, 
 # so that normally log files aren't made twice
-ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(FETA_LIST_FILES)  $(OTF_TABLES) $(PFA_FILES) $(outdir)/lilypond.map $(outdir)/fonts.scale $(outdir)/Fontmap.lily $(CHEESES)
+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)
 
 #PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
 INSTALLATION_DIR=$(local_lilypond_datadir)/fonts/source
 INSTALLATION_FILES=$(MF_FILES) $(AF_FILES)
 
-INSTALLATION_OUT_SUFFIXES=1 2 3 4 5 6 7
+INSTALLATION_OUT_SUFFIXES=1 2 3 4 5 6 7 8 9
 
 INSTALLATION_OUT_DIR1=$(local_lilypond_datadir)/tex
 INSTALLATION_OUT_FILES1=$(TEXTABLES)
 
+# must not be installed with .cff, pango/fontconfig does not like .cff fonts 
+INSTALLATION_OUT_DIR2=$(local_lilypond_datadir)/otf
+INSTALLATION_OUT_FILES2=$(OTF_FILES)
+
 INSTALLATION_OUT_DIR3=$(local_lilypond_datadir)/fonts/tfm
 INSTALLATION_OUT_FILES3=$(TFM_FILES)
 
-INSTALLATION_OUT_DIR4=$(local_lilypond_datadir)/ly
-INSTALLATION_OUT_FILES4=$(FETA_LIST_FILES)
+INSTALLATION_OUT_DIR4=$(local_lilypond_datadir)/ps
+INSTALLATION_OUT_FILES4=$(CFF_PS_FILES)
+
 
 INSTALLATION_OUT_DIR5=$(local_lilypond_datadir)/fonts/type1
-INSTALLATION_OUT_FILES5=$(PFA_FILES) $(outdir)/fonts.scale $(outdir)/Fontmap $(outdir)/Fontmap.lily
+INSTALLATION_OUT_FILES5=$(PFA_FILES)
 
 INSTALLATION_OUT_DIR6=$(local_lilypond_datadir)/dvips/
 INSTALLATION_OUT_FILES6=$(outdir)/lilypond.map
@@ -108,13 +115,20 @@ INSTALLATION_OUT_FILES6=$(outdir)/lilypond.map
 INSTALLATION_OUT_DIR7=$(local_lilypond_datadir)/ps/
 INSTALLATION_OUT_FILES7=$(ENC_FILES)
 
-export MFINPUTS:=.:$(MFINPUTS)
+# install in fonts/cff or ps/ directory?
+INSTALLATION_OUT_DIR8=$(local_lilypond_datadir)/cff
+INSTALLATION_OUT_FILES8=$(CFF_FILES)
+
+INSTALLATION_OUT_DIR9=$(local_lilypond_datadir)/svg
+INSTALLATION_OUT_FILES9=$(SVG_FILES)
 
-default: pfa_warning $(ALL_GEN_FILES) $(outdir)/bigcheese20.otf
 
+export MFINPUTS:=.:$(MFINPUTS)
+
+default: pfa_warning $(ALL_GEN_FILES) $(outdir)/emmentaler20.otf
 
 pfa_warning:
-ifneq ($(notdir $(MFTRACE)),mftrace)
+ifneq ($(shell $(MFTRACE) --version | sed 's/ .*//'),mftrace)
        @echo ""
        @echo "ERROR: mftrace not found"
        @echo ""
@@ -126,7 +140,7 @@ ifneq ($(notdir $(MFTRACE)),mftrace)
        @echo " make get-rpm-pfa "
        @echo " make get-deb-pfa "
        @echo ""
-       @echo "These commands will try to download the files from the internet."
+       @echo "These commands will try to download the files from internet."
        @false
 endif
 
@@ -163,54 +177,18 @@ $(outdir)/%.lisp $(outdir)/%.otf-gtable $(outdir)/%.enc  $(outdir)/%.tex $(outdi
 
 fontdir: $(addprefix $(outdir)/, lilypond.map lilypond.sfd private-fonts fonts.scale fonts.dir Fontmap.lily)
 
-## Urg
-mapentry=$(1) $(shell fgrep FontName $(outdir)/$(1).afm | sed -e 's/FontName *//') <$(1).pfaX
 
-map = $(foreach a,$(2),$(call $(1),$(a)))
-$(outdir)/lilypond.xmap: $(AFM_FILES)
-       echo '$(call map,mapentry,$(ALL_FONTS))' | \
-               tr 'X' '\n' | sed -e 's/^ *//'> $@
-
-# using shell for loop seems most robust
 $(outdir)/lilypond.map: $(AFM_FILES)
-       for i in $(FETA_FONTS); do echo $$i $$(fgrep FontName $(outdir)/$$i.afm | sed -e 's/FontName *//') '<'$$i.pfa; done > $@
-
-$(outdir)/Fontmap:
-       echo '%!' > $@
-       echo '% Override default GS Fontmap' >> $@
-       echo '% To let gs load fonts from builddir, do:' >> $@
-       echo '% export GS_LIB=$$(pwd)/mf/out:' >> $@
-       echo '% See Fontmap.GS for the syntax of real Fontmap files.' >> $@
-       echo '(Fontmap.GS) .runlibfile' >> $@
-       echo '(Fontmap.lily) .runlibfile' >> $@
-
-$(outdir)/Fontmap.lily: $(AFM_FILES) $(outdir)/Fontmap
-       echo '%!' > $@
-       for i in $(FETA_FONTS); do echo "/$$(fgrep FontName $(outdir)/$$i.afm | sed -e 's/FontName *//') ($$i.pfa);"; done >> $@
-
-
-$(outdir)/fonts.scale: $(PFA_FILES)
-#      cd $(outdir) && echo $(FETA_MF_FILES:.mf=.pfa) $(FETA_MF_FILES:.mf=.pfb) | $(PYTHON) $(topdir)/buildscripts/make-font-dir.py  > $(@F)
-       cd $(outdir) && echo *.pfa *.pfb | $(PYTHON) $(topdir)/buildscripts/make-font-dir.py  > $(@F)
+       for i in $(FETA_FONTS); do echo $$i $$i '<'$$i.pfa; done > $@
+       for i in $(STAFF_SIZES); \
+               do echo "emmentaler$$i emmentaler-$$i <emmentaler$$i.cff.ps" ; done \
+       >> $@
+       echo "aybabtu aybabtu <aybabtu.cff.ps" >> $@
 
-$(outdir)/fonts.dir: $(outdir)/fonts.scale
-       cd $(outdir) && mkfontdir
 
 local-clean:
        rm -f mfplain.mem mfplain.log 
        rm -f *.tfm *.log
 
-afm: $(AFM_FILES)
-pfa: afm $(PFA_FILES) fontdir
-pfb: afm $(PFB_FILES) fontdir
-
-
-# stupid trick to have separate rules for each PFA font ;
-# otherwise building PFAs is all-or-nothing.
-
-
-$(outdir)/%.pfa: $(outdir)/%.bla
-       $(MFTRACE) -I $(outdir)/ --pfa --simplify --keep-trying $(notdir $(basename $@))  && mv $(notdir $@) $(outdir)/
-
 $(outdir)/%.enc.in: %.enc
        cp $< $@