Make use of the *_NAME etc macros.
[gnupg.git] / g10 / Makefile.am
1 # Copyright (C) 1998, 1999, 2000, 2001, 2002,
2 #               2003, 2006, 2010  Free Software Foundation, Inc.
3 #
4 # This file is part of GnuPG.
5 #
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.
10 #
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.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
18
19 ## Process this file with automake to produce Makefile.in
20
21 EXTRA_DIST = options.skel ChangeLog-2011 gpg-w32info.rc
22
23 AM_CPPFLAGS = -I$(top_srcdir)/gl -I$(top_srcdir)/common \
24               -I$(top_srcdir)/include -I$(top_srcdir)/intl
25
26 include $(top_srcdir)/am/cmacros.am
27
28 AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS)
29
30 needed_libs = ../kbx/libkeybox.a $(libcommon) ../gl/libgnu.a
31
32 bin_PROGRAMS = gpg2
33 if !HAVE_W32CE_SYSTEM
34 bin_PROGRAMS += gpgv2
35 endif
36 noinst_PROGRAMS = $(module_tests)
37 TESTS = $(module_tests)
38
39 if ENABLE_BZIP2_SUPPORT
40 bzip2_source = compress-bz2.c
41 else
42 bzip2_source =
43 endif
44
45 if HAVE_W32_SYSTEM
46 resource_objs += gpg-w32info.o
47 endif
48
49 common_source =  \
50               gpg.h             \
51               build-packet.c    \
52               compress.c        \
53               $(bzip2_source)   \
54               filter.h          \
55               free-packet.c     \
56               getkey.c          \
57               keydb.c keydb.h    \
58               keyring.c keyring.h \
59               seskey.c          \
60               kbnode.c          \
61               main.h            \
62               mainproc.c        \
63               armor.c           \
64               mdfilter.c        \
65               textfilter.c      \
66               progress.c        \
67               misc.c            \
68               rmd160.c rmd160.h \
69               options.h         \
70               openfile.c        \
71               keyid.c           \
72               packet.h          \
73               parse-packet.c    \
74               cpr.c             \
75               plaintext.c       \
76               sig-check.c       \
77               keylist.c         \
78               pkglue.c pkglue.h \
79               ecdh.c
80
81 gpg2_SOURCES  = gpg.c           \
82               server.c          \
83               $(common_source)  \
84               pkclist.c         \
85               skclist.c         \
86               pubkey-enc.c      \
87               passphrase.c      \
88               decrypt.c         \
89               decrypt-data.c    \
90               cipher.c          \
91               encrypt.c         \
92               sign.c            \
93               verify.c          \
94               revoke.c          \
95               keyedit.c         \
96               dearmor.c         \
97               import.c          \
98               export.c          \
99               trustdb.c         \
100               trustdb.h         \
101               tdbdump.c         \
102               tdbio.c           \
103               tdbio.h           \
104               delkey.c          \
105               keygen.c          \
106               helptext.c        \
107               keyserver.c       \
108               keyserver-internal.h \
109               call-dirmngr.c call-dirmngr.h \
110               photoid.c photoid.h \
111               call-agent.c call-agent.h \
112               card-util.c \
113               exec.c exec.h
114
115 gpgv2_SOURCES = gpgv.c           \
116               $(common_source)  \
117               verify.c
118
119 #gpgd_SOURCES = gpgd.c \
120 #              ks-proto.h \
121 #              ks-proto.c \
122 #              ks-db.c \
123 #              ks-db.h \
124 #              $(common_source)
125
126 # FIXME: Libkeybox.a links to libksba thus we need to add libksba
127 # here, even that it is not used by gpg.  A proper solution would
128 # either to split up libkeybox.a or to use a separate keybox daemon.
129 LDADD =  $(needed_libs) ../common/libgpgrl.a \
130          $(ZLIBS) $(DNSLIBS) $(LIBREADLINE) \
131          $(LIBINTL) $(CAPLIBS) $(NETLIBS)
132 gpg2_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) \
133              $(KSBA_LIBS) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
134              $(LIBICONV) $(resource_objs) $(extra_sys_libs)
135 gpg2_LDFLAGS = $(extra_bin_ldflags)
136 gpgv2_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) \
137               $(KSBA_LIBS) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
138               $(LIBICONV) $(resource_objs) $(extra_sys_libs)
139 gpgv2_LDFLAGS = $(extra_bin_ldflags)
140
141 t_common_ldadd =
142 module_tests = t-rmd160
143 t_rmd160_SOURCES = t-rmd160.c rmd160.c
144 t_rmd160_LDADD = $(t_common_ldadd)
145
146
147 $(PROGRAMS): $(needed_libs) ../common/libgpgrl.a
148
149 install-data-local:
150         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
151         $(INSTALL_DATA) $(srcdir)/options.skel \
152                                 $(DESTDIR)$(pkgdatadir)/gpg-conf.skel
153
154 uninstall-local:
155         -@rm $(DESTDIR)$(pkgdatadir)/gpg-conf.skel
156
157
158 # There has never been a gpg for WindowsCE, thus we don't need a gpg2 here
159 if HAVE_W32CE_SYSTEM
160 install-exec-hook:
161         mv -f $(DESTDIR)$(bindir)/gpg2$(EXEEXT) \
162               $(DESTDIR)$(bindir)/gpg$(EXEEXT)
163 endif