MAN8_TXT =
# Top level commands
-MAN8_TXT += btrfs.txt
-MAN8_TXT += btrfs-convert.txt
-MAN8_TXT += btrfs-debug-tree.txt
-MAN8_TXT += btrfs-find-root.txt
-MAN8_TXT += btrfs-image.txt
-MAN8_TXT += btrfs-map-logical.txt
-MAN8_TXT += btrfs-show-super.txt
-MAN8_TXT += btrfstune.txt
-MAN8_TXT += btrfs-zero-log.txt
-MAN8_TXT += fsck.btrfs.txt
-MAN8_TXT += mkfs.btrfs.txt
+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
+MAN8_TXT += btrfs-select-super.asciidoc
+MAN8_TXT += btrfstune.asciidoc
+MAN8_TXT += fsck.btrfs.asciidoc
+MAN8_TXT += mkfs.btrfs.asciidoc
# Sub commands for btrfs
-MAN8_TXT += btrfs-subvolume.txt
-MAN8_TXT += btrfs-filesystem.txt
-MAN8_TXT += btrfs-balance.txt
-MAN8_TXT += btrfs-device.txt
-MAN8_TXT += btrfs-scrub.txt
-MAN8_TXT += btrfs-check.txt
-MAN8_TXT += btrfs-rescue.txt
-MAN8_TXT += btrfs-inspect-internal.txt
-MAN8_TXT += btrfs-send.txt
-MAN8_TXT += btrfs-receive.txt
-MAN8_TXT += btrfs-quota.txt
-MAN8_TXT += btrfs-qgroup.txt
-MAN8_TXT += btrfs-replace.txt
-MAN8_TXT += btrfs-restore.txt
-MAN8_TXT += btrfs-property.txt
-
-# Mount manpage
-MAN5_TXT += btrfs-mount.txt
+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
+
+# Category 5 manual page
+MAN5_TXT += btrfs-man5.asciidoc
MAN_TXT = $(MAN8_TXT) $(MAN5_TXT)
-MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT))
+MAN_XML = $(patsubst %.asciidoc,%.xml,$(MAN_TXT))
+MAN_HTML = $(patsubst %.asciidoc,%.html,$(MAN_TXT))
-DOC_MAN5 = $(patsubst %.txt,%.5,$(MAN5_TXT))
-GZ_MAN5 = $(patsubst %.txt,%.5.gz,$(MAN5_TXT))
+DOC_MAN5 = $(patsubst %.asciidoc,%.5,$(MAN5_TXT))
+GZ_MAN5 = $(patsubst %.asciidoc,%.5.gz,$(MAN5_TXT))
-DOC_MAN8 = $(patsubst %.txt,%.8,$(MAN8_TXT))
-GZ_MAN8 = $(patsubst %.txt,%.8.gz,$(MAN8_TXT))
+DOC_MAN8 = $(patsubst %.asciidoc,%.8,$(MAN8_TXT))
+GZ_MAN8 = $(patsubst %.asciidoc,%.8.gz,$(MAN8_TXT))
mandir ?= $(prefix)/share/man
man8dir = $(mandir)/man8
man5dir = $(mandir)/man5
-ASCIIDOC = asciidoc
+ASCIIDOC = @ASCIIDOC@
ASCIIDOC_EXTRA =
MANPAGE_XSL = manpage-normal.xsl
-XMLTO = xmlto
+XMLTO = @XMLTO@
XMLTO_EXTRA =
XMLTO_EXTRA = -m manpage-bold-literal.xsl
-GZIPCMD = gzip
-INSTALL ?= install
-RM ?= rm
-LN_S ?= ln -s
-BTRFS_VERSION = $(shell sed -n 's/.*BTRFS_BUILD_VERSION "Btrfs \(.*\)"/\1/p'\
- ../version.h)
+GZIPCMD = @GZIP@
+INSTALL = @INSTALL@
+RM = @RM@
+RMDIR = @RMDIR@
+LN_S = @LN_S@
+MV = @MV@
+SED = @SED@
+BTRFS_VERSION = $(shell $(SED) -n 's/.*PACKAGE_VERSION "\(.*\)"/\1/p'\
+ ../config.h)
ifneq ($(findstring $(MAKEFLAGS),s),s)
ifndef V
man: man5 man8
man5: $(GZ_MAN5)
man8: $(GZ_MAN8)
+html: $(MAN_HTML)
install: install-man
$(INSTALL) -m 644 $(GZ_MAN5) $(DESTDIR)$(man5dir)
# the source file name of btrfs.5 clashes with section 8 page, but we
# want to keep the code generic
- mv $(DESTDIR)$(man5dir)/btrfs-mount.5.gz $(DESTDIR)$(man5dir)/btrfs.5.gz
+ $(MV) $(DESTDIR)$(man5dir)/btrfs-man5.5.gz $(DESTDIR)$(man5dir)/btrfs.5.gz
$(INSTALL) -m 644 $(GZ_MAN8) $(DESTDIR)$(man8dir)
$(LN_S) -f btrfs-check.8.gz $(DESTDIR)$(man8dir)/btrfsck.8.gz
+ $(LN_S) -f btrfs-rescue.8.gz $(DESTDIR)$(man8dir)/btrfs-zero-log.8.gz
+ $(LN_S) -f btrfs-inspect-internal.8.gz $(DESTDIR)$(man8dir)/btrfs-debug-tree.8.gz
+ $(LN_S) -f btrfs-inspect-internal.8.gz $(DESTDIR)$(man8dir)/btrfs-show-super.8.gz
uninstall:
cd $(DESTDIR)$(man8dir); rm -f btrfs-check.8.gz $(GZ_MAN8)
- rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(man8dir)
+ $(RMDIR) -p --ignore-fail-on-non-empty $(DESTDIR)$(man8dir)
clean:
- $(QUIET_RM)$(RM) -f *.xml *.xml+ *.5 *.5.gz *.8 *.8.gz
+ $(QUIET_RM)$(RM) -f *.xml *.xml+ *.5 *.5.gz *.8 *.8.gz *.html
%.5.gz : %.5
$(QUIET_GZIP)$(GZIPCMD) -n -c $< > $@
$(QUIET_XMLTO)$(RM) -f $@ && \
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
-%.xml : %.txt asciidoc.conf
+%.xml : %.asciidoc asciidoc.conf
$(QUIET_ASCIIDOC)$(RM) -f $@+ $@ && \
$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
$(ASCIIDOC_EXTRA) -abtrfs_version=$(BTRFS_VERSION) \
-o $@+ $< && \
- mv $@+ $@
+ $(MV) $@+ $@
+
+%.html : %.asciidoc asciidoc.conf
+ $(QUIET_ASCIIDOC)$(RM) -f $@+ $@ && \
+ $(ASCIIDOC) -b html -d article -f asciidoc.conf \
+ $(ASCIIDOC_EXTRA) -abtrfs_version=$(BTRFS_VERSION) \
+ -o $@+ $< && \
+ $(MV) $@+ $@