1 # Copyright (C) 1998, 1999, 2000, 2001, 2002,
2 # 2003, 2006, 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 = options.skel dirmngr-conf.skel distsigkey.gpg \
22 ChangeLog-2011 gpg-w32info.rc \
23 gpg.w32-manifest.in test.c t-keydb-keyring.kbx \
24 t-keydb-get-keyblock.gpg t-stutter-data.asc
26 AM_CPPFLAGS = -I$(top_srcdir)/common
28 include $(top_srcdir)/am/cmacros.am
30 AM_CFLAGS = $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS) \
31 $(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS)
33 needed_libs = ../kbx/libkeybox.a $(libcommon)
35 # Because there are no program specific transform macros we need to
36 # work around that to allow installing gpg as gpg2.
37 gpg2_hack_list = gpg gpgv
39 gpg2_hack_uninst = gpg2 gpgv2
42 gpg2_hack_uninst = $(gpg2_hack_list)
46 # NB: We use noinst_ for gpg and gpgv so that we can install them with
47 # the install-hook target under the name gpg2/gpgv2.
50 noinst_PROGRAMS += gpgv
53 noinst_PROGRAMS += gpgcompose
55 noinst_PROGRAMS += $(module_tests)
56 TESTS = $(module_tests)
58 if ENABLE_BZIP2_SUPPORT
59 bzip2_source = compress-bz2.c
64 if ENABLE_CARD_SUPPORT
65 card_source = card-util.c
73 trust_source = trustdb.c trustdb.h tdbdump.c tdbio.c tdbio.h
77 tofu_source = tofu.h tofu.c gpgsql.c gpgsql.h sqrtu32.c sqrtu32.h
84 resource_objs += gpg-w32info.o
86 gpg-w32info.o : gpg.w32-manifest
100 keyring.c keyring.h \
123 gpg_sources = server.c \
144 keyserver-internal.h \
145 call-dirmngr.c call-dirmngr.h \
146 photoid.c photoid.h \
147 call-agent.c call-agent.h \
148 trust.c $(trust_source) $(tofu_source) \
152 gpg_SOURCES = gpg.c \
156 gpgcompose_SOURCES = gpgcompose.c $(gpg_sources)
157 gpgv_SOURCES = gpgv.c \
161 #gpgd_SOURCES = gpgd.c \
168 LDADD = $(needed_libs) ../common/libgpgrl.a \
169 $(ZLIBS) $(LIBINTL) $(CAPLIBS) $(NETLIBS)
170 gpg_LDADD = $(LDADD) $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) $(LIBREADLINE) \
171 $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
172 $(LIBICONV) $(resource_objs) $(extra_sys_libs)
173 gpg_LDFLAGS = $(extra_bin_ldflags)
174 gpgv_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) \
176 $(LIBICONV) $(resource_objs) $(extra_sys_libs)
177 gpgv_LDFLAGS = $(extra_bin_ldflags)
179 gpgcompose_LDADD = $(LDADD) $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) $(LIBREADLINE) \
180 $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
181 $(LIBICONV) $(resource_objs) $(extra_sys_libs)
182 gpgcompose_LDFLAGS = $(extra_bin_ldflags)
185 module_tests = t-rmd160 t-keydb t-keydb-get-keyblock t-stutter
186 t_rmd160_SOURCES = t-rmd160.c rmd160.c
187 t_rmd160_LDADD = $(t_common_ldadd)
188 t_keydb_SOURCES = t-keydb.c test-stubs.c $(common_source)
189 t_keydb_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
190 $(LIBICONV) $(t_common_ldadd)
191 t_keydb_get_keyblock_SOURCES = t-keydb-get-keyblock.c test-stubs.c \
193 t_keydb_get_keyblock_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
194 $(LIBICONV) $(t_common_ldadd)
195 t_stutter_SOURCES = t-stutter.c test-stubs.c \
197 t_stutter_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \
198 $(LIBICONV) $(t_common_ldadd)
201 $(PROGRAMS): $(needed_libs) ../common/libgpgrl.a
203 # NB: To install gpg and gpgv we use this -hook. This code has to
204 # duplicate most of the automake generated install-binPROGRAMS target
205 # so that directories are created and the transform feature works.
207 @echo "running install-exec-hook"; \
208 echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
209 $(MKDIR_P) "$(DESTDIR)$(bindir)"; \
210 for p in $(gpg2_hack_list); do \
211 echo "$$p$(EXEEXT) $$p$(EXEEXT)"; done | \
212 sed 's/$(EXEEXT)$$//' | \
213 while read p p1; do if test -f $$p \
214 ; then echo "$$p"; echo "$$p"; else :; fi; \
216 sed -e 'p;s,.*/,,;n;h' \
218 -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
219 sed 'N;N;N;s,\n, ,g' | \
220 $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
221 { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
222 if ($$2 == $$4) files[d] = files[d] " " $$1; \
223 else { print "f", $$3 "/" $$4, $$1; } } \
224 END { for (d in files) print "f", d, files[d] }' | \
225 while read type dir files; do \
226 for f in $$files; do \
227 if test $(use_gpg2_hack) = yes ; \
228 then f2=`echo "$${f}" | sed 's/$(EXEEXT)$$//'`2$(EXEEXT); \
231 echo "$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \
232 $${f} '$(DESTDIR)$(bindir)/$${f2}'"; \
233 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \
234 $${f} "$(DESTDIR)$(bindir)/$${f2}"; \
240 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
241 $(INSTALL_DATA) $(srcdir)/options.skel \
242 $(DESTDIR)$(pkgdatadir)/gpg-conf.skel
243 $(INSTALL_DATA) $(srcdir)/dirmngr-conf.skel \
244 $(DESTDIR)$(pkgdatadir)/dirmngr-conf.skel
245 $(INSTALL_DATA) $(srcdir)/distsigkey.gpg \
246 $(DESTDIR)$(pkgdatadir)/distsigkey.gpg
248 # NB: For uninstalling gpg and gpgv we use -local because there is
249 # no need for a specific order the targets need to be run.
251 -@rm $(DESTDIR)$(pkgdatadir)/gpg-conf.skel
252 -@rm $(DESTDIR)$(pkgdatadir)/dirmngr-conf.skel
253 -@rm $(DESTDIR)$(pkgdatadir)/distsigkey.gpg
254 -@files=`for p in $(gpg2_hack_uninst); do echo "$$p"; done | \
255 sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
256 -e 's/$$/$(EXEEXT)/' \
258 echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
259 cd "$(DESTDIR)$(bindir)" && rm -f $$files