c8fc4821e27ad348bc8f6f20b24ba01d5b916847
[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
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 = $(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
46 common_source =  \
47               gpg.h             \
48               build-packet.c    \
49               compress.c        \
50               $(bzip2_source)   \
51               filter.h          \
52               free-packet.c     \
53               getkey.c          \
54               keydb.c keydb.h    \
55               keyring.c keyring.h \
56               seskey.c          \
57               kbnode.c          \
58               main.h            \
59               mainproc.c        \
60               armor.c           \
61               mdfilter.c        \
62               textfilter.c      \
63               progress.c        \
64               misc.c            \
65               rmd160.c rmd160.h \
66               options.h         \
67               openfile.c        \
68               keyid.c           \
69               packet.h          \
70               parse-packet.c    \
71               cpr.c             \
72               plaintext.c       \
73               sig-check.c       \
74               keylist.c         \
75               pkglue.c pkglue.h 
76
77 gpg2_SOURCES  = gpg.c           \
78               server.c          \
79               $(common_source)  \
80               pkclist.c         \
81               skclist.c         \
82               pubkey-enc.c      \
83               passphrase.c      \
84               decrypt.c         \
85               decrypt-data.c    \
86               cipher.c          \
87               encrypt.c         \
88               sign.c            \
89               verify.c          \
90               revoke.c          \
91               keyedit.c         \
92               dearmor.c         \
93               import.c          \
94               export.c          \
95               trustdb.c         \
96               trustdb.h         \
97               tdbdump.c         \
98               tdbio.c           \
99               tdbio.h           \
100               delkey.c          \
101               keygen.c          \
102               helptext.c        \
103               keyserver.c       \
104               keyserver-internal.h \
105               photoid.c photoid.h \
106               call-agent.c call-agent.h \
107               card-util.c \
108               exec.c exec.h
109
110 gpgv2_SOURCES = gpgv.c           \
111               $(common_source)  \
112               verify.c          
113
114 #gpgd_SOURCES = gpgd.c \
115 #              ks-proto.h \
116 #              ks-proto.c \
117 #              ks-db.c \
118 #              ks-db.h \
119 #              $(common_source)
120
121 LDADD =  $(needed_libs) ../common/libgpgrl.a \
122          $(ZLIBS) $(DNSLIBS) $(LIBREADLINE) \
123          $(LIBINTL) $(CAPLIBS) $(NETLIBS)
124 gpg2_LDADD =  $(LDADD) $(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
125              $(LIBICONV) $(extra_sys_libs)
126 gpg2_LDFLAGS = $(extra_bin_ldflags)
127 gpgv2_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
128               $(LIBICONV) $(extra_sys_libs)
129 gpgv2_LDFLAGS = $(extra_bin_ldflags)
130
131 t_common_ldadd = 
132 module_tests = t-rmd160
133 t_rmd160_SOURCES = t-rmd160.c rmd160.c
134 t_rmd160_LDADD = $(t_common_ldadd)
135
136
137 $(PROGRAMS): $(needed_libs) ../common/libgpgrl.a
138
139 install-data-local:
140         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
141         $(INSTALL_DATA) $(srcdir)/options.skel \
142                                 $(DESTDIR)$(pkgdatadir)/gpg-conf.skel
143
144 uninstall-local:
145         -@rm $(DESTDIR)$(pkgdatadir)/gpg-conf.skel        
146
147
148 # There has never been a gpg for WindowsCE, thus we don't need a gpg2 here
149 if HAVE_W32CE_SYSTEM
150 install-exec-hook:
151         mv -f $(DESTDIR)$(bindir)/gpg2$(EXEEXT) \
152               $(DESTDIR)$(bindir)/gpg$(EXEEXT)
153 endif