X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=stepmake%2Fstepmake%2Ftexinfo-vars.make;h=28a48b94aa2b2a74af345f5046b7ce6b111eba8e;hb=b16d78084944afc117e8bb972d277e70c6d23208;hp=27eb4edcf6036f5d22f965a54a89f6412822b50a;hpb=3543425fe170a38ad0d4fd212bdb44ed79768e2d;p=lilypond.git diff --git a/stepmake/stepmake/texinfo-vars.make b/stepmake/stepmake/texinfo-vars.make index 27eb4edcf6..28a48b94aa 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,33 +41,24 @@ 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) +XREF_MAP_FLAGS += -I $(outdir) -I $(src-dir) $(DOCUMENTATION_INCLUDES) ########### ifneq ($(ISOLANG),) TEXI2HTML_LANG = --lang=$(ISOLANG) endif -DOC_TEXI2HTML_INIT = --init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init -WEB_TEXI2HTML_INIT =--init-file=$(top-src-dir)/Documentation/web-texi2html.init -TEXI2HTML_INIT = $(DOC_TEXI2HTML_INIT) +TEXI2HTML_INIT = --init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init -DOC_TEXI2HTML_SPLIT = --prefix=index --split=section -WEB_TEXI2HTML_SPLIT = --prefix=index --split=node --node-files -TEXI2HTML_SPLIT = $(DOC_TEXI2HTML_SPLIT) +TEXI2HTML_SPLIT = --prefix=index --split=section TEXI2HTML_INCLUDES += --I=$(src-dir) --I=$(outdir) $(DOCUMENTATION_INCLUDES) --I=$(XREF_MAPS_DIR) TEXI2HTML_FLAGS += $(TEXI2HTML_INCLUDES) $(TEXI2HTML_INIT) $(TEXI2HTML_LANG) -TEXI2HTML = SRC_DIR=$(src-dir) PERL_UNICODE=SD $(TEXI2HTML_PROGRAM) +TEXI2HTML = TOP_SRC_DIR=$(top-src-dir) PERL_UNICODE=SD $(TEXI2HTML_PROGRAM) ########### - TEXI2PDF_FLAGS += $(DOCUMENTATION_INCLUDES) -ifdef QUIET_BUILD -TEXI2PDF_FLAGS += -q -endif - # info stuff INFO_INSTALL_FILES = $(wildcard $(addsuffix *, $(INFO_FILES))) INFO_INSTALL_COMMAND = $(if $(INFO_INSTALL_FILES),\