aboutsummaryrefslogtreecommitdiff
path: root/doc/clients/Makefile.am
blob: c110c21d63c3f25331bfb4775d69795a1c61f204 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
include $(top_srcdir)/misc/common-makefile.am

SUBDIRS = .

CLEANFILES += \
	header.html.part \
	toplinks.html.part \
	footer.html.part \
	index.html

DISTCLEANFILES = \
	$(ALL_CLIENTS_HTML) \
	$(CAVE_COMMANDS_HTML)

EXTRA_DIST = \
	$(ALL_CLIENTS_HTML) \
	$(CAVE_COMMANDS_HTML) \
	toplinks.html.part.in \
	index.html.part

paludisclientshtmldir = $(htmldir)/clients

paludisclientshtml_DATA = \
	index.html \
	$(ALL_CLIENTS_HTML) \
	$(CAVE_COMMANDS_HTML)

CAVE_COMMANDS_HTML = \
	cave-config.html \
	cave-contents.html \
	cave-digest.html \
	cave-display-resolution.html \
	cave-dump-cave-formats-conf.html \
	cave-executables.html \
	cave-execute-resolution.html \
	cave-find-candidates.html \
	cave-fix-cache.html \
	cave-fix-linkage.html \
	cave-generate-metadata.html \
	cave-graph-jobs.html \
	cave-has-version.html \
	cave-help.html \
	cave-import.html \
	cave-info.html \
	cave-manage-search-index.html \
	cave-match.html \
	cave-mirror.html \
	cave-owner.html \
	cave-perform.html \
	cave-print-best-version.html \
	cave-print-categories.html \
	cave-print-commands.html \
	cave-print-environment-metadata.html \
	cave-print-id-actions.html \
	cave-print-id-contents.html \
	cave-print-id-environment-variable.html \
	cave-print-id-executables.html \
	cave-print-id-masks.html \
	cave-print-id-metadata.html \
	cave-print-id-size.html \
	cave-print-ids.html \
	cave-print-owners.html \
	cave-print-packages.html \
	cave-print-repositories.html \
	cave-print-repository-formats.html \
	cave-print-repository-metadata.html \
	cave-print-set.html \
	cave-print-sets.html \
	cave-print-spec.html \
	cave-print-sync-protocols.html \
	cave-print-unused-distfiles.html \
	cave-purge.html \
	cave-report.html \
	cave-resolve.html \
	cave-resume.html \
	cave-search.html \
	cave-show.html \
	cave-size.html \
	cave-sync.html \
	cave-sync-protocol-options.html \
	cave-uninstall.html \
	cave-update-world.html \
	cave-verify.html

if HAVE_HTMLTIDY

TESTS = $(paludisclientshtml_DATA)
LOG_COMPILER_INTERP = $(top_srcdir)/doc/htmltidy.bash

endif

# automake is retartded
TEST_EXTENSIONS = .html
HTML_LOG_COMPILER = $(LOG_COMPILER)

index.html : header.html.part $(srcdir)/index.html.part footer.html.part
	cat header.html.part $(srcdir)/index.html.part footer.html.part > $@

accerso.html : header.html.part footer.html.part
	{ cat header.html.part && { \
	    if test -x $(top_builddir)/src/clients/accerso/man-accerso ; then \
	        $(top_builddir)/src/clients/accerso/man-accerso --html ; \
	    else \
	        echo "<h1>accerso</h1>"; \
	        echo "<p>Sorry, documentation was generated without support for the accerso client.</p>" ; \
	    fi ; } && \
	    cat footer.html.part ; } > $@

appareo.html : header.html.part footer.html.part
	{ cat header.html.part && { \
	    if test -x $(top_builddir)/src/clients/appareo/man-appareo ; then \
	        $(top_builddir)/src/clients/appareo/man-appareo --html ; \
	    else \
	        echo "<h1>appareo</h1>"; \
	        echo "<p>Sorry, documentation was generated without support for the appareo client.</p>" ; \
	    fi ; } && \
	    cat footer.html.part ; } > $@

cave.html : header.html.part footer.html.part
	{ cat header.html.part && { \
	    if test -x $(top_builddir)/src/clients/cave/man-cave ; then \
	        env CAVE_COMMANDS_PATH="" $(top_builddir)/src/clients/cave/man-cave --html | \
	        sed -e '/<h2>See Also<.h2>/,/<.ul>/s#<strong>\(.*\)</strong> (1)#<a href="\1.html">\1</a>#'; \
	    else \
	        echo "<h1>cave</h1>"; \
	        echo "<p>Sorry, documentation was generated without support for the cave client.</p>" ; \
	    fi ; } && \
	    cat footer.html.part ; } > $@

$(CAVE_COMMANDS_HTML) : header.html.part footer.html.part
	{ cat header.html.part && { \
	    if test -x $(top_builddir)/src/clients/cave/man-cave ; then \
	        basename $@ .html | sed -e 's,^cave-,,' | xargs env CAVE_COMMANDS_PATH="" $(top_builddir)/src/clients/cave/man-cave --html | \
	        sed -e '/<h2>See Also<.h2>/,/<.ul>/s#<strong>\(.*\)</strong> (1)#<a href="\1.html">\1</a>#'; \
	    else \
	        echo "<h1>cave</h1>"; \
	        echo "<p>Sorry, documentation was generated without support for the cave client.</p>" ; \
	    fi ; } && \
	    cat footer.html.part ; } > $@

instruo.html : header.html.part footer.html.part
	{ cat header.html.part && { \
	    if test -x $(top_builddir)/src/clients/instruo/man-instruo ; then \
	        $(top_builddir)/src/clients/instruo/man-instruo --html ; \
	    else \
	        echo "<h1>instruo</h1>"; \
	        echo "<p>Sorry, documentation was generated without support for the instruo client.</p>" ; \
	    fi ; } && \
	    cat footer.html.part ; } > $@

header.html.part : $(srcdir)/../header.html.part.in toplinks.html.part
	sed \
	    -e 's,###TOPURI###,../,g' \
	    -e '/###TOPLINKS###/r $(srcdir)/toplinks.html.part' \
	    -e 's,###TOPLINKS###,,g' \
	    < $(srcdir)/../header.html.part.in > header.html.part

toplinks.html.part : $(srcdir)/toplinks.html.part.in
	sed \
	    -e 's,###TOPURI###,../,g' \
	    < $(srcdir)/toplinks.html.part.in > toplinks.html.part

footer.html.part : $(srcdir)/../footer.html.part.in
	sed -e 's,###TOPURI###,./,g' < $(srcdir)/../footer.html.part.in > footer.html.part

htmldocs : htmldocs-subdirs

htmldocs-subdirs :
	for s in $(SUBDIRS) . ; do if test x$$s = x. ; then $(MAKE) htmldocs-local || exit 1 ; \
	    else $(MAKE) -C $$s htmldocs || exit 1 ; fi ; done

htmldocs-local : $(paludisclientshtml_DATA)