2016-09-20 14:31:23 +00:00
|
|
|
|
|
|
|
ifeq ($(doc_generate),yes)
|
|
|
|
|
2014-02-01 10:30:21 +00:00
|
|
|
XSLTPROC = $(xsltproc) --nonet $(xmlflags) \
|
|
|
|
--param section.autolabel 1 \
|
|
|
|
--param section.label.includes.component.label 1 \
|
|
|
|
--param xref.with.number.and.title 1 \
|
|
|
|
--param toc.section.depth 3 \
|
|
|
|
--param admon.style \'\' \
|
2020-03-13 15:32:43 +00:00
|
|
|
--param callout.graphics 0 \
|
2014-09-16 13:37:38 +00:00
|
|
|
--param contrib.inline.enabled 0 \
|
2014-12-14 00:22:57 +00:00
|
|
|
--stringparam generate.toc "book toc" \
|
|
|
|
--param keep.relative.image.uris 0
|
2014-02-01 10:30:21 +00:00
|
|
|
|
2016-07-04 18:13:20 +00:00
|
|
|
docbookxsl = http://docbook.sourceforge.net/release/xsl-ns/current
|
2014-12-11 09:44:02 +00:00
|
|
|
docbookrng = http://docbook.org/xml/5.0/rng/docbook.rng
|
2014-11-25 14:54:26 +00:00
|
|
|
|
2014-09-16 12:14:09 +00:00
|
|
|
MANUAL_SRCS := $(call rwildcard, $(d), *.xml)
|
2014-02-01 10:30:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Do XInclude processing / RelaxNG validation
|
|
|
|
$(d)/manual.xmli: $(d)/manual.xml $(MANUAL_SRCS) $(d)/version.txt
|
|
|
|
$(trace-gen) $(xmllint) --nonet --xinclude $< -o $@.tmp
|
|
|
|
@mv $@.tmp $@
|
|
|
|
|
|
|
|
$(d)/version.txt:
|
|
|
|
$(trace-gen) echo -n $(PACKAGE_VERSION) > $@
|
|
|
|
|
|
|
|
# Note: RelaxNG validation requires xmllint >= 2.7.4.
|
|
|
|
$(d)/manual.is-valid: $(d)/manual.xmli
|
|
|
|
$(trace-gen) $(XSLTPROC) --novalid --stringparam profile.condition manual \
|
|
|
|
$(docbookxsl)/profiling/profile.xsl $< 2> /dev/null | \
|
2014-12-10 23:07:50 +00:00
|
|
|
$(xmllint) --nonet --noout --relaxng $(docbookrng) -
|
2014-02-01 10:30:21 +00:00
|
|
|
@touch $@
|
|
|
|
|
2014-02-01 11:23:14 +00:00
|
|
|
clean-files += $(d)/manual.xmli $(d)/version.txt $(d)/manual.is-valid
|
2014-02-01 10:30:21 +00:00
|
|
|
|
2014-02-01 14:18:48 +00:00
|
|
|
dist-files += $(d)/manual.xmli $(d)/version.txt $(d)/manual.is-valid
|
2014-02-01 13:28:31 +00:00
|
|
|
|
2014-02-01 10:30:21 +00:00
|
|
|
|
|
|
|
# Generate man pages.
|
|
|
|
man-pages := $(foreach n, \
|
|
|
|
nix-env.1 nix-build.1 nix-shell.1 nix-store.1 nix-instantiate.1 \
|
2016-08-10 15:13:11 +00:00
|
|
|
nix-collect-garbage.1 \
|
2014-12-14 00:29:35 +00:00
|
|
|
nix-prefetch-url.1 nix-channel.1 \
|
2016-08-10 12:20:51 +00:00
|
|
|
nix-hash.1 nix-copy-closure.1 \
|
2014-02-01 10:30:21 +00:00
|
|
|
nix.conf.5 nix-daemon.8, \
|
|
|
|
$(d)/$(n))
|
|
|
|
|
2014-09-16 13:29:55 +00:00
|
|
|
$(firstword $(man-pages)): $(d)/manual.xmli $(d)/manual.is-valid
|
|
|
|
$(trace-gen) $(XSLTPROC) --novalid --stringparam profile.condition manpage \
|
2014-02-01 10:30:21 +00:00
|
|
|
$(docbookxsl)/profiling/profile.xsl $< 2> /dev/null | \
|
|
|
|
(cd doc/manual && $(XSLTPROC) $(docbookxsl)/manpages/docbook.xsl -)
|
|
|
|
|
2014-09-16 13:29:55 +00:00
|
|
|
$(wordlist 2, $(words $(man-pages)), $(man-pages)): $(firstword $(man-pages))
|
|
|
|
|
2014-02-01 11:23:14 +00:00
|
|
|
clean-files += $(d)/*.1 $(d)/*.5 $(d)/*.8
|
2014-02-01 10:30:21 +00:00
|
|
|
|
2014-02-01 15:30:24 +00:00
|
|
|
dist-files += $(man-pages)
|
2014-02-01 14:18:48 +00:00
|
|
|
|
2014-02-01 10:30:21 +00:00
|
|
|
|
|
|
|
# Generate the HTML manual.
|
|
|
|
$(d)/manual.html: $(d)/manual.xml $(MANUAL_SRCS) $(d)/manual.is-valid
|
|
|
|
$(trace-gen) $(XSLTPROC) --xinclude --stringparam profile.condition manual \
|
|
|
|
$(docbookxsl)/profiling/profile.xsl $< | \
|
2014-07-03 10:36:58 +00:00
|
|
|
$(XSLTPROC) --output $@ $(docbookxsl)/xhtml/docbook.xsl -
|
2014-02-01 10:30:21 +00:00
|
|
|
|
2020-03-13 14:00:08 +00:00
|
|
|
$(foreach file, $(d)/manual.html, $(eval $(call install-data-in, $(file), $(docdir)/manual)))
|
2014-02-01 10:30:21 +00:00
|
|
|
|
|
|
|
$(foreach file, $(wildcard $(d)/figures/*.png), $(eval $(call install-data-in, $(file), $(docdir)/manual/figures)))
|
|
|
|
|
|
|
|
$(eval $(call install-symlink, manual.html, $(docdir)/manual/index.html))
|
|
|
|
|
2016-09-20 14:31:23 +00:00
|
|
|
|
2014-02-01 10:30:21 +00:00
|
|
|
all: $(d)/manual.html
|
|
|
|
|
2016-09-20 14:31:23 +00:00
|
|
|
|
|
|
|
|
2014-02-01 11:23:14 +00:00
|
|
|
clean-files += $(d)/manual.html
|
2014-02-01 10:30:21 +00:00
|
|
|
|
2014-02-01 13:28:31 +00:00
|
|
|
dist-files += $(d)/manual.html
|
2016-09-20 14:31:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
endif
|