btrfs-progs: tests: mkfs/002 and 003: use TEST_DEV instead of IMAGE
[btrfs-progs-unstable/devel.git] / Documentation / Makefile.in
blob539c6b553ec232c71a4f89491411792bbe51b542
1 # Guard against environment variables
2 MAN8_TXT =
4 # Top level commands
5 MAN8_TXT += btrfs.asciidoc
6 MAN8_TXT += btrfs-convert.asciidoc
7 MAN8_TXT += btrfs-find-root.asciidoc
8 MAN8_TXT += btrfs-image.asciidoc
9 MAN8_TXT += btrfs-map-logical.asciidoc
10 MAN8_TXT += btrfs-select-super.asciidoc
11 MAN8_TXT += btrfstune.asciidoc
12 MAN8_TXT += fsck.btrfs.asciidoc
13 MAN8_TXT += mkfs.btrfs.asciidoc
15 # Sub commands for btrfs
16 MAN8_TXT += btrfs-subvolume.asciidoc
17 MAN8_TXT += btrfs-filesystem.asciidoc
18 MAN8_TXT += btrfs-balance.asciidoc
19 MAN8_TXT += btrfs-device.asciidoc
20 MAN8_TXT += btrfs-scrub.asciidoc
21 MAN8_TXT += btrfs-check.asciidoc
22 MAN8_TXT += btrfs-rescue.asciidoc
23 MAN8_TXT += btrfs-inspect-internal.asciidoc
24 MAN8_TXT += btrfs-send.asciidoc
25 MAN8_TXT += btrfs-receive.asciidoc
26 MAN8_TXT += btrfs-quota.asciidoc
27 MAN8_TXT += btrfs-qgroup.asciidoc
28 MAN8_TXT += btrfs-replace.asciidoc
29 MAN8_TXT += btrfs-restore.asciidoc
30 MAN8_TXT += btrfs-property.asciidoc
32 # Category 5 manual page
33 MAN5_TXT += btrfs-man5.asciidoc
35 MAN_TXT = $(MAN8_TXT) $(MAN5_TXT)
36 MAN_XML = $(patsubst %.asciidoc,%.xml,$(MAN_TXT))
37 MAN_HTML = $(patsubst %.asciidoc,%.html,$(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
49 ASCIIDOC = @ASCIIDOC@
50 ASCIIDOC_EXTRA =
51 MANPAGE_XSL = manpage-normal.xsl
52 XMLTO = @XMLTO@
53 XMLTO_EXTRA =
54 XMLTO_EXTRA = -m manpage-bold-literal.xsl
55 GZIPCMD = @GZIP@
56 INSTALL = @INSTALL@
57 RM = @RM@
58 RMDIR = @RMDIR@
59 LN_S = @LN_S@
60 MV = @MV@
61 SED = @SED@
62 BTRFS_VERSION = $(shell $(SED) -n 's/.*PACKAGE_VERSION "\(.*\)"/\1/p'\
63 ../config.h)
65 ifneq ($(findstring $(MAKEFLAGS),s),s)
66 ifndef V
67 QUIET_RM = @
68 QUIET_ASCIIDOC = @echo " [ASCII] $@";
69 QUIET_XMLTO = @echo " [XMLTO] $@";
70 QUIET_GZIP = @echo " [GZ] $@";
71 endif
72 endif
74 all: man
75 man: man5 man8
76 man5: $(GZ_MAN5)
77 man8: $(GZ_MAN8)
78 html: $(MAN_HTML)
80 install: install-man
82 install-man: man
83 $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
84 $(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
85 $(INSTALL) -m 644 $(GZ_MAN5) $(DESTDIR)$(man5dir)
86 # the source file name of btrfs.5 clashes with section 8 page, but we
87 # want to keep the code generic
88 $(MV) $(DESTDIR)$(man5dir)/btrfs-man5.5.gz $(DESTDIR)$(man5dir)/btrfs.5.gz
89 $(INSTALL) -m 644 $(GZ_MAN8) $(DESTDIR)$(man8dir)
90 $(LN_S) -f btrfs-check.8.gz $(DESTDIR)$(man8dir)/btrfsck.8.gz
91 $(LN_S) -f btrfs-rescue.8.gz $(DESTDIR)$(man8dir)/btrfs-zero-log.8.gz
92 $(LN_S) -f btrfs-inspect-internal.8.gz $(DESTDIR)$(man8dir)/btrfs-debug-tree.8.gz
93 $(LN_S) -f btrfs-inspect-internal.8.gz $(DESTDIR)$(man8dir)/btrfs-show-super.8.gz
95 uninstall:
96 cd $(DESTDIR)$(man8dir); rm -f btrfs-check.8.gz $(GZ_MAN8)
97 $(RMDIR) -p --ignore-fail-on-non-empty $(DESTDIR)$(man8dir)
99 clean:
100 $(QUIET_RM)$(RM) -f *.xml *.xml+ *.5 *.5.gz *.8 *.8.gz *.html
102 %.5.gz : %.5
103 $(QUIET_GZIP)$(GZIPCMD) -n -c $< > $@
105 %.8.gz : %.8
106 $(QUIET_GZIP)$(GZIPCMD) -n -c $< > $@
108 %.5 : %.xml
109 $(QUIET_XMLTO)$(RM) -f $@ && \
110 $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
112 %.8 : %.xml
113 $(QUIET_XMLTO)$(RM) -f $@ && \
114 $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
116 %.xml : %.asciidoc asciidoc.conf
117 $(QUIET_ASCIIDOC)$(RM) -f $@+ $@ && \
118 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
119 $(ASCIIDOC_EXTRA) -abtrfs_version=$(BTRFS_VERSION) \
120 -o $@+ $< && \
121 $(MV) $@+ $@
123 %.html : %.asciidoc asciidoc.conf
124 $(QUIET_ASCIIDOC)$(RM) -f $@+ $@ && \
125 $(ASCIIDOC) -b html -d article -f asciidoc.conf \
126 $(ASCIIDOC_EXTRA) -abtrfs_version=$(BTRFS_VERSION) \
127 -o $@+ $< && \
128 $(MV) $@+ $@