1 # Guard against environment variables
5 MAN8_TXT += btrfs.asciidoc
6 MAN8_TXT += btrfs-convert.asciidoc
7 MAN8_TXT += btrfs-debug-tree.asciidoc
8 MAN8_TXT += btrfs-find-root.asciidoc
9 MAN8_TXT += btrfs-image.asciidoc
10 MAN8_TXT += btrfs-map-logical.asciidoc
11 MAN8_TXT += btrfs-show-super.asciidoc
12 MAN8_TXT += btrfstune.asciidoc
13 MAN8_TXT += fsck.btrfs.asciidoc
14 MAN8_TXT += mkfs.btrfs.asciidoc
16 # Sub commands for btrfs
17 MAN8_TXT += btrfs-subvolume.asciidoc
18 MAN8_TXT += btrfs-filesystem.asciidoc
19 MAN8_TXT += btrfs-balance.asciidoc
20 MAN8_TXT += btrfs-device.asciidoc
21 MAN8_TXT += btrfs-scrub.asciidoc
22 MAN8_TXT += btrfs-check.asciidoc
23 MAN8_TXT += btrfs-rescue.asciidoc
24 MAN8_TXT += btrfs-inspect-internal.asciidoc
25 MAN8_TXT += btrfs-send.asciidoc
26 MAN8_TXT += btrfs-receive.asciidoc
27 MAN8_TXT += btrfs-quota.asciidoc
28 MAN8_TXT += btrfs-qgroup.asciidoc
29 MAN8_TXT += btrfs-replace.asciidoc
30 MAN8_TXT += btrfs-restore.asciidoc
31 MAN8_TXT += btrfs-property.asciidoc
34 MAN5_TXT += btrfs-mount.asciidoc
36 MAN_TXT = $(MAN8_TXT) $(MAN5_TXT)
37 MAN_XML = $(patsubst %.asciidoc,%.xml,$(MAN_TXT))
39 DOC_MAN5 = $(patsubst %.asciidoc,%.5,$(MAN5_TXT))
40 GZ_MAN5 = $(patsubst %.asciidoc,%.5.gz,$(MAN5_TXT))
42 DOC_MAN8 = $(patsubst %.asciidoc,%.8,$(MAN8_TXT))
43 GZ_MAN8 = $(patsubst %.asciidoc,%.8.gz,$(MAN8_TXT))
45 mandir ?= $(prefix)/share/man
46 man8dir = $(mandir)/man8
47 man5dir = $(mandir)/man5
51 MANPAGE_XSL = manpage-normal.xsl
54 XMLTO_EXTRA = -m manpage-bold-literal.xsl
62 BTRFS_VERSION = $(shell $(SED) -n 's/.*PACKAGE_VERSION "\(.*\)"/\1/p'\
65 ifneq ($(findstring $(MAKEFLAGS),s),s)
68 QUIET_ASCIIDOC = @echo " [ASCII] $@";
69 QUIET_XMLTO = @echo " [XMLTO] $@";
70 QUIET_GZIP = @echo " [GZ] $@";
71 QUIET_STDERR = 2> /dev/null
72 QUIET_SUBDIR0 = +@subdir=
73 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
74 $(MAKE) $(PRINT_DIR) -C $$subdir
87 $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
88 $(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
89 $(INSTALL) -m 644 $(GZ_MAN5) $(DESTDIR)$(man5dir)
90 # the source file name of btrfs.5 clashes with section 8 page, but we
91 # want to keep the code generic
92 $(MV) $(DESTDIR)$(man5dir)/btrfs-mount.5.gz $(DESTDIR)$(man5dir)/btrfs.5.gz
93 $(INSTALL) -m 644 $(GZ_MAN8) $(DESTDIR)$(man8dir)
94 $(LN_S) -f btrfs-check.8.gz $(DESTDIR)$(man8dir)/btrfsck.8.gz
95 $(LN_S) -f btrfs-rescue.8.gz $(DESTDIR)$(man8dir)/btrfs-zero-log.8.gz
98 cd $(DESTDIR)$(man8dir); rm -f btrfs-check.8.gz $(GZ_MAN8)
99 $(RMDIR) -p --ignore-fail-on-non-empty $(DESTDIR)$(man8dir)
102 $(QUIET_RM)$(RM) -f *.xml *.xml+ *.5 *.5.gz *.8 *.8.gz
105 $(QUIET_GZIP)$(GZIPCMD) -n -c $< > $@
108 $(QUIET_GZIP)$(GZIPCMD) -n -c $< > $@
111 $(QUIET_XMLTO)$(RM) -f $@ && \
112 $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
115 $(QUIET_XMLTO)$(RM) -f $@ && \
116 $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
118 %.xml : %.asciidoc asciidoc.conf
119 $(QUIET_ASCIIDOC)$(RM) -f $@+ $@ && \
120 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
121 $(ASCIIDOC_EXTRA) -abtrfs_version=$(BTRFS_VERSION) \