aboutsummaryrefslogtreecommitdiff
path: root/doc/Makefile.am
blob: b7b517d69c5e82a6c76048feaa18f02e2de8b61b (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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
SUBDIRS = examples .

tagfiles = \
	libstdc++.tag \
	libwrapiter.tag

docfiles = \
	doc_main.doxygen \
	doc_mainpage.doxygen \
	doc_coding_standards.doxygen \
	doc_namespaces.doxygen \
	doc_references.doxygen

images = \
	 paludis.svg \
	 paludis_270.png

htmlfiles = \
	index.html \
	news.html \
	changelog.html \
	licence.html \
	authors.html \
	faq.html \
	migration.html \
	cachefiles.html \
	configuration.html \
	portagedifferences.html \
	programmingwithpaludis.html \
	sets.html \
	hooks.html \
	man-paludis.html \
	man-qualudis.html \
	man-contrarius.html \
	man-adjutrix.html

EXTRA_DIST = doxygen.conf.in header.html footer.html paludis.css \
	$(docfiles) $(tagfiles) $(images) htaccess \
	news.html.skel index.html.skel changelog.html.skel licence.html.skel authors.html.skel \
	faq.html.skel htmlheader.html htmlfooter.html migration.html.skel cachefiles.html.skel \
	configuration.html.skel portagedifferences.html.skel programmingwithpaludis.html.skel \
	sets.html.skel hooks.html.skel man.html.skel

CLEANFILES = *~ news.html index.html changelog.html licence.html authors.html faq.html \
	migration.html cachefiles.html configuration.html portagedifferences.html programmingwithpaludis.html \
	sets.html hooks.html man-paludis.html man-qualudis.html man-contrarius.html man-adjutrix.html \
	cleannews cleanrecentnews cleanchangelog cleanauthors cleanfaqtoc cleanbasiccppapp cleanbasicrubyapp

MAINTAINERCLEANFILES = Makefile.in $(tagfiles)

libstdc++.tag :
	wget -O $@ http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/libstdc++.tag

libwrapiter.tag :
	wget -O $@ http://libwrapiter.berlios.de/libwrapiter.tag

www :
	mkdir -p www

all-built-sources :
	$(MAKE) -C .. built-sources

if HAVE_DOXYGEN

doxygen : doxygen.conf $(top_srcdir)/paludis/*.cc $(top_srcdir)/paludis/*.hh \
		$(docfiles) $(tagfiles) www all-built-sources
	mkdir -p www/doxygen/html
	cp paludis_270.png www/doxygen/html
	doxygen doxygen.conf

else

doxygen :
	@echo "You don't have doxygen installed!"
	exit 1

endif

if ENABLE_RUBY

rdoc : create_ruby_doc.rb www all-built-sources
	$(RUBY) $(srcdir)/create_ruby_doc.rb -t "Paludis Ruby API" -m Paludis --op www/ruby/ $(top_srcdir)/ruby/*.cc

else

rdoc :
	@echo "You don't have ruby turned on!"
	exit 1

endif

cleanauthors : $(top_srcdir)/AUTHORS
	sed -e '1,3d' \
	    -e 's,&,\&amp;,g' -e 's,<,\&lt;,g' -e 's,>,\&gt;,g' -e 's,@, at ,g' \
	    -e 's,^    \(.*\),<dd>\1</dd>,' \
	    -e 's,^\([^ <].*\),<dt>\1</dt>,' \
	    < $(top_srcdir)/AUTHORS > cleanauthors

authors.html : authors.html.skel cleanauthors htmlheader.html htmlfooter.html
	sed -e '/@AUTHORS@/r cleanauthors' -e '/@AUTHORS@/d' \
	    -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' < $(srcdir)/authors.html.skel > authors.html

cleannews : $(top_srcdir)/NEWS
	sed -e '1,6d' -e '$$d' < $(top_srcdir)/NEWS > cleannews

news.html : news.html.skel cleannews htmlheader.html htmlfooter.html
	sed -e '/@RELEASE_NOTES@/r cleannews' -e '/@RELEASE_NOTES@/d' \
	    -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' < $(srcdir)/news.html.skel | \
	    sed \
	        -e 's~^\([0-9].*\):~</li></ul><h3>&</h3><ul>~' \
	        -e 's~^    \*~</li><li>~' \
	    | tr '\012' '\007' \
	    | sed \
	        -e 's~</li></ul><h3>~<h3>~' \
	        -e 's~<ul>\a*</li>~<ul>~g' \
	    | tr '\007' '\012' > news.html

cleanchangelog : $(top_srcdir)/ChangeLog
	sed -e '1,7d' -e '$$d' -e 's,&,\&amp;,g' -e 's,<,\&lt;,g' -e 's,>,\&gt;,g' -e 's,@, at ,g' \
	    < $(top_srcdir)/ChangeLog \
	    | sed \
	        -e 's~^\(200[0-9]-[0-9][0-9].*\)~<dt>&</dt>~' \
	    | tr '\012' '\007' \
	    | sed -e 's~\a\t[\*\+] ~\a<dd>~g' \
	    | sed -e 's~\([^>]\)\a\a~\1</dd>\a~g' \
	    | sed \
	        -e 's,<dd>\([^:<]\+\):,<dd><code>\1</code>:<br />,g' \
	    | tr '\007' '\012' > cleanchangelog

changelog.html : changelog.html.skel cleanchangelog htmlheader.html htmlfooter.html
	sed -e '/@CHANGELOG@/r cleanchangelog' -e '/@CHANGELOG@/d' \
	    -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' < $(srcdir)/changelog.html.skel > changelog.html

cleanrecentnews : news.html
	sed -n -e '/^<h3>[0-9]\+\.[^:]\+:/,/<.li><.ul><h3>/p' < news.html \
	    | sed -e '1s/.*<.h3>//' -e '$$s,.*,</ul>,' > cleanrecentnews

index.html : index.html.skel htmlheader.html htmlfooter.html cleanrecentnews
	sed -e '/[@]HEADER@/r htmlheader.html' \
	    -e '/[@]HEADER@/d' \
	    -e '/[@]FOOTER@/r htmlfooter.html' \
	    -e '/[@]FOOTER@/d' \
	    -e 's/[@]VERSION@/$(VERSION_FULL)/g' \
	    -e '/[@]RECENTNEWS@/r cleanrecentnews' \
	    -e '/[@]RECENTNEWS@/d' \
	    < $(srcdir)/index.html.skel > index.html

configuration.html : configuration.html.skel htmlheader.html htmlfooter.html
	sed -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' \
	    < $(srcdir)/configuration.html.skel > configuration.html

sets.html : sets.html.skel htmlheader.html htmlfooter.html
	sed -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' \
	    < $(srcdir)/sets.html.skel > sets.html

hooks.html : hooks.html.skel htmlheader.html htmlfooter.html
	sed -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' \
	    < $(srcdir)/hooks.html.skel > hooks.html

migration.html : migration.html.skel htmlheader.html htmlfooter.html
	sed -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' \
	    < $(srcdir)/migration.html.skel > migration.html

portagedifferences.html : portagedifferences.html.skel htmlheader.html htmlfooter.html
	sed -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' \
	    < $(srcdir)/portagedifferences.html.skel > portagedifferences.html

cleanbasiccppapp : $(srcdir)/examples/pwp_basic_cplusplus_app.cc
	sed -e 's,&,\&amp;,g' -e 's,<,\&lt;,g' -e 's,>,\&gt;,g' \
	    < $(srcdir)/examples/pwp_basic_cplusplus_app.cc > cleanbasiccppapp

cleanbasicrubyapp : $(srcdir)/examples/pwp_basic_ruby_app.rb
	sed -e 's,&,\&amp;,g' -e 's,<,\&lt;,g' -e 's,>,\&gt;,g' \
	    < $(srcdir)/examples/pwp_basic_ruby_app.rb > cleanbasicrubyapp

programmingwithpaludis.html : programmingwithpaludis.html.skel htmlheader.html htmlfooter.html \
		cleanbasiccppapp cleanbasicrubyapp
	sed -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' \
	    -e '/@BASIC_CPP_APP@/r cleanbasiccppapp' \
	    -e '/@BASIC_CPP_APP@/d' \
	    -e '/@BASIC_RUBY_APP@/r cleanbasicrubyapp' \
	    -e '/@BASIC_RUBY_APP@/d' \
	    < $(srcdir)/programmingwithpaludis.html.skel > programmingwithpaludis.html

cachefiles.html : cachefiles.html.skel htmlheader.html htmlfooter.html
	sed -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' \
	    < $(srcdir)/cachefiles.html.skel > cachefiles.html

faq.html : faq.html.skel htmlheader.html htmlfooter.html cleanfaqtoc
	sed -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' \
	    -e '/@TOC@/r cleanfaqtoc' \
	    -e '/@TOC@/d' \
	    < $(srcdir)/faq.html.skel > faq.html

cleanfaqtoc : faq.html.skel
	sed -n -e 's!^<h\([23]\) id="\([^"]\+\)">\(.*\)</h\1>!\1 <li><a href="#\2">\3</a></li>!gp' \
	    < $(srcdir)/faq.html.skel \
	    | sed -e 's!^2 <li>\(.*\)</li>!</ul></li><li><strong>\1</strong><ul>!' \
	        -e 's!^3 !!' \
	    | sed -e '1s!^</ul></li>!<ul>!' \
	        -e '$$s!$$!</ul></li></ul>!' \
	    > cleanfaqtoc

licence.html : licence.html.skel htmlheader.html htmlfooter.html ../COPYING
	sed -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' \
	    -e '/@COPYING@/r ../COPYING' \
	    -e '/@COPYING@/d' \
	    < $(srcdir)/licence.html.skel > licence.html

man-adjutrix.html : $(top_builddir)/src/clients/adjutrix/adjutrix.html man.html.skel
	sed -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' \
	    -e '/@MAN@/r $(top_builddir)/src/clients/adjutrix/adjutrix.html' \
	    -e '/@MAN@/d' \
	    < $(srcdir)/man.html.skel > man-adjutrix.html

man-qualudis.html : $(top_builddir)/src/clients/qualudis/qualudis.html man.html.skel
	sed -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' \
	    -e '/@MAN@/r $(top_builddir)/src/clients/qualudis/qualudis.html' \
	    -e '/@MAN@/d' \
	    < $(srcdir)/man.html.skel > man-qualudis.html

man-paludis.html : $(top_builddir)/src/clients/paludis/paludis.html man.html.skel
	sed -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' \
	    -e '/@MAN@/r $(top_builddir)/src/clients/paludis/paludis.html' \
	    -e '/@MAN@/d' \
	    < $(srcdir)/man.html.skel > man-paludis.html

man-contrarius.html : $(top_builddir)/src/clients/contrarius/contrarius.html man.html.skel
	sed -e '/@HEADER@/r htmlheader.html' \
	    -e '/@HEADER@/d' \
	    -e '/@FOOTER@/r htmlfooter.html' \
	    -e '/@FOOTER@/d' \
	    -e '/@MAN@/r $(top_builddir)/src/clients/contrarius/contrarius.html' \
	    -e '/@MAN@/d' \
	    < $(srcdir)/man.html.skel > man-contrarius.html

clean-local :
	rm -fr www

htmlpages : $(htmlfiles) paludis.css www
	for s in $(htmlfiles) paludis.css ; do cp $(srcdir)/$$s www/ ; done

dothtaccess : htaccess
	cp $(srcdir)/htaccess www/.htaccess

homepage : doxygen rdoc htmlpages dothtaccess images

images : $(images)
	for s in $(images) ; do cp $(srcdir)/$$s www/ ; done

upload-homepage : homepage
	cd `readlink -f $(top_srcdir)/doc/www` && tar jc ./ --exclude ./ | \
		ssh svn.pioto.org tar vjx -C /srv/paludis.pioto.org/www/htdocs/

built-sources : $(BUILT_SOURCES)
	for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done