+SUBDIRS = logo pictures misc po css topdocs \
+ ly-examples $(LANGS)
+STEPMAKE_TEMPLATES = documentation texinfo tex omf
+LOCALSTEPMAKE_TEMPLATES = lilypond ly
+
+### Extra flags
+
+LILYPOND_BOOK_FLAGS = --extra-options '-e "(ly:set-option (quote internal-type-checking) \#t)"'
+TEXI2PDF_FLAGS = \
+ -I $(outdir) \
+ -I $(top-build-dir)/Documentation/$(outconfbase)
+$(outdir)/snippets-big-page.html: TEXI2HTML_FLAGS += -D short_toc
+$(outdir)/snippets/index.html: TEXI2HTML_FLAGS += -D short_toc
+
+### Extra source files
+
+README_TOP_FILES= DEDICATION
+
+IN_ITELY_FILES = $(call src-wildcard,snippets/*-intro.itely)
+SNIPPET_LY_FILES = $(call src-wildcard,snippets/*.ly)
+OUT_SNIPPET_LY_FILES = $(SNIPPET_LY_FILES:%.ly=out/%.ly)
+
+### Out files
+
+# Dependencies
+GENERATED_ITELY_FILES = $(IN_ITELY_FILES:snippets/%-intro.itely=$(outdir)/%.itely)
+
+XREF_MAPS_FILES += $(XREF_MAPS_DIR)/internals.xref-map
+OMF_FILES += $(outdir)/internals.html.omf $(outdir)/internals.pdf.omf
+
+# Main manuals
+TEXINFO_MANUALS = internals\
+ $(TELY_FILES:%.tely=%)\
+ $(TEXI_FILES:%.texi=%)
+OUT_TEXINFO_MANUALS = $(TEXINFO_MANUALS:%=$(outdir)/%.texi)
+
+## CHAIN_RULE hack: keep the following line *before* including
+# stepmake.make, so the Internals Reference is built before the
+# Notation Reference, thus providing automatically generated sections
+# of the NR
+TEXI_FILES_FROM_TELY = $(outdir)/internals.texi
+
+PDF_FILES = $(TEXINFO_MANUALS:%=$(outdir)/%.pdf)
+
+TOPDIR_HTML_MANUALS =
+UNSPLIT_HTML_MANUALS =
+SPLIT_HTML_MANUALS = $(foreach manual, $(TEXINFO_MANUALS),\
+ $(if $(findstring $(manual), $(UNSPLIT_HTML_MANUALS)),,$(manual)))
+NOT_TOPDIR_HTML_MANUALS = $(foreach manual, $(SPLIT_HTML_MANUALS),\
+ $(if $(findstring $(manual), $(TOPDIR_HTML_MANUALS)),,$(manual)))
+
+OUT_HTML_FILES = $(UNSPLIT_HTML_MANUALS:%=$(outdir)/%.html)\
+ $(SPLIT_HTML_MANUALS:%=$(outdir)/%-big-page.html)
+DEEP_HTML_FILES = $(NOT_TOPDIR_HTML_MANUALS:%=$(outdir)/%/index.html)
+
+# Symlinks to refer to external source documents from split and non-split HTML
+source-links = $(outdir)/source\
+ $(foreach manual, $(SPLIT_HTML_MANUALS), $(outdir)/$(manual)/source)
+
+# Other out files
+
+MAIN_INFO_DOC = lilypond-web
+INFO_DOCS = lilypond-usage lilypond-changes lilypond-contributor lilypond-internals \
+ lilypond-essay lilypond-learning lilypond-notation music-glossary \
+ lilypond-web lilypond-extending
+ifeq ($(out),www)
+INFO_DOCS += lilypond-snippets
+endif
+INFO_FILES = $(INFO_DOCS:%=$(outdir)/%.info)
+
+ifeq ($(out),www)
+INFO_IMAGES_DIR = lilypond
+DEST_INFO_IMAGES_SUBDIR = Documentation
+endif