2021-11-11 15:45:40 +00:00
|
|
|
ifeq (@ASCIIDOC_TOOL@,sphinx)
|
|
|
|
$(info "sphinx build, rst")
|
|
|
|
|
|
|
|
# Minimal makefile for Sphinx documentation
|
|
|
|
#
|
|
|
|
|
|
|
|
# You can set these variables from the command line, and also
|
|
|
|
# from the environment for the first two.
|
|
|
|
SPHINXOPTS ?=
|
|
|
|
SPHINXBUILD ?= sphinx-build
|
|
|
|
SOURCEDIR = .
|
|
|
|
BUILDDIR = _build
|
|
|
|
|
|
|
|
# Put it first so that "make" without argument is like "make help".
|
|
|
|
help:
|
|
|
|
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
|
|
|
|
|
|
.PHONY: help Makefile Makefile.in
|
|
|
|
|
|
|
|
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
|
|
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
|
|
%: Makefile Makefile.in
|
|
|
|
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
2014-04-02 08:29:12 +00:00
|
|
|
# Guard against environment variables
|
|
|
|
MAN8_TXT =
|
|
|
|
|
|
|
|
# Top level commands
|
2015-04-14 15:37:23 +00:00
|
|
|
MAN8_TXT += btrfs.asciidoc
|
|
|
|
MAN8_TXT += btrfs-convert.asciidoc
|
|
|
|
MAN8_TXT += btrfs-find-root.asciidoc
|
|
|
|
MAN8_TXT += btrfs-image.asciidoc
|
|
|
|
MAN8_TXT += btrfs-map-logical.asciidoc
|
2015-09-02 03:00:46 +00:00
|
|
|
MAN8_TXT += btrfs-select-super.asciidoc
|
2015-04-14 15:37:23 +00:00
|
|
|
MAN8_TXT += btrfstune.asciidoc
|
|
|
|
MAN8_TXT += fsck.btrfs.asciidoc
|
|
|
|
MAN8_TXT += mkfs.btrfs.asciidoc
|
2014-04-02 08:29:12 +00:00
|
|
|
|
|
|
|
# Sub commands for btrfs
|
2015-04-14 15:37:23 +00:00
|
|
|
MAN8_TXT += btrfs-subvolume.asciidoc
|
|
|
|
MAN8_TXT += btrfs-filesystem.asciidoc
|
|
|
|
MAN8_TXT += btrfs-balance.asciidoc
|
|
|
|
MAN8_TXT += btrfs-device.asciidoc
|
|
|
|
MAN8_TXT += btrfs-scrub.asciidoc
|
|
|
|
MAN8_TXT += btrfs-check.asciidoc
|
|
|
|
MAN8_TXT += btrfs-rescue.asciidoc
|
|
|
|
MAN8_TXT += btrfs-inspect-internal.asciidoc
|
|
|
|
MAN8_TXT += btrfs-send.asciidoc
|
|
|
|
MAN8_TXT += btrfs-receive.asciidoc
|
|
|
|
MAN8_TXT += btrfs-quota.asciidoc
|
|
|
|
MAN8_TXT += btrfs-qgroup.asciidoc
|
|
|
|
MAN8_TXT += btrfs-replace.asciidoc
|
|
|
|
MAN8_TXT += btrfs-restore.asciidoc
|
|
|
|
MAN8_TXT += btrfs-property.asciidoc
|
2014-04-02 08:29:12 +00:00
|
|
|
|
2016-01-11 14:32:38 +00:00
|
|
|
# Category 5 manual page
|
|
|
|
MAN5_TXT += btrfs-man5.asciidoc
|
2014-06-11 22:14:55 +00:00
|
|
|
|
2017-09-11 18:26:04 +00:00
|
|
|
MAN3_TXT += btrfs-ioctl.asciidoc
|
|
|
|
|
|
|
|
MAN_TXT = $(MAN3_TXT) $(MAN8_TXT) $(MAN5_TXT)
|
2015-04-14 15:37:23 +00:00
|
|
|
MAN_XML = $(patsubst %.asciidoc,%.xml,$(MAN_TXT))
|
2015-10-07 12:36:34 +00:00
|
|
|
MAN_HTML = $(patsubst %.asciidoc,%.html,$(MAN_TXT))
|
2018-08-06 20:54:31 +00:00
|
|
|
MAN3 = $(patsubst %.asciidoc,%.3,$(MAN3_TXT))
|
|
|
|
MAN5 = $(patsubst %.asciidoc,%.5,$(MAN5_TXT))
|
|
|
|
MAN8 = $(patsubst %.asciidoc,%.8,$(MAN8_TXT))
|
2014-04-02 08:29:12 +00:00
|
|
|
|
|
|
|
mandir ?= $(prefix)/share/man
|
2017-09-11 18:26:04 +00:00
|
|
|
man3dir = $(mandir)/man3
|
2014-06-11 22:14:55 +00:00
|
|
|
man5dir = $(mandir)/man5
|
2017-09-11 18:26:04 +00:00
|
|
|
man8dir = $(mandir)/man8
|
2014-04-02 08:29:12 +00:00
|
|
|
|
2019-09-10 16:08:19 +00:00
|
|
|
XMLTO = @XMLTO@
|
|
|
|
XMLTO_EXTRA = -m manpage-bold-literal.xsl
|
|
|
|
|
2018-02-02 19:51:25 +00:00
|
|
|
ifeq (@ASCIIDOC_TOOL@,asciidoc)
|
2015-02-03 14:38:17 +00:00
|
|
|
ASCIIDOC = @ASCIIDOC@
|
2018-02-02 19:51:25 +00:00
|
|
|
ASCIIDOC_ARGS = -abtrfs_version=$(BTRFS_VERSION) -f asciidoc.conf
|
|
|
|
ASCIIDOC_HTML = html
|
|
|
|
ASCIIDOC_DOCBOOK = docbook
|
|
|
|
ASCIIDOC_DEPS = asciidoc.conf
|
|
|
|
endif
|
|
|
|
ifeq (@ASCIIDOC_TOOL@,asciidoctor)
|
|
|
|
ASCIIDOC = @ASCIIDOCTOR@
|
|
|
|
ASCIIDOC_ARGS = -abtrfs_version=$(BTRFS_VERSION)
|
|
|
|
ASCIIDOC_HTML = xhtml5
|
2019-09-10 16:08:19 +00:00
|
|
|
ASCIIDOC_DOCBOOK = docbook5
|
|
|
|
XMLTO_EXTRA += --skip-validation
|
2018-02-02 19:51:25 +00:00
|
|
|
ASCIIDOC_DEPS =
|
|
|
|
endif
|
|
|
|
|
2014-04-02 08:29:12 +00:00
|
|
|
MANPAGE_XSL = manpage-normal.xsl
|
2015-02-03 13:56:06 +00:00
|
|
|
INSTALL = @INSTALL@
|
|
|
|
RM = @RM@
|
|
|
|
RMDIR = @RMDIR@
|
|
|
|
LN_S = @LN_S@
|
2015-02-03 14:38:17 +00:00
|
|
|
MV = @MV@
|
|
|
|
SED = @SED@
|
|
|
|
BTRFS_VERSION = $(shell $(SED) -n 's/.*PACKAGE_VERSION "\(.*\)"/\1/p'\
|
2015-02-03 14:04:28 +00:00
|
|
|
../config.h)
|
2014-04-02 08:29:12 +00:00
|
|
|
|
|
|
|
ifneq ($(findstring $(MAKEFLAGS),s),s)
|
|
|
|
ifndef V
|
2014-05-30 16:27:14 +00:00
|
|
|
QUIET_RM = @
|
|
|
|
QUIET_ASCIIDOC = @echo " [ASCII] $@";
|
|
|
|
QUIET_XMLTO = @echo " [XMLTO] $@";
|
2014-04-02 08:29:12 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: man
|
2017-09-11 18:26:04 +00:00
|
|
|
man: man3 man5 man8
|
2018-08-06 20:54:31 +00:00
|
|
|
man3: $(MAN3)
|
|
|
|
man5: $(MAN5)
|
|
|
|
man8: $(MAN8)
|
2015-10-07 12:36:34 +00:00
|
|
|
html: $(MAN_HTML)
|
2014-04-02 08:29:12 +00:00
|
|
|
|
|
|
|
install: install-man
|
|
|
|
|
|
|
|
install-man: man
|
2014-06-11 22:14:55 +00:00
|
|
|
$(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
|
2014-04-02 08:29:12 +00:00
|
|
|
$(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
|
2018-08-06 20:54:31 +00:00
|
|
|
$(INSTALL) -m 644 $(MAN5) $(DESTDIR)$(man5dir)
|
2014-06-18 15:17:38 +00:00
|
|
|
# the source file name of btrfs.5 clashes with section 8 page, but we
|
|
|
|
# want to keep the code generic
|
2018-08-06 20:54:31 +00:00
|
|
|
$(MV) $(DESTDIR)$(man5dir)/btrfs-man5.5 $(DESTDIR)$(man5dir)/btrfs.5
|
|
|
|
$(INSTALL) -m 644 $(MAN8) $(DESTDIR)$(man8dir)
|
2018-09-11 14:56:37 +00:00
|
|
|
$(INSTALL) -m 644 btrfsck.8 $(DESTDIR)$(man8dir)
|
2014-04-02 08:29:12 +00:00
|
|
|
|
2014-07-25 13:41:57 +00:00
|
|
|
uninstall:
|
2018-08-06 20:54:31 +00:00
|
|
|
cd $(DESTDIR)$(man8dir); rm -f btrfs-check.8 $(MAN8)
|
2015-02-03 13:56:06 +00:00
|
|
|
$(RMDIR) -p --ignore-fail-on-non-empty $(DESTDIR)$(man8dir)
|
2014-07-25 13:41:57 +00:00
|
|
|
|
2014-04-02 08:29:12 +00:00
|
|
|
clean:
|
2018-09-11 15:19:18 +00:00
|
|
|
$(QUIET_RM)$(RM) -f $(MAN_XML) *.xml+ $(MAN3) $(MAN5) $(MAN8) $(MAN_HTML)
|
2014-04-02 08:29:12 +00:00
|
|
|
|
2017-09-11 18:26:04 +00:00
|
|
|
%.3 : %.xml
|
|
|
|
$(QUIET_XMLTO)$(RM) -f $@ && \
|
|
|
|
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
|
|
|
|
|
2014-06-11 22:14:55 +00:00
|
|
|
%.5 : %.xml
|
2015-02-03 13:40:33 +00:00
|
|
|
$(QUIET_XMLTO)$(RM) -f $@ && \
|
2014-06-11 22:14:55 +00:00
|
|
|
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
|
|
|
|
|
2014-06-03 06:09:25 +00:00
|
|
|
%.8 : %.xml
|
2015-02-03 13:40:33 +00:00
|
|
|
$(QUIET_XMLTO)$(RM) -f $@ && \
|
2014-04-02 08:29:12 +00:00
|
|
|
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
|
2014-06-11 22:14:55 +00:00
|
|
|
|
2018-02-02 19:51:25 +00:00
|
|
|
%.xml : %.asciidoc $(ASCIIDOC_DEPS)
|
2015-02-03 13:40:33 +00:00
|
|
|
$(QUIET_ASCIIDOC)$(RM) -f $@+ $@ && \
|
2018-02-02 19:51:25 +00:00
|
|
|
$(ASCIIDOC) $(ASCIIDOC_ARGS) -b $(ASCIIDOC_DOCBOOK) -d manpage -o $@+ $< && \
|
2015-02-03 14:38:17 +00:00
|
|
|
$(MV) $@+ $@
|
2015-10-07 12:36:34 +00:00
|
|
|
|
2018-02-02 19:51:25 +00:00
|
|
|
%.html : %.asciidoc $(ASCIIDOC_DEPS)
|
2015-10-07 12:36:34 +00:00
|
|
|
$(QUIET_ASCIIDOC)$(RM) -f $@+ $@ && \
|
2018-02-02 19:51:25 +00:00
|
|
|
$(ASCIIDOC) $(ASCIIDOC_ARGS) -b $(ASCIIDOC_HTML) -d article -o $@+ $< && \
|
2015-10-07 12:36:34 +00:00
|
|
|
$(MV) $@+ $@
|
2021-11-11 15:45:40 +00:00
|
|
|
|
|
|
|
endif
|