]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/stepmake/texinfo-vars.make
Build: Also track verbatiminclude'd files (issue 3594).
[lilypond.git] / stepmake / stepmake / texinfo-vars.make
1 TEXI_FILES = $(call src-wildcard,*.texi)
2 ALL_SOURCES += $(TEXI_FILES)
3 TEXINFO_SOURCES = $(TEXI_FILES)
4
5 OUTTXT_FILES += $(addprefix $(outdir)/,$(TEXI_FILES:.texi=.txt))
6
7 OMF_FILES += $(foreach format, html pdf, $(foreach f, $(TEXI_FILES), $(outdir)/$(f:.texi=.$(format)).omf))
8
9 GENERATE_OMF = $(buildscript-dir)/texi2omf --format $(1) --location $(webdir)$(tree-dir)/$(notdir $(basename $@))  --version $(TOPLEVEL_VERSION) $< > $@
10
11 # Find the file $(1) within the texinfo include dirs and return its path.
12 # If not found, return $(outdir)/$(1) assuming that it is a generated file.
13 find-texi = \
14 $(firstword \
15         $(wildcard $(src-dir)/$(1)) \
16         $(wildcard $(top-src-dir)/Documentation/$(1)) \
17         $(outdir)/$(1) \
18 )
19
20 # Recursively scan the file $(1) for @include and @verbatiminclude, search for
21 # included files within the texinfo include dirs, and return all dependencies.
22 scan-texi = \
23 $(foreach f, $(shell test -f $(1) && sed -ne "/^@\(verbatim\)\?include[[:space:]]/s/@\(verbatim\)\?include//p" $(1)), \
24         $(call find-texi,$(f)) \
25         $(call scan-texi,$(call find-texi,$(f))) \
26 )
27
28 # Find dependencies for the target $@, based on the texinfo source file $<,
29 # and write the dependencies to a .dep file.
30 DO_TEXI_DEP = ( echo ./$@: $(call scan-texi,$<) > $(basename $@).dep ) &&
31
32 TEXINFO_PAPERSIZE_OPTION= $(if $(findstring $(PAPERSIZE),a4),,-t @afourpaper)
33
34 MAKEINFO_FLAGS += --enable-encoding --error-limit=0 $(DOCUMENTATION_INCLUDES)
35 MAKEINFO = LANG= $(MAKEINFO_PROGRAM) $(MAKEINFO_FLAGS)
36
37 # texi2html xref map files
38 XREF_MAPS_DIR = $(top-build-dir)/$(outdir)/xref-maps
39 ifneq ($(ISOLANG),)
40 XREF_MAPS_FILES += $(TEXI_FILES:%.texi=$(XREF_MAPS_DIR)/%.$(ISOLANG).xref-map) \
41  $(TELY_FILES:%.tely=$(XREF_MAPS_DIR)/%.$(ISOLANG).xref-map)
42 else
43 XREF_MAPS_FILES += $(TEXI_FILES:%.texi=$(XREF_MAPS_DIR)/%.xref-map) \
44  $(TELY_FILES:%.tely=$(XREF_MAPS_DIR)/%.xref-map)
45 endif
46 XREF_MAP_FLAGS += -I $(outdir) -I $(src-dir) $(DOCUMENTATION_INCLUDES)
47
48 ###########
49 ifneq ($(ISOLANG),)
50 TEXI2HTML_LANG = --lang=$(ISOLANG)
51 endif
52
53 TEXI2HTML_INIT = --init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init
54
55 TEXI2HTML_SPLIT = --prefix=index --split=section
56
57 TEXI2HTML_INCLUDES += --I=$(src-dir) --I=$(outdir) $(DOCUMENTATION_INCLUDES) --I=$(XREF_MAPS_DIR)
58 TEXI2HTML_FLAGS += --error-limit=0 $(TEXI2HTML_INCLUDES) $(TEXI2HTML_INIT) $(TEXI2HTML_LANG)
59 TEXI2HTML = TOP_SRC_DIR=$(top-src-dir) PERL_UNICODE=SD $(TEXI2HTML_PROGRAM)
60 ###########
61
62 TEXI2PDF_FLAGS += $(DOCUMENTATION_INCLUDES)
63
64 # info stuff
65 INFO_INSTALL_FILES = $(wildcard $(addsuffix *, $(INFO_FILES)))
66 INFO_INSTALL_COMMAND = $(if $(INFO_INSTALL_FILES),\
67         $(INSTALLPY) -d $(DESTDIR)$(infodir) ; \
68         $(MAKE) INSTALLATION_OUT_DIR=$(infodir) \
69                 depth=$(depth) INSTALLATION_OUT_FILES="$(INFO_INSTALL_FILES)" \
70                 -f $(stepdir)/install-out.sub.make,true)