1 # Makefile for common gnupg modules
2 # Copyright (C) 2001, 2003, 2007, 2010 Free Software Foundation, Inc.
4 # This file is part of GnuPG.
6 # GnuPG is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # GnuPG is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <https://www.gnu.org/licenses/>.
19 ## Process this file with automake to produce Makefile.in
21 EXTRA_DIST = mkstrtable.awk exaudit.awk exstatus.awk ChangeLog-2011 \
22 audit-events.h status-codes.h ChangeLog.jnlib \
23 ChangeLog-2011.include w32info-rc.h.in gnupg.ico \
26 noinst_LIBRARIES = libcommon.a libcommonpth.a libgpgrl.a
28 noinst_LIBRARIES += libsimple-pwquery.a
30 noinst_PROGRAMS = $(module_tests) $(module_maint_tests)
31 TESTS = $(module_tests)
33 BUILT_SOURCES = audit-events.h status-codes.h
35 MAINTAINERCLEANFILES = audit-events.h status-codes.h
39 AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBASSUAN_CFLAGS) $(KSBA_CFLAGS)
41 include $(top_srcdir)/am/cmacros.am
46 util.h utilproto.h fwddecl.h i18n.c i18n.h \
47 types.h host2net.h dynload.h w32help.h \
48 mapstrings.c stringhelp.c stringhelp.h \
50 utf8conv.c utf8conv.h \
51 argparse.c argparse.h \
54 mischelp.c mischelp.h \
64 sysutils.c sysutils.h \
68 b64enc.c b64dec.c zb32.c zb32.h \
71 mbox-util.c mbox-util.h \
76 ccparray.c ccparray.h \
79 asshelp.c asshelp2.c asshelp.h \
84 session-env.c session-env.h \
87 ssh-utils.c ssh-utils.h \
92 exectool.c exectool.h \
93 server-help.c server-help.h \
94 name-value.c name-value.h \
96 ksba-io-support.c ksba-io-support.h
100 common_sources += w32-reg.c
103 # To make the code easier to read we have split home some code into
104 # separate source files.
107 common_sources += exechelp-w32ce.c
109 common_sources += exechelp-w32.c
112 common_sources += exechelp-posix.c
115 # Sources only useful without NPTH.
116 without_npth_sources = \
117 get-passphrase.c get-passphrase.h
119 # Sources only useful with NPTH.
120 with_npth_sources = \
121 call-gpg.c call-gpg.h
123 libcommon_a_SOURCES = $(common_sources) $(without_npth_sources)
124 libcommon_a_CFLAGS = $(AM_CFLAGS) $(LIBASSUAN_CFLAGS) -DWITHOUT_NPTH=1
126 libcommonpth_a_SOURCES = $(common_sources) $(with_npth_sources)
127 libcommonpth_a_CFLAGS = $(AM_CFLAGS) $(LIBASSUAN_CFLAGS) $(NPTH_CFLAGS)
129 if !HAVE_W32CE_SYSTEM
130 libsimple_pwquery_a_SOURCES = \
131 simple-pwquery.c simple-pwquery.h asshelp.c asshelp.h
132 libsimple_pwquery_a_CFLAGS = $(AM_CFLAGS) $(LIBASSUAN_CFLAGS)
135 libgpgrl_a_SOURCES = \
139 # Note: Due to the dependency on Makefile, the file will always be
140 # rebuilt, so we allow this only in maintainer mode.
142 # Create the audit-events.h include file from audit.h
143 # Note: We create the target file in the source directory because it
144 # is a distributed built source. If we would not do that we may end
145 # up with two files and then it is not clear which version of the
146 # files will be picked up.
147 audit-events.h: Makefile.am mkstrtable.awk exaudit.awk audit.h
148 $(AWK) -f $(srcdir)/exaudit.awk $(srcdir)/audit.h \
149 | $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=3 -v nogettext=1 \
150 -v namespace=eventstr_ > $(srcdir)/audit-events.h
152 # Create the status-codes.h include file from status.h
153 status-codes.h: Makefile.am mkstrtable.awk exstatus.awk status.h
154 $(AWK) -f $(srcdir)/exstatus.awk $(srcdir)/status.h \
155 | $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=3 -v nogettext=1 \
156 -v namespace=statusstr_ > $(srcdir)/status-codes.h
162 module_tests = t-stringhelp t-timestuff \
163 t-convert t-percent t-gettime t-sysutils t-sexputil \
164 t-session-env t-openpgp-oid t-ssh-utils \
165 t-mapstrings t-zb32 t-mbox-util t-iobuf t-strlist \
166 t-name-value t-ccparray t-recsel
167 if !HAVE_W32CE_SYSTEM
168 module_tests += t-exechelp t-exectool
171 module_tests += t-w32-reg
175 module_maint_tests = t-helpfile t-b64
180 t_extra_src = t-support.h
182 t_common_cflags = $(KSBA_CFLAGS) $(LIBGCRYPT_CFLAGS) \
183 $(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS) $(INCICONV)
184 t_common_ldadd = libcommon.a \
185 $(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
186 $(LIBINTL) $(LIBICONV)
190 t_stringhelp_SOURCES = t-stringhelp.c $(t_extra_src)
191 t_stringhelp_LDADD = $(t_common_ldadd)
193 t_timestuff_SOURCES = t-timestuff.c $(t_extra_src)
194 t_timestuff_LDADD = $(t_common_ldadd)
196 t_convert_LDADD = $(t_common_ldadd)
197 t_percent_LDADD = $(t_common_ldadd)
198 t_gettime_LDADD = $(t_common_ldadd)
199 t_sysutils_LDADD = $(t_common_ldadd)
200 t_helpfile_LDADD = $(t_common_ldadd)
201 t_sexputil_LDADD = $(t_common_ldadd)
202 t_b64_LDADD = $(t_common_ldadd)
203 t_exechelp_LDADD = $(t_common_ldadd)
204 t_exectool_LDADD = $(t_common_ldadd)
205 t_session_env_LDADD = $(t_common_ldadd)
206 t_openpgp_oid_LDADD = $(t_common_ldadd)
207 t_ssh_utils_LDADD = $(t_common_ldadd)
208 t_mapstrings_LDADD = $(t_common_ldadd)
210 t_zb32_SOURCES = t-zb32.c $(t_extra_src)
211 t_zb32_LDADD = $(t_common_ldadd)
213 t_mbox_util_LDADD = $(t_common_ldadd)
214 t_iobuf_LDADD = $(t_common_ldadd)
215 t_strlist_LDADD = $(t_common_ldadd)
216 t_name_value_LDADD = $(t_common_ldadd)
217 t_ccparray_LDADD = $(t_common_ldadd)
218 t_recsel_LDADD = $(t_common_ldadd)
220 # System specific test
222 t_w32_reg_SOURCES = t-w32-reg.c $(t_extra_src)
223 t_w32_reg_LDADD = $(t_common_ldadd)
226 # All programs should depend on the created libs.
227 $(PROGRAMS) : libcommon.a libcommonpth.a