enums.texi: Look in builddir too for gnutls.h.
[gnutls:gnutls.git] / doc / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
3 # 2009, 2010, 2011 Free Software Foundation, Inc.
4 #
5 # Author: Nikos Mavrogiannopoulos
6 #
7 # This file is part of GnuTLS.
8 #
9 # This file is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
13 #
14 # This file is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 # General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this file; if not, write to the Free Software Foundation,
21 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
23 EXTRA_DIST = TODO certtool.cfg gnutls.ps gnutls.pdf gnutls.html \
24         doxygen/Doxyfile.in doxygen/Doxyfile.orig texinfo.css \
25         gnutls-guile.pdf gnutls-guile.html
26
27 SUBDIRS = examples cyclo scripts manpages credentials latex
28 if ENABLE_GTK_DOC
29 SUBDIRS += reference
30 endif
31
32 info_TEXINFOS = gnutls.texi gnutls-guile.texi
33 gnutls_TEXINFOS = gnutls.texi fdl-1.3.texi lgpl-2.1.texi gpl-3.0.texi   \
34         cha-auth.texi cha-bib.texi cha-cert-auth.texi                   \
35         cha-ciphersuites.texi cha-copying.texi cha-functions.texi       \
36         cha-gtls-app.texi cha-internals.texi cha-intro-tls.texi         \
37         cha-library.texi cha-preface.texi cha-programs.texi             \
38         sec-tls-app.texi cha-errors.texi cha-support.texi
39
40 # Examples.
41 gnutls_TEXINFOS += examples/ex-client1.c                                \
42         examples/ex-session-info.c examples/ex-verify.c                 \
43         examples/ex-cert-select.c examples/ex-client-resume.c           \
44         examples/ex-client-srp.c examples/ex-rfc2818.c                  \
45         examples/ex-serv1.c examples/ex-serv-anon.c                     \
46         examples/ex-serv-pgp.c examples/ex-serv-srp.c                   \
47         examples/ex-alert.c examples/ex-x509-info.c examples/ex-crq.c   \
48         examples/ex-pkcs12.c
49
50 # Images.  Make sure there are eps + png + pdf of each, plus the source dia.
51 gnutls_TEXINFOS += gnutls-internals.dia gnutls-internals.eps            \
52                    gnutls-internals.png
53 gnutls_TEXINFOS += gnutls-layers.dia gnutls-layers.eps                  \
54                    gnutls-layers.png
55 gnutls_TEXINFOS += gnutls-crypto-layers.dia gnutls-crypto-layers.eps    \
56                    gnutls-crypto-layers.png
57 gnutls_TEXINFOS += gnutls-pgp.dia gnutls-pgp.eps gnutls-pgp.png
58 gnutls_TEXINFOS += gnutls-x509.dia gnutls-x509.eps gnutls-x509.png
59 gnutls_TEXINFOS += gnutls-logo.eps gnutls-logo.png
60 gnutls_TEXINFOS += pkcs11-vision.dia pkcs11-vision.eps pkcs11-vision.png
61
62 # Images.  Make sure there are eps + png + pdf of each, plus the source dia.
63 gnutls_TEXINFOS += gnutls-client-server-use-case.dia    \
64         gnutls-client-server-use-case.eps               \
65         gnutls-client-server-use-case.png
66 gnutls_TEXINFOS += gnutls-handshake-sequence.dia                        \
67         gnutls-handshake-sequence.eps gnutls-handshake-sequence.png
68 gnutls_TEXINFOS += gnutls-handshake-state.dia                   \
69         gnutls-handshake-state.eps gnutls-handshake-state.png
70 gnutls_TEXINFOS += gnutls-modauth.dia gnutls-modauth.eps        \
71         gnutls-modauth.png
72
73 imagesdir = $(infodir)
74 images_DATA = \
75         gnutls-handshake-state.png      \
76         gnutls-layers.png gnutls-modauth.png gnutls-pgp.png     \
77         gnutls-client-server-use-case.png                       \
78         gnutls-handshake-sequence.png gnutls-internals.png      \
79         gnutls-logo.png gnutls-x509.png \
80         pkcs11-vision.png
81
82 AM_MAKEINFOFLAGS = -I $(top_srcdir)/doc
83 TEXI2DVI = texi2dvi $(AM_MAKEINFOFLAGS)
84 AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) \
85         --no-split --css-include=$(srcdir)/texinfo.css
86
87 MAINTAINERCLEANFILES =
88
89 # Generated texinfos.
90
91 gnutls_TEXINFOS += gnutls-api.texi \
92         x509-api.texi pgp-api.texi
93 MAINTAINERCLEANFILES += gnutls-api.texi \
94         x509-api.texi pgp-api.texi
95
96 gnutls-api.texi: $(srcdir)/../lib/*.c $(srcdir)/../lib/ext/*.c $(srcdir)/../lib/auth/*.c $(srcdir)/../lib/algorithms/*.c
97         echo "" > $@-tmp
98         for i in $^; do \
99                 echo -n "Creating documentation for file $$i... " && \
100                 $(srcdir)/scripts/gdoc -texinfo $$i >> $@-tmp && \
101                 echo "ok"; \
102         done
103         $(srcdir)/scripts/sort2.pl < $@-tmp > $@-tmp2
104         rm -f $@-tmp
105         mv -f $@-tmp2 $@
106
107 x509-api.texi: $(srcdir)/../lib/x509/*.c
108         echo "" > $@-tmp
109         for i in $^; do \
110                 echo -n "Creating documentation for file $$i... " && \
111                 $(srcdir)/scripts/gdoc -texinfo $$i >> $@-tmp && \
112                 echo "ok"; \
113         done
114         $(srcdir)/scripts/sort2.pl < $@-tmp > $@-tmp2
115         rm -f $@-tmp
116         mv -f $@-tmp2 $@
117
118 pgp-api.texi: $(srcdir)/../lib/openpgp/*.c
119         echo "" > $@-tmp
120         for i in $^; do \
121                 echo -n "Creating documentation for file $$i... " && \
122                 $(srcdir)/scripts/gdoc -texinfo $$i >> $@-tmp && \
123                 echo "ok"; \
124         done
125         $(srcdir)/scripts/sort2.pl < $@-tmp > $@-tmp2
126         rm -f $@-tmp
127         mv -f $@-tmp2 $@
128
129 # Generated texinfos.
130
131 gnutls_TEXINFOS += error_codes.texi algorithms.texi alerts.texi  enums.texi
132 MAINTAINERCLEANFILES += error_codes.texi algorithms.texi enums.texi
133
134 AM_CPPFLAGS = \
135         -I$(top_srcdir)/lib/includes -I$(top_builddir)/lib/includes
136
137 EXTRA_PROGRAMS = errcodes printlist alert-printlist
138
139 errcodes_SOURCES = errcodes.c
140 errcodes_LDADD = ../lib/libgnutls.la ../gl/libgnu.la
141
142 printlist_SOURCES = printlist.c
143 printlist_LDADD = ../lib/libgnutls.la ../gl/libgnu.la
144
145 alert_printlist_SOURCES = alert-printlist.c
146 alert_printlist_LDADD = ../lib/libgnutls.la ../gl/libgnu.la
147
148 error_codes.texi: $(top_srcdir)/lib/gnutls_errors.c $(srcdir)/errcodes.c
149         make $(builddir)/errcodes
150         $(builddir)/errcodes > $@-tmp
151         mv -f $@-tmp $@
152
153 algorithms.texi: printlist
154         $(builddir)/printlist > $@-tmp
155         mv -f $@-tmp $@
156
157 alerts.texi: alert-printlist
158         $(builddir)/alert-printlist > $@-tmp
159         mv -f $@-tmp $@
160
161 enums.texi: $(srcdir)/../lib/includes/gnutls/*.h $(builddir)/../lib/includes/gnutls/*.h
162         echo "" > $@-tmp
163         for i in $^; do \
164                 echo -n "Creating documentation for file $$i... " && \
165                 $(srcdir)/scripts/gdoc -texinfo $$i >> $@-tmp && \
166                 echo "ok"; \
167         done
168         $(srcdir)/scripts/split-texi.pl enums enum < $@-tmp
169         mv -f $@-tmp $@
170
171 # Guile texinfos.
172
173 guile_texi = core.c.texi
174 BUILT_SOURCES        = $(guile_texi)
175 MAINTAINERCLEANFILES += $(guile_texi)
176 EXTRA_DIST           += $(guile_texi) extract-guile-c-doc.scm
177 guile_TEXINFOS       = gnutls-guile.texi $(guile_texi)
178
179 if HAVE_GUILE
180
181 GUILE_FOR_BUILD =                               \
182   GUILE_AUTO_COMPILE=0                          \
183   $(GUILE) -L $(top_srcdir)/guile/modules
184
185 SNARF_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)                      \
186          -I$(top_srcdir)/lib/includes -I$(top_builddir)/lib/includes    \
187          -I$(top_srcdir)/extra/includes                         \
188          -I$(top_srcdir)/guile/src -I$(top_builddir)/guile/src          \
189          $(GUILE_CFLAGS)
190
191 core.c.texi: $(top_srcdir)/guile/src/core.c
192         $(MAKE) -C ../guile/src built-sources &&                        \
193         $(GUILE_FOR_BUILD) -l "$(srcdir)/extract-guile-c-doc.scm"       \
194            -e '(apply main (cdr (command-line)))'                       \
195            -- "$^" "$(CPP)" "$(SNARF_CPPFLAGS) $(CPPFLAGS)"             \
196            > "$@"
197
198 else !HAVE_GUILE
199
200 core.c.texi:
201         echo "(Guile not available, documentation not generated.)" > $@
202
203 endif !HAVE_GUILE
204
205 clean-am:
206         rm -rf enums gnutls.info gnutls.html gnutls.pdf enums.texi
207