9e428d59dba614db01abbda1c3cc0eef8f813ab3
[debian/amanda] / man / Makefile.am
1 # Makefile for amanda man-pages
2
3 .SECONDARY:
4
5 transform =     s,x,x,;
6
7 AMPLOT_MAN_PAGES =  amplot.8
8
9 COMMON_MAN_PAGES =  amanda.8 \
10                     amanda.conf.5 \
11                     amanda-client.conf.5 \
12                     amanda-scripts.7 \
13                     amanda-archive-format.5 \
14                     amanda-auth.7 \
15                     amanda-match.7 \
16                     amarchiver.8 \
17                     amservice.8 \
18                     script-email.8
19
20 CLIENT_MAN_PAGES = \
21     amanda-applications.7 \
22     amdump_client.8 \
23     amgtar.8 \
24     ampgsql.8 \
25     amraw.8 \
26     amsamba.8 \
27     amstar.8 \
28     amsuntar.8 \
29     amzfs-snapshot.8 \
30     amzfs-sendrecv.8
31
32 SERVER_MAN_PAGES =  \
33     amanda-devices.7 \
34     amanda-compatibility.7 \
35     amanda-changers.7 \
36     amanda-interactivity.7 \
37     amanda-taperscan.7 \
38     amaddclient.8    \
39     amadmin.8 \
40     amaespipe.8 \
41     amcheck.8 \
42     amcheckdb.8 \
43     amcheckdump.8 \
44     amcleanup.8 \
45     amcrypt-ossl-asym.8 \
46     amcrypt-ossl.8   \
47     amcrypt.8 \
48     amcryptsimple.8  \
49     amdevcheck.8 \
50     amdump.8 \
51     amflush.8 \
52     amgetconf.8 \
53     amgpgcrypt.8 \
54     amlabel.8 \
55     amoverview.8 \
56     amreport.8 \
57     amrmtape.8 \
58     amserverconfig.8 \
59     amstatus.8 \
60     amtape.8 \
61     amtapetype.8 \
62     amtoc.8 \
63     amvault.8 \
64     disklist.5 \
65     tapelist.5
66
67 RECOVER_MAN_PAGES =  amrecover.8
68
69 RESTORE_MAN_PAGES =  amrestore.8 \
70                      amfetchdump.8
71
72 ALL_MAN_PAGES = $(AMPLOT_MAN_PAGES) \
73            $(CLIENT_MAN_PAGES) \
74            $(COMMON_MAN_PAGES) \
75            $(SERVER_MAN_PAGES) \
76            $(RECOVER_MAN_PAGES) \
77            $(RESTORE_MAN_PAGES)
78
79 WANTED_MAN_PAGES = $(COMMON_MAN_PAGES)
80 if WANT_AMPLOT
81   WANTED_MAN_PAGES += $(AMPLOT_MAN_PAGES)
82 endif
83 if WANT_CLIENT
84   WANTED_MAN_PAGES += $(CLIENT_MAN_PAGES)
85 endif
86 if WANT_SERVER
87   WANTED_MAN_PAGES += $(SERVER_MAN_PAGES)
88 endif
89 if WANT_RECOVER
90   WANTED_MAN_PAGES += $(RECOVER_MAN_PAGES)
91 endif
92 if WANT_RESTORE
93   WANTED_MAN_PAGES += $(RESTORE_MAN_PAGES)
94 endif
95
96 SRCMANPAGEDIR  = $(srcdir)/xml-source
97
98 MAN_XML = $(ALL_MAN_PAGES:%=xml-source/%.xml)
99
100 EXTRA_XML = xslt/expand-sambadoc.xsl \
101             xslt/man.xsl.in \
102             xslt/html.xsl.in \
103             xslt/settings.xsl \
104             entities/global.entities.in \
105             entities/xinclude.dtd
106
107 EXTRA_DIST = $(ALL_MAN_PAGES) $(MAN_XML) $(EXTRA_HTML) $(EXTRA_XML)
108
109 GEN_XML = $(ALL_MAN_PAGES:%=xml-source/%.proc.xml)
110
111 MOSTLYCLEANFILES = $(GEN_XML)
112 MAINTAINERCLEANFILES = $(ALL_MAN_PAGES)
113
114 # some of the XSL needs to know what docbook-xsl version we've selected
115 %.xsl: %.xsl.in $(top_builddir)/config.status
116         $(top_builddir)/config.status --file=$@:$<
117         rm -f config.log
118
119 entities/global.entities: entities/global.entities.in $(top_builddir)/config.status
120         $(top_builddir)/config.status --file=$@:$<
121         rm -f config.log
122
123 if   ENABLE_MANPAGE_BUILD
124 # phase one of the documentation build expands some macros.
125 xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl entities/global.entities
126         $(XSLTPROC) $(XSLTPROC_FLAGS) --path "$(srcdir)/xslt/:$(builddir)/entities/" --xinclude --stringparam latex.imagebasedir "$*/" --stringparam noreference 1 --output $@ $(srcdir)/xslt/expand-sambadoc.xsl $<
127
128 # phase two generates a manpage from the resulting "expanded" docbook XML
129 %: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl entities/global.entities
130         $(XSLTPROC) $(XSLTPROC_FLAGS) --path "$(srcdir)/xslt/:$(builddir)/entities/" --output $@ xslt/man.xsl $<
131
132 %.html: xml-source/%.proc.xml $(srcdir)/xslt/html.xsl entities/global.entities
133         $(XSLTPROC) $(XSLTPROC_FLAGS) --path "$(srcdir)/xslt/:$(builddir)/entities/" --output $@ xslt/html.xsl $<
134
135 else    !ENABLE_MANPAGE_BUILD
136
137 %: $(SRCMANPAGEDIR)/%.xml
138         @echo WARNING: Not building needed $@ because building manpages is disabled.
139         @echo 'DUMMY' > $@
140
141 # (no rule to build HTML without ENABLE_MANPAGE_BUILD)
142
143 endif
144
145 ##
146 ## HTML Generation
147 ##
148
149 EXTRA_DIST += \
150         index.php \
151         amanda.css
152
153 ALL_MAN_HTMLS = $(ALL_MAN_PAGES:%=%.html)
154
155 # toplevel rule to build HTML manpages and tar them up
156 html: amanda.css index.php $(ALL_MAN_HTMLS)
157         tar -zcf html.tar.gz $(ALL_MAN_HTMLS) amanda.css index.php
158
159 # double-check that we don't ship dummy manpages
160 dist-hook:
161         for f in $(WANTED_MAN_PAGES); do \
162                 if sed -e 1q $(distdir)/$$f | $(GREP) '^DUMMY$$' >/dev/null 2>/dev/null; then \
163                         echo "$(distdir)/$$f is a dummy manpage; cannot create distribution"; \
164                         exit 1; \
165                 fi; \
166         done
167
168 man_MANS = $(WANTED_MAN_PAGES)