]> git.donarmstrong.com Git - lilypond.git/blobdiff - mf/GNUmakefile
* mf/GNUmakefile (FC_FIND): new function. Find ncsb using
[lilypond.git] / mf / GNUmakefile
index fe7efe2c40dd70c46ba28defcd8d8d3ba4214adf..1864fbb36a142191cd579c6caf8ee4f6817cb6a8 100644 (file)
@@ -8,7 +8,7 @@ include $(depth)/make/stepmake.make
 AF_FILES = $(call src-wildcard,*.af)
 
 # hangs on feta23
-MFTRACE_FLAGS=  --simplify
+MFTRACE_FLAGS=  --simplify
 
 EXTRA_DIST_FILES += README feta.tex
 
@@ -30,9 +30,18 @@ OTF_TABLES = $(STAFF_SIZES:%=$(outdir)/feta%.otf-table)\
 FETA_FONTS = $(FETA_MF_FILES:.mf=)
 SVG_FILES = $(OTF_FILES:%.otf=%.svg) $(ALL_FONTS:%=$(outdir)/%.svg)
 
+FC_FIND=$(shell $(FCMATCH) --verbose 'Century Schoolbook L:style=$(1)' | grep 'file:' | sed 's/.*"\([^"]*\)".*/\1/g')
 
-NCSB_SOURCE_FILES=c059013l c059016l c059033l c059036l
-NCSB_TTFS=$(addprefix $(outdir)/,CenturySchL-Ital.ttf CenturySchL-BoldItal.ttf CenturySchL-Roma.ttf CenturySchL-Bold.ttf)
+ifeq ($(NCSB_DIR),)
+NCSB_SOURCE_FILES=$(call FC_FIND,Roman) \
+       $(call FC_FIND,Italic) \
+       $(call FC_FIND,Bold Italic) \
+       $(call FC_FIND,Bold)
+else
+NCSB_SOURCE_FILES=$(addsuffix .pfb,$(addprefix $(NCSB_DIR),c059013l c059016l c059033l c059036l))
+endif
+
+NCSB_OTFS=$(addprefix $(outdir)/,CenturySchL-Ital.otf CenturySchL-BoldItal.otf CenturySchL-Roma.otf CenturySchL-Bold.otf)
 NCSB_INSTALL_DIR=$(local_lilypond_datadir)/fonts/otf
 
 LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log)
@@ -44,7 +53,7 @@ TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm)\
 
 
 ENCODING_FILE=$(findstring $(<F:.mf=.enc), $(FETA_MF_FILES:.mf=.enc))
-MFTRACE_FLAGS=$(if $(ENCODING_FILE),--encoding $(ENCODING_FILE),) --no-afm
+MFTRACE_FLAGS=$(if $(ENCODING_FILE),--encoding $(outdir)/$(ENCODING_FILE),) --no-afm
 
 $(outdir)/aybabtu.otf-table: $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
        cat $^ > $@
@@ -60,12 +69,9 @@ $(outdir)/aybabtu.otf-gtable: $(BRACES:%=$(outdir)/feta-braces-%.otf-gtable)
 # 2. are not included with teTeX
 #
 
-define EMMENTALER_RULE
-$(outdir)/emmentaler-$(1).otf $(outdir)/emmentaler-$(1).svg: $(outdir)/emmentaler-$(1).pe $(outdir)/feta$(1).pfa  $(outdir)/feta-alphabet$(1).pfa  $(outdir)/parmesan$(1).pfa
-       cd $(outdir) && $(FONTFORGE) -script emmentaler-$(1).pe
-endef
 
-$(foreach size, $(STAFF_SIZES), $(eval $(call EMMENTALER_RULE,$(size))))
+$(outdir)/emmentaler-%.otf $(outdir)/emmentaler-%.svg: $(outdir)/emmentaler-%.pe $(outdir)/feta%.pfa  $(outdir)/feta-alphabet%.pfa  $(outdir)/parmesan%.pfa
+       cd $(outdir) && $(FONTFORGE) -script $(notdir $(basename ,$@).pe)
 
 $(outdir)/aybabtu.otf $(outdir)/aybabtu.svg: $(outdir)/aybabtu.pe $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).pfa)
        cd $(outdir) && $(FONTFORGE) -script aybabtu.pe
@@ -104,7 +110,7 @@ PFA_FILES = $(ALL_FONTS:%=$(outdir)/%.pfa)
 
 # 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) $(NCSB_TTFS) $(PFA_FILES) $(OTF_FILES) $(SVG_FILES) $(outdir)/fonts.cache-1
+ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(FETA_LIST_FILES)  $(OTF_TABLES) $(NCSB_OTFS) $(PFA_FILES) $(OTF_FILES) $(SVG_FILES) $(outdir)/fonts.cache-1
 
 #PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
 
@@ -117,7 +123,7 @@ INSTALLATION_OUT_DIR1=$(local_lilypond_datadir)/tex
 INSTALLATION_OUT_FILES1=$(TEXTABLES)
 
 INSTALLATION_OUT_DIR2=$(local_lilypond_datadir)/fonts/otf
-INSTALLATION_OUT_FILES2=$(OTF_FILES) $(NCSB_TTFS)
+INSTALLATION_OUT_FILES2=$(OTF_FILES) $(NCSB_OTFS)
 
 INSTALLATION_OUT_DIR3=$(local_lilypond_datadir)/fonts/tfm
 INSTALLATION_OUT_FILES3=$(TFM_FILES)
@@ -128,15 +134,11 @@ INSTALLATION_OUT_FILES4=$(SVG_FILES)
 INSTALLATION_OUT_DIR5=$(local_lilypond_datadir)/fonts/type1
 INSTALLATION_OUT_FILES5=$(PFA_FILES)
 
-INSTALLATION_OUT_DIR6=$(local_lilypond_datadir)/ps/
-INSTALLATION_OUT_FILES6=$(ENC_FILES)
-
-
 export MFINPUTS:=.:$(MFINPUTS)
 
 
 
-default: pfa_warning $(ALL_GEN_FILES) $(outdir)/emmentaler-20.otf tree-regen
+default: $(ALL_GEN_FILES) $(outdir)/emmentaler-20.otf tree-regen
 
 .PHONY: tree-regen
 
@@ -144,50 +146,15 @@ default: pfa_warning $(ALL_GEN_FILES) $(outdir)/emmentaler-20.otf tree-regen
 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/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-fonts "
-       @echo " make get-rpm-fonts "
-       @echo " make get-deb-fonts "
-       @echo ""
-       @echo "These commands will try to download the files from internet."
-       @false
-endif
-
-
 debian-mirror=http://ftp.us.debian.org
 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-fonts: $(outdir)/$(debian-package)
-       rm -rf $(outdir)/./usr
-       ar p $< data.tar.gz | \
-               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-4/$(redhat-package)
 
-get-rpm-fonts: $(outdir)/$(redhat-package)
-       cd $(outdir) ; rm -rf usr/ # (root alert!)
-       cd $(outdir) ; rpm2cpio $(redhat-package) | cpio -uid '*.pfa' '*.svg'
-       cp `find $(outdir)/usr/ -name '*.pfa' -o -name '*.svg'` $(outdir)/
-
-# change this dependency
-get-fonts: get-rpm-fonts
-get-pfa: get-rpm-fonts
-
-
 ##
 ## todo: this also depends on .tfm, FIXME.
 $(outdir)/%.lisp $(outdir)/%.otf-gtable $(outdir)/%.enc  $(outdir)/%.tex $(outdir)/%.dep: $(outdir)/%.log $(outdir)/%.tfm
@@ -204,7 +171,7 @@ $(outdir)/%.enc.in: %.enc
        cp $< $@
 
 
-$(NCSB_TTFS): $(addsuffix .pfb,$(addprefix $(NCSB_DIR)/,$(NCSB_SOURCE_FILES))) $(buildscript-dir)/pfx2ttf.fontforge
-       $(foreach i,$(NCSB_SOURCE_FILES), \
+$(NCSB_OTFS): $(NCSB_SOURCE_FILES)  $(buildscript-dir)/pfx2ttf.fontforge
+       $(foreach i, $(basename $(NCSB_SOURCE_FILES)), \
                $(FONTFORGE) -script $(buildscript-dir)/pfx2ttf.fontforge \
-                       $(NCSB_DIR)/$(i).pfb $(NCSB_DIR)/$(i).afm $(outdir)/ && ) true
+                       $(i).pfb $(i).afm $(outdir)/ && ) true