2014-04-02 08:29:12 +00:00
|
|
|
# Guard against environment variables
|
|
|
|
MAN8_TXT =
|
|
|
|
|
|
|
|
# Top level commands
|
|
|
|
MAN8_TXT += btrfs.txt
|
2014-04-02 08:29:28 +00:00
|
|
|
MAN8_TXT += btrfs-convert.txt
|
2014-04-02 08:29:29 +00:00
|
|
|
MAN8_TXT += btrfs-debug-tree.txt
|
2014-04-02 08:29:30 +00:00
|
|
|
MAN8_TXT += btrfs-find-root.txt
|
2014-04-02 08:29:31 +00:00
|
|
|
MAN8_TXT += btrfs-image.txt
|
2014-04-02 08:29:32 +00:00
|
|
|
MAN8_TXT += btrfs-map-logical.txt
|
2014-04-02 08:29:33 +00:00
|
|
|
MAN8_TXT += btrfs-show-super.txt
|
2014-04-02 08:29:34 +00:00
|
|
|
MAN8_TXT += btrfstune.txt
|
2014-04-02 08:29:35 +00:00
|
|
|
MAN8_TXT += btrfs-zero-log.txt
|
2014-04-02 08:29:36 +00:00
|
|
|
MAN8_TXT += fsck.btrfs.txt
|
2014-04-02 08:29:37 +00:00
|
|
|
MAN8_TXT += mkfs.btrfs.txt
|
2014-04-02 08:29:12 +00:00
|
|
|
|
|
|
|
# Sub commands for btrfs
|
2014-04-02 08:29:13 +00:00
|
|
|
MAN8_TXT += btrfs-subvolume.txt
|
2014-04-02 08:29:14 +00:00
|
|
|
MAN8_TXT += btrfs-filesystem.txt
|
2014-04-02 08:29:15 +00:00
|
|
|
MAN8_TXT += btrfs-balance.txt
|
2014-04-02 08:29:16 +00:00
|
|
|
MAN8_TXT += btrfs-device.txt
|
2014-04-02 08:29:17 +00:00
|
|
|
MAN8_TXT += btrfs-scrub.txt
|
2014-04-02 08:29:18 +00:00
|
|
|
MAN8_TXT += btrfs-check.txt
|
2014-04-02 08:29:19 +00:00
|
|
|
MAN8_TXT += btrfs-rescue.txt
|
2014-04-02 08:29:20 +00:00
|
|
|
MAN8_TXT += btrfs-inspect-internal.txt
|
2014-04-02 08:29:21 +00:00
|
|
|
MAN8_TXT += btrfs-send.txt
|
2014-04-02 08:29:22 +00:00
|
|
|
MAN8_TXT += btrfs-receive.txt
|
2014-04-02 08:29:23 +00:00
|
|
|
MAN8_TXT += btrfs-quota.txt
|
2014-04-02 08:29:24 +00:00
|
|
|
MAN8_TXT += btrfs-qgroup.txt
|
2014-04-02 08:29:25 +00:00
|
|
|
MAN8_TXT += btrfs-replace.txt
|
2014-04-15 07:04:49 +00:00
|
|
|
MAN8_TXT += btrfs-restore.txt
|
2014-04-15 07:04:50 +00:00
|
|
|
MAN8_TXT += btrfs-property.txt
|
2014-04-02 08:29:12 +00:00
|
|
|
|
2014-06-11 22:14:55 +00:00
|
|
|
# Mount manpage
|
|
|
|
MAN5_TXT += btrfs-mount.txt
|
|
|
|
|
|
|
|
MAN_TXT = $(MAN8_TXT) $(MAN5_TXT)
|
2014-04-02 08:29:12 +00:00
|
|
|
MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT))
|
2014-06-11 22:14:55 +00:00
|
|
|
|
|
|
|
DOC_MAN5 = $(patsubst %.txt,%.5,$(MAN5_TXT))
|
|
|
|
GZ_MAN5 = $(patsubst %.txt,%.5.gz,$(MAN5_TXT))
|
|
|
|
|
2014-04-02 08:29:12 +00:00
|
|
|
DOC_MAN8 = $(patsubst %.txt,%.8,$(MAN8_TXT))
|
|
|
|
GZ_MAN8 = $(patsubst %.txt,%.8.gz,$(MAN8_TXT))
|
|
|
|
|
|
|
|
mandir ?= $(prefix)/share/man
|
|
|
|
man8dir = $(mandir)/man8
|
2014-06-11 22:14:55 +00:00
|
|
|
man5dir = $(mandir)/man5
|
2014-04-02 08:29:12 +00:00
|
|
|
|
|
|
|
ASCIIDOC = asciidoc
|
|
|
|
ASCIIDOC_EXTRA =
|
|
|
|
MANPAGE_XSL = manpage-normal.xsl
|
|
|
|
XMLTO = xmlto
|
|
|
|
XMLTO_EXTRA =
|
|
|
|
XMLTO_EXTRA = -m manpage-bold-literal.xsl
|
2014-06-03 06:09:25 +00:00
|
|
|
GZIPCMD = gzip
|
2014-04-02 08:29:12 +00:00
|
|
|
INSTALL ?= install
|
|
|
|
RM ?= rm -f
|
2014-04-16 16:33:44 +00:00
|
|
|
LNS ?= ln -sf
|
2014-04-02 08:29:12 +00:00
|
|
|
BTRFS_VERSION = $(shell sed -n 's/.*BTRFS_BUILD_VERSION "Btrfs \(.*\)"/\1/p'\
|
|
|
|
../version.h)
|
|
|
|
|
|
|
|
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] $@";
|
|
|
|
QUIET_GZIP = @echo " [GZ] $@";
|
2014-04-02 08:29:12 +00:00
|
|
|
QUIET_STDERR = 2> /dev/null
|
|
|
|
QUIET_SUBDIR0 = +@subdir=
|
|
|
|
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
|
|
|
|
$(MAKE) $(PRINT_DIR) -C $$subdir
|
|
|
|
export V
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: man
|
2014-06-11 22:14:55 +00:00
|
|
|
man: man5 man8
|
|
|
|
man5: $(GZ_MAN5)
|
2014-04-02 08:29:12 +00:00
|
|
|
man8: $(GZ_MAN8)
|
|
|
|
|
|
|
|
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)
|
2014-06-11 22:14:55 +00:00
|
|
|
$(INSTALL) -m 644 $(GZ_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
|
|
|
|
mv $(DESTDIR)$(man5dir)/btrfs-mount.5.gz $(DESTDIR)$(man5dir)/btrfs.5.gz
|
2014-04-02 08:29:12 +00:00
|
|
|
$(INSTALL) -m 644 $(GZ_MAN8) $(DESTDIR)$(man8dir)
|
2014-05-05 14:54:00 +00:00
|
|
|
$(LNS) btrfs-check.8.gz $(DESTDIR)$(man8dir)/btrfsck.8.gz
|
2014-04-02 08:29:12 +00:00
|
|
|
|
2014-07-25 13:41:57 +00:00
|
|
|
uninstall:
|
|
|
|
cd $(DESTDIR)$(man8dir); rm -f btrfs-check.8.gz $(GZ_MAN8)
|
|
|
|
rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(man8dir)
|
|
|
|
|
2014-04-02 08:29:12 +00:00
|
|
|
clean:
|
2014-06-11 22:14:55 +00:00
|
|
|
$(QUIET_RM)$(RM) *.xml *.xml+ *.5 *.5.gz *.8 *.8.gz
|
|
|
|
|
|
|
|
%.5.gz : %.5
|
|
|
|
$(QUIET_GZIP)$(GZIPCMD) -n -c $< > $@
|
2014-04-02 08:29:12 +00:00
|
|
|
|
|
|
|
%.8.gz : %.8
|
2014-06-03 06:09:25 +00:00
|
|
|
$(QUIET_GZIP)$(GZIPCMD) -n -c $< > $@
|
2014-04-02 08:29:12 +00:00
|
|
|
|
2014-06-11 22:14:55 +00:00
|
|
|
%.5 : %.xml
|
|
|
|
$(QUIET_XMLTO)$(RM) $@ && \
|
|
|
|
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
|
|
|
|
|
2014-06-03 06:09:25 +00:00
|
|
|
%.8 : %.xml
|
2014-04-02 08:29:12 +00:00
|
|
|
$(QUIET_XMLTO)$(RM) $@ && \
|
|
|
|
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
|
2014-06-11 22:14:55 +00:00
|
|
|
|
2014-04-02 08:29:12 +00:00
|
|
|
%.xml : %.txt asciidoc.conf
|
2014-05-19 15:38:03 +00:00
|
|
|
$(QUIET_ASCIIDOC)$(RM) $@.tmp[12] $@ && \
|
|
|
|
sed -e "s/\(<[^>]\+>\)/'\1'/g" < $< > $@.tmp1 && \
|
2014-04-02 08:29:12 +00:00
|
|
|
$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
|
|
|
|
$(ASCIIDOC_EXTRA) -abtrfs_version=$(BTRFS_VERSION) \
|
2014-05-19 15:38:03 +00:00
|
|
|
-o $@.tmp2 $@.tmp1 && \
|
|
|
|
mv $@.tmp2 $@ && \
|
|
|
|
rm -f -- $@.tmp1
|