make sure that the microseconds field does not overflow
[gnutls.git] / doc / Makefile.am
blob22288f3f8f52501a85e59083429af93e7b0f9f3e
1 ## Process this file with automake to produce Makefile.in
2 # Copyright (C) 2000-2012 Free Software Foundation, Inc.
4 # Author: Nikos Mavrogiannopoulos
6 # This file is part of GnuTLS.
8 # This file is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # This file is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this file; if not, write to the Free Software Foundation,
20 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 EXTRA_DIST = TODO certtool.cfg gnutls.ps gnutls.pdf gnutls.html \
23         doxygen/Doxyfile.in doxygen/Doxyfile.orig texinfo.css \
24         gnutls-guile.pdf gnutls-guile.html
26 SUBDIRS = examples cyclo scripts manpages credentials latex
27 if ENABLE_GTK_DOC
28 SUBDIRS += reference
29 endif
31 SRC_DEF_CLI = 
32 SRC_DEF_CLI_DEBUG = 
33 SRC_DEF_SERV = 
34 SRC_DEF_CERTTOOL = 
35 SRC_DEF_OCSPTOOL = 
36 SRC_DEF_SRPTOOL = 
37 SRC_DEF_PSKTOOL = 
38 SRC_DEF_P11TOOL = 
39 if WANT_TEST_SUITE
40 SRC_DEF_CLI += ../src/cli-args.def
41 SRC_DEF_CLI_DEBUG += ../src/cli-debug-args.def
42 SRC_DEF_SERV += ../src/serv-args.def
43 SRC_DEF_CERTTOOL += ../src/certtool-args.def
44 SRC_DEF_OCSPTOOL += ../src/ocsptool-args.def
45 SRC_DEF_SRPTOOL += ../src/srptool-args.def
46 SRC_DEF_PSKTOOL += ../src/psk-args.def
47 SRC_DEF_P11TOOL += ../src/p11tool-args.def
48 endif
50 invoke-gnutls-cli.texi: $(SRC_DEF_CLI)
51         @-cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
52         rm -f ../doc/$@ && \
53         ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
54         mv -f ../doc/$@.tmp ../doc/$@ && \
55         rm -f ../src/$@
57 invoke-gnutls-cli-debug.texi: $(SRC_DEF_CLI_DEBUG)
58         @-cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
59         rm -f ../doc/$@ && \
60         ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
61         mv -f ../doc/$@.tmp ../doc/$@ && \
62         rm -f ../src/$@
64 invoke-gnutls-serv.texi: $(SRC_DEF_SERV)
65         @-cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
66         rm -f ../doc/$@ && \
67         ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
68         mv -f ../doc/$@.tmp ../doc/$@ && \
69         rm -f ../src/$@
71 invoke-certtool.texi: $(SRC_DEF_CERTTOOL)
72         @-cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
73         rm -f ../doc/$@ && \
74         ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
75         mv -f ../doc/$@.tmp ../doc/$@ && \
76         rm -f ../src/$@
78 invoke-ocsptool.texi: $(SRC_DEF_OCSPTOOL)
79         @-cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
80         rm -f ../doc/$@ && \
81         ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
82         mv -f ../doc/$@.tmp ../doc/$@ && \
83         rm -f ../src/$@
85 invoke-srptool.texi: $(SRC_DEF_SRPTOOL)
86         @-cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
87         rm -f ../doc/$@ && \
88         ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
89         mv -f ../doc/$@.tmp ../doc/$@ && \
90         rm -f ../src/$@ && \
91         sed -i 's/@subheading/@subsubheading/g' ../doc/$@ && \
92         sed -i 's/@section/@subsection/g' ../doc/$@
94 invoke-psktool.texi: $(SRC_DEF_PSKTOOL)
95         @-cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
96         rm -f ../doc/$@ && \
97         ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
98         mv -f ../doc/$@.tmp ../doc/$@ && \
99         rm -f ../src/$@ && \
100         sed -i 's/@subheading/@subsubheading/g' ../doc/$@ && \
101         sed -i 's/@section/@subsection/g' ../doc/$@
103 invoke-p11tool.texi: $(SRC_DEF_P11TOOL)
104         @-cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
105         rm -f ../doc/$@ && \
106         ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
107         mv -f ../doc/$@.tmp ../doc/$@ && \
108         rm -f ../src/$@ && \
109         sed -i 's/@subheading/@subsubheading/g' ../doc/$@ && \
110         sed -i 's/@section/@subsection/g' ../doc/$@
112 info_TEXINFOS = gnutls.texi gnutls-guile.texi
113 gnutls_TEXINFOS = gnutls.texi fdl-1.3.texi                              \
114         cha-bib.texi cha-cert-auth.texi cha-cert-auth2.texi             \
115         cha-ciphersuites.texi cha-copying.texi cha-functions.texi       \
116         cha-gtls-app.texi cha-internals.texi cha-intro-tls.texi         \
117         cha-library.texi cha-preface.texi cha-programs.texi             \
118         sec-tls-app.texi cha-errors.texi cha-support.texi               \
119         cha-shared-key.texi cha-gtls-examples.texi
121 gnutls_TEXINFOS += invoke-gnutls-cli.texi invoke-gnutls-cli-debug.texi \
122         invoke-gnutls-serv.texi invoke-certtool.texi invoke-srptool.texi \
123         invoke-ocsptool.texi invoke-psktool.texi invoke-p11tool.texi
125 # Examples.
126 gnutls_TEXINFOS += examples/ex-client-anon.c                            \
127         examples/ex-session-info.c examples/ex-verify.c                 \
128         examples/ex-cert-select.c examples/ex-client-resume.c           \
129         examples/ex-client-srp.c examples/ex-client-x509.c              \
130         examples/ex-serv-x509.c examples/ex-serv-anon.c                 \
131         examples/ex-serv-pgp.c examples/ex-serv-srp.c                   \
132         examples/ex-alert.c examples/ex-x509-info.c examples/ex-crq.c   \
133         examples/ex-pkcs12.c examples/ex-client-dtls.c
135 # Images.  Make sure there are eps + png + pdf of each, plus the source dia.
136 gnutls_TEXINFOS += gnutls-internals.dia gnutls-internals.eps            \
137                    gnutls-internals.png
138 gnutls_TEXINFOS += gnutls-layers.dia gnutls-layers.eps                  \
139                    gnutls-layers.png
140 gnutls_TEXINFOS += gnutls-crypto-layers.dia gnutls-crypto-layers.eps    \
141                    gnutls-crypto-layers.png
142 gnutls_TEXINFOS += gnutls-pgp.dia gnutls-pgp.eps gnutls-pgp.png
143 gnutls_TEXINFOS += gnutls-x509.dia gnutls-x509.eps gnutls-x509.png
144 gnutls_TEXINFOS += gnutls-logo.eps gnutls-logo.png
145 gnutls_TEXINFOS += pkcs11-vision.dia pkcs11-vision.eps pkcs11-vision.png
147 # Images.  Make sure there are eps + png + pdf of each, plus the source dia.
148 gnutls_TEXINFOS += gnutls-client-server-use-case.dia    \
149         gnutls-client-server-use-case.eps               \
150         gnutls-client-server-use-case.png
151 gnutls_TEXINFOS += gnutls-handshake-sequence.dia                        \
152         gnutls-handshake-sequence.eps gnutls-handshake-sequence.png
153 gnutls_TEXINFOS += gnutls-handshake-state.dia                   \
154         gnutls-handshake-state.eps gnutls-handshake-state.png
155 gnutls_TEXINFOS += gnutls-modauth.dia gnutls-modauth.eps        \
156         gnutls-modauth.png
158 imagesdir = $(infodir)
159 images_DATA = \
160         gnutls-handshake-state.png      \
161         gnutls-layers.png gnutls-modauth.png gnutls-pgp.png     \
162         gnutls-client-server-use-case.png                       \
163         gnutls-handshake-sequence.png gnutls-internals.png      \
164         gnutls-logo.png gnutls-x509.png \
165         pkcs11-vision.png
167 AM_MAKEINFOFLAGS = -I $(top_srcdir)/doc
168 TEXI2DVI = texi2dvi $(AM_MAKEINFOFLAGS)
169 AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) \
170         --no-split --css-include=$(srcdir)/texinfo.css
172 MAINTAINERCLEANFILES =
174 # Generated texinfos.
176 gnutls_TEXINFOS += gnutls-api.texi x509-api.texi pgp-api.texi           \
177         pkcs12-api.texi pkcs11-api.texi abstract-api.texi               \
178         compat-api.texi dtls-api.texi crypto-api.texi ocsp-api.texi
180 MAINTAINERCLEANFILES += gnutls-api.texi x509-api.texi pgp-api.texi      \
181         pkcs12-api.texi pkcs11-api.texi abstract-api.texi               \
182         compat-api.texi dtls-api.texi crypto-api.texi ocsp-api.texi
184 gnutls-api.texi: $(top_srcdir)/lib/includes/gnutls/gnutls.h.in
185         echo "" > $@-tmp
186         for i in `$(top_srcdir)/doc/scripts/getfuncs.pl <$(top_srcdir)/lib/includes/gnutls/gnutls.h.in|sort|uniq`; do \
187                 echo -n "Creating documentation for $$i... " && \
188                 $(srcdir)/scripts/gdoc -texinfo \
189                         -function $$i \
190                         $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
191                 echo "ok"; \
192         done
193         mv -f $@-tmp $@
195 x509-api.texi: $(top_srcdir)/lib/includes/gnutls/x509.h
196         echo "" > $@-tmp
197         for i in `$(top_srcdir)/doc/scripts/getfuncs.pl <$(top_srcdir)/lib/includes/gnutls/x509.h|sort|uniq`; do \
198                 echo -n "Creating documentation for $$i... " && \
199                 $(srcdir)/scripts/gdoc -texinfo \
200                         -function $$i \
201                         $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
202                 echo "ok"; \
203         done
204         mv -f $@-tmp $@
206 pgp-api.texi: $(top_srcdir)/lib/includes/gnutls/openpgp.h
207         echo "" > $@-tmp
208         for i in `$(top_srcdir)/doc/scripts/getfuncs.pl <$(top_srcdir)/lib/includes/gnutls/openpgp.h|sort|uniq`; do \
209                 echo -n "Creating documentation for $$i... " && \
210                 $(srcdir)/scripts/gdoc -texinfo \
211                         -function $$i \
212                         $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
213                 echo "ok"; \
214         done
215         mv -f $@-tmp $@
218 pkcs12-api.texi: $(top_srcdir)/lib/includes/gnutls/pkcs12.h
219         echo "" > $@-tmp
220         for i in `$(top_srcdir)/doc/scripts/getfuncs.pl <$(top_srcdir)/lib/includes/gnutls/pkcs12.h|sort|uniq`; do \
221                 echo -n "Creating documentation for $$i... " && \
222                 $(srcdir)/scripts/gdoc -texinfo \
223                         -function $$i \
224                         $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
225                 echo "ok"; \
226         done
227         mv -f $@-tmp $@
229 pkcs11-api.texi: $(top_srcdir)/lib/includes/gnutls/pkcs11.h
230         echo "" > $@-tmp
231         for i in `$(top_srcdir)/doc/scripts/getfuncs.pl <$(top_srcdir)/lib/includes/gnutls/pkcs11.h|sort|uniq`; do \
232                 echo -n "Creating documentation for $$i... " && \
233                 $(srcdir)/scripts/gdoc -texinfo \
234                         -function $$i \
235                         $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
236                 echo "ok"; \
237         done
238         mv -f $@-tmp $@
240 abstract-api.texi: $(top_srcdir)/lib/includes/gnutls/abstract.h
241         echo "" > $@-tmp
242         for i in `$(top_srcdir)/doc/scripts/getfuncs.pl <$(top_srcdir)/lib/includes/gnutls/abstract.h|sort|uniq`; do \
243                 echo -n "Creating documentation for $$i... " && \
244                 $(srcdir)/scripts/gdoc -texinfo \
245                         -function $$i \
246                         $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
247                 echo "ok"; \
248         done
249         mv -f $@-tmp $@
251 compat-api.texi: $(top_srcdir)/lib/includes/gnutls/compat.h
252         echo "" > $@-tmp
253         for i in `$(top_srcdir)/doc/scripts/getfuncs.pl <$(top_srcdir)/lib/includes/gnutls/compat.h|sort|uniq`; do \
254                 echo -n "Creating documentation for $$i... " && \
255                 $(srcdir)/scripts/gdoc -texinfo \
256                         -function $$i \
257                         $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
258                 echo "ok"; \
259         done
260         mv -f $@-tmp $@
262 dtls-api.texi: $(top_srcdir)/lib/includes/gnutls/dtls.h
263         echo "" > $@-tmp
264         for i in `$(top_srcdir)/doc/scripts/getfuncs.pl <$(top_srcdir)/lib/includes/gnutls/dtls.h|sort|uniq`; do \
265                 echo -n "Creating documentation for $$i... " && \
266                 $(srcdir)/scripts/gdoc -texinfo \
267                         -function $$i \
268                         $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
269                 echo "ok"; \
270         done
271         mv -f $@-tmp $@
273 crypto-api.texi: $(top_srcdir)/lib/includes/gnutls/crypto.h
274         echo "" > $@-tmp
275         for i in `$(top_srcdir)/doc/scripts/getfuncs.pl <$(top_srcdir)/lib/includes/gnutls/crypto.h|sort|uniq`; do \
276                 echo -n "Creating documentation for $$i... " && \
277                 $(srcdir)/scripts/gdoc -texinfo \
278                         -function $$i \
279                         $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
280                 echo "ok"; \
281         done
282         mv -f $@-tmp $@
284 ocsp-api.texi: $(top_srcdir)/lib/includes/gnutls/ocsp.h
285         echo "" > $@-tmp
286         for i in `$(top_srcdir)/doc/scripts/getfuncs.pl <$(top_srcdir)/lib/includes/gnutls/ocsp.h|sort|uniq`; do \
287                 echo -n "Creating documentation for file $$i... " && \
288                 $(srcdir)/scripts/gdoc -texinfo \
289                         -function $$i \
290                         $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
291                 echo "ok"; \
292         done
293         mv -f $@-tmp $@
295 # Generated texinfos.
296 # for some reason it does not work when cross compiling
297 if !WINDOWS
298 gnutls_TEXINFOS += error_codes.texi algorithms.texi alerts.texi enums.texi
299 endif
301 DISTCLEANFILES = error_codes.texi algorithms.texi alerts.texi enums.texi
303 AM_CPPFLAGS = \
304         -I$(top_builddir)/lib/includes -I$(top_srcdir)/lib/includes \
305         -I$(top_builddir)/
307 EXTRA_PROGRAMS = errcodes printlist alert-printlist
309 errcodes_SOURCES = errcodes.c common.c common.h
310 errcodes_LDADD = ../lib/libgnutls.la ../gl/libgnu.la
312 printlist_SOURCES = printlist.c common.c common.h
313 printlist_LDADD = ../lib/libgnutls.la ../gl/libgnu.la
315 alert_printlist_SOURCES = alert-printlist.c common.c common.h
316 alert_printlist_LDADD = ../lib/libgnutls.la ../gl/libgnu.la
318 error_codes.texi: $(top_srcdir)/lib/gnutls_errors.c $(srcdir)/errcodes.c
319         $(MAKE) $(builddir)/errcodes
320         $(builddir)/errcodes > $@-tmp
321         mv -f $@-tmp $@
323 algorithms.texi: $(top_srcdir)/lib/algorithms/ciphers.c $(srcdir)/printlist.c
324         $(MAKE) $(builddir)/printlist
325         $(builddir)/printlist > $@-tmp
326         mv -f $@-tmp $@
328 alerts.texi: $(top_srcdir)/lib/gnutls_alert.c $(srcdir)/alert-printlist.c
329         $(MAKE) $(builddir)/alert-printlist
330         $(builddir)/alert-printlist > $@-tmp
331         mv -f $@-tmp $@
333 enums.texi: $(srcdir)/../lib/includes/gnutls/*.h $(builddir)/../lib/includes/gnutls/*.h
334         echo "" > $@-tmp
335         for i in $^; do \
336                 echo -n "Creating documentation for $$i... " && \
337                 $(srcdir)/scripts/gdoc -texinfo $$i >> $@-tmp && \
338                 echo "ok"; \
339         done
340         mv -f $@-tmp $@
342 ENUMS =
343 ENUMS += enums/gnutls_alert_description_t
344 ENUMS += enums/gnutls_alert_level_t
345 ENUMS += enums/gnutls_certificate_import_flags
346 ENUMS += enums/gnutls_certificate_print_formats_t
347 ENUMS += enums/gnutls_certificate_request_t
348 ENUMS += enums/gnutls_certificate_status_t
349 ENUMS += enums/gnutls_certificate_type_t
350 ENUMS += enums/gnutls_certificate_verify_flags
351 ENUMS += enums/gnutls_channel_binding_t
352 ENUMS += enums/gnutls_cipher_algorithm_t
353 ENUMS += enums/gnutls_close_request_t
354 ENUMS += enums/gnutls_compression_method_t
355 ENUMS += enums/gnutls_credentials_type_t
356 ENUMS += enums/gnutls_digest_algorithm_t
357 ENUMS += enums/gnutls_ecc_curve_t
358 ENUMS += enums/gnutls_handshake_description_t
359 ENUMS += enums/gnutls_kx_algorithm_t
360 ENUMS += enums/gnutls_mac_algorithm_t
361 ENUMS += enums/gnutls_openpgp_crt_fmt_t
362 ENUMS += enums/gnutls_openpgp_crt_status_t
363 ENUMS += enums/gnutls_params_type_t
364 ENUMS += enums/gnutls_pk_algorithm_t
365 ENUMS += enums/gnutls_pkcs11_obj_attr_t
366 ENUMS += enums/gnutls_pkcs11_obj_info_t
367 ENUMS += enums/gnutls_pkcs11_obj_type_t
368 ENUMS += enums/gnutls_pkcs11_token_info_t
369 ENUMS += enums/gnutls_pkcs12_bag_type_t
370 ENUMS += enums/gnutls_pkcs_encrypt_flags_t
371 ENUMS += enums/gnutls_privkey_type_t
372 ENUMS += enums/gnutls_protocol_t
373 ENUMS += enums/gnutls_psk_key_flags
374 ENUMS += enums/gnutls_rnd_level_t
375 ENUMS += enums/gnutls_sec_param_t
376 ENUMS += enums/gnutls_server_name_type_t
377 ENUMS += enums/gnutls_sign_algorithm_t
378 ENUMS += enums/gnutls_supplemental_data_format_type_t
379 ENUMS += enums/gnutls_x509_crt_fmt_t
380 ENUMS += enums/gnutls_x509_subject_alt_name_t
382 gnutls_TEXINFOS += $(ENUMS)
383 DISTCLEANFILES += $(ENUMS) stamp_enums
385 stamp_enums: enums.texi
386         $(MAKE) compare-makefile
387         -mkdir enums
388         $(srcdir)/scripts/split-texi.pl enums enum < enums.texi
389         echo $@ > $@
391 $(ENUMS): stamp_enums
393 compare-makefile:
394         ENUMS=`grep '^@c ' enums.texi | sed 's/@c //g' | sort`; \
395         STR=""; \
396         for i in $$ENUMS; do \
397                 STR="$$STR\nENUMS += enums/$$i"; \
398         done; \
399         grep -v -e '^ENUMS += ' $(srcdir)/Makefile.am | \
400                 perl -p -e "s,^ENUMS =,ENUMS =$$STR," > tmp-$@; \
401         diff -u $(srcdir)/Makefile.am tmp-$@
402         rm -f tmp-$@
404 .PHONY: compare-makefile
406 # Guile texinfos.
408 guile_texi = core.c.texi
409 BUILT_SOURCES        = $(guile_texi)
410 MAINTAINERCLEANFILES += $(guile_texi)
411 EXTRA_DIST           += $(guile_texi) extract-guile-c-doc.scm
412 guile_TEXINFOS       = gnutls-guile.texi $(guile_texi)
414 if HAVE_GUILE
416 GUILE_FOR_BUILD =                               \
417   GUILE_AUTO_COMPILE=0                          \
418   $(GUILE) -L $(top_srcdir)/guile/modules
420 SNARF_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)                      \
421          -I$(top_srcdir)/lib/includes -I$(top_builddir)/lib/includes    \
422          -I$(top_srcdir)/extra/includes                         \
423          -I$(top_srcdir)/guile/src -I$(top_builddir)/guile/src          \
424          $(GUILE_CFLAGS)
426 core.c.texi: $(top_srcdir)/guile/src/core.c
427         $(MAKE) -C ../guile/src built-sources &&                        \
428         $(GUILE_FOR_BUILD) -l "$(srcdir)/extract-guile-c-doc.scm"       \
429            -e '(apply main (cdr (command-line)))'                       \
430            -- "$^" "$(CPP)" "$(SNARF_CPPFLAGS) $(CPPFLAGS)"             \
431            > "$@"
433 else !HAVE_GUILE
435 core.c.texi:
436         echo "(Guile not available, documentation not generated.)" > $@
438 endif !HAVE_GUILE
440 gnutls.xml: epub.texi
441         makeinfo --docbook $<
442         sed -i 's/\&\#8226;//g' $@
444 gnutls.epub: gnutls.xml
445         dbtoepub $<
446         epub-fix --delete-unmanifested gnutls.epub