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
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
50 invoke-gnutls-cli.texi: $(SRC_DEF_CLI)
51 @-cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
53 ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
54 mv -f ../doc/$@.tmp ../doc/$@ && \
57 invoke-gnutls-cli-debug.texi: $(SRC_DEF_CLI_DEBUG)
58 @-cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
60 ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
61 mv -f ../doc/$@.tmp ../doc/$@ && \
64 invoke-gnutls-serv.texi: $(SRC_DEF_SERV)
65 @-cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
67 ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
68 mv -f ../doc/$@.tmp ../doc/$@ && \
71 invoke-certtool.texi: $(SRC_DEF_CERTTOOL)
72 @-cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
74 ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
75 mv -f ../doc/$@.tmp ../doc/$@ && \
78 invoke-ocsptool.texi: $(SRC_DEF_OCSPTOOL)
79 @-cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
81 ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
82 mv -f ../doc/$@.tmp ../doc/$@ && \
85 invoke-srptool.texi: $(SRC_DEF_SRPTOOL)
86 @-cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
88 ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
89 mv -f ../doc/$@.tmp ../doc/$@ && \
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 $< && \
97 ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
98 mv -f ../doc/$@.tmp ../doc/$@ && \
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 $< && \
106 ../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
107 mv -f ../doc/$@.tmp ../doc/$@ && \
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
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 \
138 gnutls_TEXINFOS += gnutls-layers.dia gnutls-layers.eps \
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 \
158 imagesdir = $(infodir)
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 \
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
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 \
190 $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
195 x509-api.texi: $(top_srcdir)/lib/includes/gnutls/x509.h
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 \
201 $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
206 pgp-api.texi: $(top_srcdir)/lib/includes/gnutls/openpgp.h
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 \
212 $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
218 pkcs12-api.texi: $(top_srcdir)/lib/includes/gnutls/pkcs12.h
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 \
224 $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
229 pkcs11-api.texi: $(top_srcdir)/lib/includes/gnutls/pkcs11.h
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 \
235 $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
240 abstract-api.texi: $(top_srcdir)/lib/includes/gnutls/abstract.h
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 \
246 $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
251 compat-api.texi: $(top_srcdir)/lib/includes/gnutls/compat.h
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 \
257 $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
262 dtls-api.texi: $(top_srcdir)/lib/includes/gnutls/dtls.h
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 \
268 $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
273 crypto-api.texi: $(top_srcdir)/lib/includes/gnutls/crypto.h
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 \
279 $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
284 ocsp-api.texi: $(top_srcdir)/lib/includes/gnutls/ocsp.h
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 \
290 $(top_srcdir)/lib/*.c $(top_srcdir)/lib/*/*.c >> $@-tmp 2>/dev/null && \
295 # Generated texinfos.
296 # for some reason it does not work when cross compiling
298 gnutls_TEXINFOS += error_codes.texi algorithms.texi alerts.texi enums.texi
301 DISTCLEANFILES = error_codes.texi algorithms.texi alerts.texi enums.texi
304 -I$(top_builddir)/lib/includes -I$(top_srcdir)/lib/includes \
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
323 algorithms.texi: $(top_srcdir)/lib/algorithms/ciphers.c $(srcdir)/printlist.c
324 $(MAKE) $(builddir)/printlist
325 $(builddir)/printlist > $@-tmp
328 alerts.texi: $(top_srcdir)/lib/gnutls_alert.c $(srcdir)/alert-printlist.c
329 $(MAKE) $(builddir)/alert-printlist
330 $(builddir)/alert-printlist > $@-tmp
333 enums.texi: $(srcdir)/../lib/includes/gnutls/*.h $(builddir)/../lib/includes/gnutls/*.h
336 echo -n "Creating documentation for $$i... " && \
337 $(srcdir)/scripts/gdoc -texinfo $$i >> $@-tmp && \
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
388 $(srcdir)/scripts/split-texi.pl enums enum < enums.texi
391 $(ENUMS): stamp_enums
394 ENUMS=`grep '^@c ' enums.texi | sed 's/@c //g' | sort`; \
396 for i in $$ENUMS; do \
397 STR="$$STR\nENUMS += enums/$$i"; \
399 grep -v -e '^ENUMS += ' $(srcdir)/Makefile.am | \
400 perl -p -e "s,^ENUMS =,ENUMS =$$STR," > tmp-$@; \
401 diff -u $(srcdir)/Makefile.am tmp-$@
404 .PHONY: compare-makefile
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)
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 \
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)" \
436 echo "(Guile not available, documentation not generated.)" > $@
440 gnutls.xml: epub.texi
441 makeinfo --docbook $<
442 sed -i 's/\&\#8226;//g' $@
444 gnutls.epub: gnutls.xml
446 epub-fix --delete-unmanifested gnutls.epub