]> git.donarmstrong.com Git - lilypond.git/blobdiff - mf/GNUmakefile
(LINK_GXX_STATICALLY): --enable-ncsb-path option.
[lilypond.git] / mf / GNUmakefile
index 58ef0ec1d1c2508a80f406a2b45c5e8475795f21..13ebabb5a49acd7910da8bd2ea5d01fc97f2efd9 100644 (file)
@@ -5,15 +5,18 @@ LOCALSTEPMAKE_TEMPLATES=lilypond
 
 include $(depth)/make/stepmake.make 
 
-AF_FILES = $(wildcard *.af) 
+AF_FILES = $(call src-wildcard,*.af)
+
+# hangs on feta23
+MFTRACE_FLAGS=  # --simplify
 
 EXTRA_DIST_FILES += README feta.tex
 
 # We don't use $(MF_FILES), because there's more .mf cruft here
-FETA_MF_FILES = $(wildcard feta[0-9]*.mf)\
-       $(wildcard feta-braces-[a-z].mf)\
-       $(wildcard feta-alphabet*[0-9].mf)\
-       $(wildcard parmesan[0-9]*.mf)
+FETA_MF_FILES = $(call src-wildcard,feta[0-9]*.mf)\
+       $(call src-wildcard,feta-braces-[a-z].mf)\
+       $(call src-wildcard,feta-alphabet*[0-9].mf)\
+       $(call src-wildcard,parmesan[0-9]*.mf)
 
 STAFF_SIZES = 11 13 14 16 18 20 23 26
 BRACES = a b c d e f g h i
@@ -31,24 +34,32 @@ FETA_FONTS = $(FETA_MF_FILES:.mf=)
 SVG_FILES = $(OTF_FILES:%.otf=%.svg) $(ALL_FONTS:%=$(outdir)/%.svg)
 
 
-$(outdir)/aybabtu.otf-table: $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
-       cat $^ > $@
-
-$(outdir)/aybabtu.otf-gtable: $(BRACES:%=$(outdir)/feta-braces-%.otf-gtable)
-       echo '(design_size . 20)' > $@
+NCSB_SOURCE_FILES=c059013l c059016l c059033l c059036l
+NCSB_TTFS=$(addprefix $(outdir)/,CenturySchL-Ital.ttf CenturySchL-BoldItal.ttf CenturySchL-Roma.ttf CenturySchL-Bold.ttf)
+NCSB_INSTALL_DIR=$(local_lilypond_datadir)/fonts/otf
 
 LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log)
 LISP_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.lisp)
 TEXTABLES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tex)
-ENC_FILES = $(TEXTABLES:.tex=.enc) $(outdir)/cmr.enc
+ENC_FILES = $(TEXTABLES:.tex=.enc)
 TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm)\
  $(SAUTER_FONTS:%=$(outdir)/%.tfm)
 FETA_LIST_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%list.ly)
 
 
-ENCODING_FILE=$(findstring $(<:.mf=.enc), $(FETA_MF_FILES:.mf=.enc))
+ENCODING_FILE=$(findstring $(<F:.mf=.enc), $(FETA_MF_FILES:.mf=.enc))
 MFTRACE_FLAGS=$(if $(ENCODING_FILE),--encoding $(ENCODING_FILE),) --no-afm
 
+
+
+
+$(outdir)/aybabtu.otf-table: $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
+       cat $^ > $@
+
+$(outdir)/aybabtu.otf-gtable: $(BRACES:%=$(outdir)/feta-braces-%.otf-gtable)
+       echo '(design_size . 20)' > $@
+
+
 # only for fonts which
 #
 # 1. are mentioned in font.scm
@@ -59,7 +70,7 @@ MFTRACE_FLAGS=$(if $(ENCODING_FILE),--encoding $(ENCODING_FILE),) --no-afm
 $(outdir)/$(PFA_PREFIX)%.pfa $(outdir)/%.otf $(outdir)/%.svg: $(outdir)/%.pe
        (cd $(outdir) && $(FONTFORGE) -script $(notdir $<))
        $(PYTHON) $(buildscript-dir)/substitute-encoding.py --outdir=$(outdir) $@
-       -rm $(outdir)/*.scale.pfa
+       -rm -f $(outdir)/*.scale.pfa
 
 # ugh, this does not work
 $(outdir)/%.pfa: $(outdir)/%.log
@@ -117,18 +128,26 @@ $(outdir)/aybabtu.otf $(outdir)/$(PFA_PREFIX)aybabtu.pfa $(outdir)/aybabtu.svg:
 $(outdir)/aybabtu.fontname:
        echo -n 'aybabtu' > $@ 
 $(outdir)/aybabtu.subfonts: 
-       echo $(subst .mf,,$(wildcard feta-braces-[a-z].mf)) > $@
+       echo $(subst .mf,,$(call src-wildcard,feta-braces-[a-z].mf)) > $@
 
 $(PE_SCRIPTS): $(buildscript-dir)/gen-emmentaler-scripts.py
        $(PYTHON) $< --dir=$(outdir)
 
+$(outdir)/fonts.cache-1: $(PFA_OTF_FILES) $(PFA_FILES) $(OTF_FILES)
+       cd $(outdir) ; fc-cache .
+
+local-install: install-fc-cache
+
+install-fc-cache:
+       $(foreach suff, $(INSTALLATION_OUT_SUFFIXES), rm -f $(DESTDIR)$(INSTALLATION_OUT_DIR$(suff))/fonts.cache-1 && ) true
+       fc-cache $(foreach suff, $(INSTALLATION_OUT_SUFFIXES), $(DESTDIR)$(INSTALLATION_OUT_DIR$(suff)))
 
 ALL_FONTS = $(FETA_FONTS) $(SAUTER_FONTS)
 PFA_FILES = $(ALL_FONTS:%=$(outdir)/%.pfa) $(PFA_OTF_FILES)
 
 # 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) $(OTF_FILES) $(SVG_FILES)
+ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(FETA_LIST_FILES)  $(OTF_TABLES) $(NCSB_TTFS) $(PFA_FILES) $(OTF_FILES) $(SVG_FILES) $(outdir)/fonts.cache-1 
 
 #PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
 INSTALLATION_DIR=$(local_lilypond_datadir)/fonts/source
@@ -139,9 +158,8 @@ INSTALLATION_OUT_SUFFIXES=1 2 3 5 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)/fonts/otf
-INSTALLATION_OUT_FILES2=$(OTF_FILES)
+INSTALLATION_OUT_FILES2=$(OTF_FILES) $(NCSB_TTFS)
 
 INSTALLATION_OUT_DIR3=$(local_lilypond_datadir)/fonts/tfm
 INSTALLATION_OUT_FILES3=$(TFM_FILES)
@@ -158,26 +176,28 @@ INSTALLATION_OUT_FILES9=$(SVG_FILES)
 
 export MFINPUTS:=.:$(MFINPUTS)
 
+
+
+default: pfa_warning $(ALL_GEN_FILES) $(outdir)/emmentaler-20.otf tree-regen
+
 .PHONY: tree-regen
+
 # FIXME: temporary hack: must regenerate after building fonts
 tree-regen:
-       rm -rf $(builddir)/share
-       ${MAKE} -C $(builddir) link-tree
-
-default: pfa_warning $(ALL_GEN_FILES) $(outdir)/emmentaler-20.otf tree-regen
+       ${MAKE} -C $(top-build-dir) link-mf-tree
 
 pfa_warning:
 ifneq ($(shell $(MFTRACE) --version | sed 's/ .*//'),mftrace)
        @echo ""
        @echo "ERROR: mftrace not found"
        @echo ""
-       @echo "For obtaining PFA fonts, either install mftrace "
+       @echo "For obtaining PFA/SVG fonts, either install mftrace "
        @echo "(see http://www.xs4all.nl/~hanwen/mftrace/ ),"
        @echo "or try one of the following commands in this directory: "
        @echo ""
-       @echo " make get-pfa "
-       @echo " make get-rpm-pfa "
-       @echo " make get-deb-pfa "
+       @echo " make get-fonts "
+       @echo " make get-rpm-fonts "
+       @echo " make get-deb-fonts "
        @echo ""
        @echo "These commands will try to download the files from internet."
        @false
@@ -189,24 +209,25 @@ debian-package =lilypond_$(TOPLEVEL_VERSION)-1_i386.deb
 $(outdir)/$(debian-package):
        wget --passive-ftp -P $(outdir) $(debian-mirror)/debian/pool/main/l/lilypond/$(debian-package)
 
-get-deb-pfa: $(outdir)/$(debian-package)
+get-deb-fonts: $(outdir)/$(debian-package)
        rm -rf $(outdir)/./usr
        ar p $< data.tar.gz | \
-               tar -C $(outdir) -zvxf - '*.pfa'
-       cp `find $(outdir)/usr/ -name '*.pfa'` $(outdir)/
+               tar -C $(outdir) -zvxf - '*.pfa' '*.svg'
+       cp `find $(outdir)/usr/ -name '*.pfa' -o -name '*.svg'` $(outdir)/
 
 
 redhat-package=lilypond-$(TOPLEVEL_VERSION)-1.i386.rpm
 $(outdir)/$(redhat-package):
-       wget  --passive-ftp -P $(outdir) http://lilypond.org/download/binaries/Fedora-3/$(redhat-package)
+       wget  --passive-ftp -P $(outdir) http://lilypond.org/download/binaries/Fedora-4/$(redhat-package)
 
-get-rpm-pfa: $(outdir)/$(redhat-package)
+get-rpm-fonts: $(outdir)/$(redhat-package)
        cd $(outdir) ; rm -rf usr/ # (root alert!) 
-       cd $(outdir) ; rpm2cpio $(redhat-package) | cpio -uid '*.pfa'
-       cp `find $(outdir)/usr/ -name '*.pfa'` $(outdir)/
+       cd $(outdir) ; rpm2cpio $(redhat-package) | cpio -uid '*.pfa' '*.svg'
+       cp `find $(outdir)/usr/ -name '*.pfa' -o -name '*.svg'` $(outdir)/
 
 # change this dependency 
-get-pfa: get-rpm-pfa
+get-fonts: get-rpm-fonts
+get-pfa: get-rpm-fonts
 
 
 ##
@@ -232,3 +253,9 @@ local-install:
 local-uninstall:
        -rm -f $(DESTDIR)$(local_lilypond_datadir)/dvips/map
        -rmdir $(DESTDIR)$(local_lilypond_datadir)/dvips
+
+
+$(NCSB_TTFS): $(addsuffix .pfb,$(addprefix $(NCSB_PATH)/,$(NCSB_SOURCE_FILES)))
+       $(foreach i,$(NCSB_SOURCE_FILES), \
+               $(FONTFORGE) -script $(buildscript-dir)/pfx2ttf.fontforge \
+                       $(NCSB_PATH)/$(i).pfb $(NCSB_PATH)/$(i).afm $(outdir)/ && ) true