]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/stepmake/metafont-vars.make
Build: Dependencies for metafont files (issue 779).
[lilypond.git] / stepmake / stepmake / metafont-vars.make
1 MF_FILES := $(call src-wildcard,*.mf)
2 MF_TFM_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.tfm))
3 MF_DVI_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.dvi))
4 MF_LOG_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.log))
5 DVI_FILES += $(MF_DVI_FILES)
6 TFM_FILES += $(MF_TFM_FILES)
7
8 MF2PT1_OPTIONS=--rounding=0.0001 \
9                --family=$(notdir $(<:%.mf=%)) \
10                --fullname=$(notdir $(<:%.mf=%)) \
11                --name=$(notdir $(<:%.mf=%))
12
13 ifdef QUIET_BUILD
14 METAFONT_QUIET = >/dev/null
15 else
16 METAFONT_QUIET =
17 endif
18
19 # Find the metafont file $(1) within the source dirs and return its path.
20 # If not found, return $(outdir)/$(1) assuming that it is a generated file.
21 find-mf = \
22 $(firstword \
23         $(wildcard $(src-dir)/$(1)) \
24         $(wildcard $(top-src-dir)/mf/$(1)) \
25         $(outdir)/$(1) \
26 )
27
28 # Recursively scan the metafont .mf file $(1) for "input X;"
29 # and return all dependencies.
30 scan-mf = \
31 $(foreach f, $(shell test -f $(1) && sed -ne "/^[[:space:]]*input[[:space:]]/s/^[[:space:]]*input\([^.;]*\)\(.mf;\|;\)/\1.mf/p" $(1)), \
32         $(call find-mf,$(f)) \
33         $(call scan-mf,$(call find-mf,$(f))) \
34 )
35
36 # Find dependencies for the target $@, based on the metafont source file $<,
37 # and write the dependencies to a .dep file.
38 DO_MF_DEP = ( echo ./$@: $(call scan-mf,$<) > $(basename $@).dep ) &&