X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=stepmake%2Fstepmake%2Ftexinfo-vars.make;h=2f2d801ab1210e1bc784306df498c5e84d5b553f;hb=820c7ff5d380e8ca52057717ab3176b5e40107fd;hp=4c990d9f042b9164afa2f743356c2b6ed66f07fa;hpb=7bdfb30230922720b6bffe45c14ac84963d28d1a;p=lilypond.git diff --git a/stepmake/stepmake/texinfo-vars.make b/stepmake/stepmake/texinfo-vars.make index 4c990d9f04..2f2d801ab1 100644 --- a/stepmake/stepmake/texinfo-vars.make +++ b/stepmake/stepmake/texinfo-vars.make @@ -8,6 +8,27 @@ OMF_FILES += $(foreach format, html pdf, $(foreach f, $(TEXI_FILES), $(outdir)/$ GENERATE_OMF = $(buildscript-dir)/texi2omf --format $(1) --location $(webdir)$(tree-dir)/$(notdir $(basename $@)) --version $(TOPLEVEL_VERSION) $< > $@ +# Find the file $(1) within the texinfo include dirs and return its path. +# If not found, return $(outdir)/$(1) assuming that it is a generated file. +find-texi = \ +$(firstword \ + $(wildcard $(src-dir)/$(1)) \ + $(wildcard $(top-src-dir)/Documentation/$(1)) \ + $(outdir)/$(1) \ +) + +# Recursively scan the file $(1) for @include, search for included files +# within the texinfo include dirs, and return all dependencies. +scan-texi = \ +$(foreach f, $(shell sed -ne "/^@include[[:space:]]/s/@include//p" $(1)), \ + $(call find-texi,$(f)) \ + $(call scan-texi,$(call find-texi,$(f))) \ +) + +# Find dependencies for the target $@, based on the texinfo source file $<, +# and write the dependencies to a .dep file. +DO_TEXI_DEP = ( echo ./$@: $(call scan-texi,$<) > $(basename $@).dep ) && + TEXINFO_PAPERSIZE_OPTION= $(if $(findstring $(PAPERSIZE),a4),,-t @afourpaper) DOCUMENTATION_INCLUDES += -I $(top-src-dir)/Documentation @@ -20,7 +41,7 @@ MAKEINFO = LANG= $(MAKEINFO_PROGRAM) $(MAKEINFO_FLAGS) XREF_MAPS_DIR = $(top-build-dir)/$(outdir)/xref-maps XREF_MAPS_FILES += $(TEXI_FILES:%.texi=$(XREF_MAPS_DIR)/%.xref-map) \ $(TELY_FILES:%.tely=$(XREF_MAPS_DIR)/%.xref-map) -XREF_MAP_FLAGS += -I $(outdir) -I $(src-dir) +XREF_MAP_FLAGS += -I $(outdir) -I $(src-dir) $(DOCUMENTATION_INCLUDES) ########### ifneq ($(ISOLANG),)