2 # Copyright (C) 1998, 1999, 2000, 2001, 2002,
3 # 2003, 2006, 2010 Free Software Foundation, Inc.
5 # This file is part of GnuPG.
7 # GnuPG is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # GnuPG is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, see <https://www.gnu.org/licenses/>.
20 ## Process this file with automake to produce Makefile.in
22 EXTRA_DIST = distsigkey.gpg \
23 gpg-w32info.rc gpg.w32-manifest.in \
24 gpgv-w32info.rc gpgv.w32-manifest.in \
25 ChangeLog-2011 test.c t-keydb-keyring.kbx \
26 t-keydb-get-keyblock.gpg t-stutter-data.asc \
31 include $(top_srcdir)/am/cmacros.am
33 AM_CFLAGS = $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS) \
34 $(LIBASSUAN_CFLAGS) $(NPTH_CFLAGS) $(GPG_ERROR_CFLAGS)
36 needed_libs = ../kbx/libkeybox.a $(libcommonpth) ../regexp/libregexp.a
38 # Because there are no program specific transform macros we need to
39 # work around that to allow installing gpg as gpg2.
40 gpg2_hack_list = gpg gpgv
42 gpg2_hack_uninst = gpg2 gpgv2
45 gpg2_hack_uninst = $(gpg2_hack_list)
49 # NB: We use noinst_ for gpg and gpgv so that we can install them with
50 # the install-hook target under the name gpg2/gpgv2.
52 noinst_PROGRAMS += gpgv
53 noinst_PROGRAMS += $(module_tests)
57 TESTS = $(module_tests)
60 abs_top_srcdir=$(abs_top_srcdir)
62 if ENABLE_BZIP2_SUPPORT
63 bzip2_source = compress-bz2.c
68 if ENABLE_CARD_SUPPORT
69 card_source = card-util.c
77 trust_source = trustdb.c trustdb.h tdbdump.c tdbio.c tdbio.h
81 tofu_source = tofu.h tofu.c gpgsql.c gpgsql.h
88 gpg_rc_objs = gpg-w32info.o
89 gpgv_rc_objs = gpgv-w32info.o
91 gpg-w32info.o : gpg.w32-manifest ../common/w32info-rc.h
92 gpgv-w32info.o : gpgv.w32-manifest ../common/w32info-rc.h
109 keyring.c keyring.h \
130 objcache.c objcache.h \
133 gpg_sources = server.c \
155 keyserver-internal.h \
156 call-dirmngr.c call-dirmngr.h \
157 photoid.c photoid.h \
158 call-agent.c call-agent.h \
159 trust.c $(trust_source) $(tofu_source) \
162 key-clean.c key-clean.h \
163 key-check.c key-check.h
165 gpg_SOURCES = gpg.c \
166 keyedit.c keyedit.h \
169 gpgv_SOURCES = gpgv.c \
173 LDADD = $(needed_libs) ../common/libgpgrl.a \
174 $(ZLIBS) $(LIBINTL) $(CAPLIBS)
175 gpg_LDADD = $(LDADD) $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) $(LIBREADLINE) \
176 $(LIBASSUAN_LIBS) $(NPTH_LIBS) $(GPG_ERROR_LIBS) $(NETLIBS) \
177 $(LIBICONV) $(gpg_rc_objs)
179 gpgv_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) \
180 $(LIBASSUAN_LIBS) $(NPTH_LIBS) $(GPG_ERROR_LIBS) $(NETLIBS) \
181 $(LIBICONV) $(gpgv_rc_objs)
186 module_tests = t-rmd160 t-keydb t-keydb-get-keyblock t-stutter
187 t_rmd160_SOURCES = t-rmd160.c rmd160.c
188 t_rmd160_LDADD = $(t_common_ldadd)
189 t_keydb_SOURCES = t-keydb.c test-stubs.c $(common_source)
190 t_keydb_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) \
191 $(LIBASSUAN_LIBS) $(NPTH_LIBS) $(GPG_ERROR_LIBS) $(NETLIBS) \
192 $(LIBICONV) $(t_common_ldadd)
193 t_keydb_get_keyblock_SOURCES = t-keydb-get-keyblock.c test-stubs.c \
195 t_keydb_get_keyblock_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) \
196 $(LIBASSUAN_LIBS) $(NPTH_LIBS) $(GPG_ERROR_LIBS) $(NETLIBS) \
197 $(LIBICONV) $(t_common_ldadd)
198 t_stutter_SOURCES = t-stutter.c test-stubs.c \
200 t_stutter_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) \
201 $(LIBASSUAN_LIBS) $(NPTH_LIBS) $(GPG_ERROR_LIBS) $(NETLIBS) \
202 $(LIBICONV) $(t_common_ldadd)
205 $(PROGRAMS): $(needed_libs) ../common/libgpgrl.a
207 # NB: To install gpg and gpgv we use this -hook. This code has to
208 # duplicate most of the automake generated install-binPROGRAMS target
209 # so that directories are created and the transform feature works.
211 @echo "running install-exec-hook"; \
212 echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
213 $(MKDIR_P) "$(DESTDIR)$(bindir)"; \
214 for p in $(gpg2_hack_list); do \
215 echo "$$p$(EXEEXT) $$p$(EXEEXT)"; done | \
216 sed 's/$(EXEEXT)$$//' | \
217 while read p p1; do if test -f $$p \
218 ; then echo "$$p"; echo "$$p"; else :; fi; \
220 sed -e 'p;s,.*/,,;n;h' \
222 -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
223 sed 'N;N;N;s,\n, ,g' | \
224 $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
225 { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
226 if ($$2 == $$4) files[d] = files[d] " " $$1; \
227 else { print "f", $$3 "/" $$4, $$1; } } \
228 END { for (d in files) print "f", d, files[d] }' | \
229 while read type dir files; do \
230 for f in $$files; do \
231 if test $(use_gpg2_hack) = yes ; \
232 then f2=`echo "$${f}" | sed 's/$(EXEEXT)$$//'`2$(EXEEXT); \
235 echo "$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \
236 $${f} '$(DESTDIR)$(bindir)/$${f2}'"; \
237 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \
238 $${f} "$(DESTDIR)$(bindir)/$${f2}"; \
244 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
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)/distsigkey.gpg
252 -@files=`for p in $(gpg2_hack_uninst); do echo "$$p"; done | \
253 sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
254 -e 's/$$/$(EXEEXT)/' \
256 echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
257 cd "$(DESTDIR)$(bindir)" && rm -f $$files