-
Notifications
You must be signed in to change notification settings - Fork 250
/
Copy pathMakefile.in
69 lines (55 loc) · 1.9 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Source files for manual pages are listed in conf.py in variable man_pages
# You can set these variables from the command line, and also from the
# environment for the first two.
SPHINXOPTS ?= -N
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
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
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
man5dir = $(mandir)/man5
man8dir = $(mandir)/man8
.PHONY: all man help
# Build manual pages by default
all: man
# Workaround for old sphinx that requires the contents.rst file
man:
@if [ "$$(sphinx-build --version | cut -d' ' -f2)" \< "1.7.7" ]; then \
touch contents.rst; \
fi
$(QUIET_SPHINX)$(SPHINXBUILD) -M man "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
install: man
$(INSTALL) -d -m 755 $(DESTDIR)$(man2dir)
$(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
$(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
$(INSTALL) -m 644 $(BUILDDIR)/man/*.2 $(DESTDIR)$(man2dir)
$(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)/*
$(QUIET_RM)$(RM) -df -- $(BUILDDIR)
$(QUIET_RM)$(RM) -f contents.rst
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%:
$(QUIET_SPHINX)$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)