2022-01-13 17:18:24 +00:00
|
|
|
# Source files for manual pages are listed in conf.py in variable man_pages
|
2021-11-11 15:45:40 +00:00
|
|
|
|
2022-01-13 17:18:24 +00:00
|
|
|
# You can set these variables from the command line, and also from the
|
|
|
|
# environment for the first two.
|
|
|
|
SPHINXOPTS ?= -N
|
2021-11-11 15:45:40 +00:00
|
|
|
SPHINXBUILD ?= sphinx-build
|
|
|
|
SOURCEDIR = .
|
|
|
|
BUILDDIR = _build
|
|
|
|
|
2022-01-13 17:18:24 +00:00
|
|
|
INSTALL = @INSTALL@
|
|
|
|
RM = @RM@
|
|
|
|
RMDIR = @RMDIR@
|
|
|
|
LN_S = @LN_S@
|
|
|
|
SED = @SED@
|
|
|
|
BTRFS_VERSION = $(shell $(SED) -n 's/.*PACKAGE_VERSION "\(.*\)"/\1/p' ../config.h)
|
|
|
|
|
|
|
|
ifneq ($(findstring $(MAKEFLAGS),s),s)
|
|
|
|
ifndef V
|
|
|
|
QUIET_RM = @
|
|
|
|
QUIET_SPHINX = @echo " [SPHINX] $@";
|
|
|
|
SPHINXOPTS += -q
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
mandir ?= $(prefix)/share/man
|
2024-09-12 10:08:29 +00:00
|
|
|
man2dir = $(mandir)/man2
|
2022-01-13 17:18:24 +00:00
|
|
|
man3dir = $(mandir)/man3
|
|
|
|
man5dir = $(mandir)/man5
|
|
|
|
man8dir = $(mandir)/man8
|
|
|
|
|
|
|
|
.PHONY: all man help
|
2024-04-25 23:00:22 +00:00
|
|
|
|
|
|
|
# Build manual pages by default
|
|
|
|
all: man
|
2024-01-10 17:25:23 +00:00
|
|
|
|
|
|
|
# Workaround for old sphinx that requires the contents.rst file
|
2024-04-25 23:00:22 +00:00
|
|
|
man:
|
2024-01-10 17:25:23 +00:00
|
|
|
@if [ "$$(sphinx-build --version | cut -d' ' -f2)" \< "1.7.7" ]; then \
|
|
|
|
touch contents.rst; \
|
|
|
|
fi
|
2022-01-13 17:18:24 +00:00
|
|
|
|
|
|
|
$(QUIET_SPHINX)$(SPHINXBUILD) -M man "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
|
|
|
2021-11-11 15:45:40 +00:00
|
|
|
help:
|
|
|
|
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
|
|
|
2022-01-13 17:18:24 +00:00
|
|
|
install: man
|
2024-09-12 10:08:29 +00:00
|
|
|
$(INSTALL) -d -m 755 $(DESTDIR)$(man2dir)
|
2022-01-13 17:18:24 +00:00
|
|
|
$(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
|
|
|
|
$(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
|
2024-09-12 10:08:29 +00:00
|
|
|
$(INSTALL) -m 644 $(BUILDDIR)/man/*.2 $(DESTDIR)$(man2dir)
|
2022-01-13 17:18:24 +00:00
|
|
|
$(INSTALL) -m 644 $(BUILDDIR)/man/*.5 $(DESTDIR)$(man5dir)
|
|
|
|
$(INSTALL) -m 644 $(BUILDDIR)/man/*.8 $(DESTDIR)$(man8dir)
|
|
|
|
$(INSTALL) -m 644 btrfsck.8 $(DESTDIR)$(man8dir)
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
cd $(DESTDIR)$(man8dir); rm -f btrfs-check.8 $(MAN8)
|
|
|
|
$(RMDIR) -p --ignore-fail-on-non-empty $(DESTDIR)$(man8dir)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(QUIET_RM)$(RM) -rf $(BUILDDIR)/*
|
2022-02-09 17:28:59 +00:00
|
|
|
$(QUIET_RM)$(RM) -df -- $(BUILDDIR)
|
2024-01-10 17:25:23 +00:00
|
|
|
$(QUIET_RM)$(RM) -f contents.rst
|
|
|
|
|
2021-11-11 15:45:40 +00:00
|
|
|
|
|
|
|
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
|
|
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
2022-01-13 17:18:24 +00:00
|
|
|
%:
|
|
|
|
$(QUIET_SPHINX)$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|