Readline fix to be robust against platforms where readline has its own
[gnupg.git] / g10 / Makefile.am
1 # Copyright (C) 1998, 1999, 2000, 2001, 2002,
2 #               2003 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 2 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, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19
20 ## Process this file with automake to produce Makefile.in
21
22 INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl
23 EXTRA_DIST = options.skel
24 # it seems that we can't use this with automake 1.5
25 #OMIT_DEPENDENCIES = zlib.h zconf.h
26 libexecdir = @libexecdir@/@PACKAGE@
27 if ! HAVE_DOSISH_SYSTEM
28 AM_CFLAGS = -DGNUPG_LIBEXECDIR="\"$(libexecdir)\""
29 endif
30 needed_libs = ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a
31 other_libs = $(LIBICONV) $(LIBINTL) $(CAPLIBS)
32
33 #noinst_PROGRAMS = gpgd
34 bin_PROGRAMS = gpg gpgv
35
36 if ENABLE_BZIP2_SUPPORT
37 bzip2_source = compress-bz2.c
38 else
39 bzip2_source =
40 endif
41
42 common_source =  \
43               global.h          \
44               build-packet.c    \
45               compress.c        \
46               $(bzip2_source)   \
47               filter.h          \
48               free-packet.c     \
49               getkey.c          \
50               keydb.c keydb.h    \
51               keyring.c keyring.h \
52               seskey.c          \
53               kbnode.c          \
54               main.h            \
55               mainproc.c        \
56               armor.c           \
57               mdfilter.c        \
58               textfilter.c      \
59               progress.c        \
60               misc.c            \
61               options.h         \
62               openfile.c        \
63               keyid.c           \
64               packet.h          \
65               parse-packet.c    \
66               comment.c         \
67               status.c          \
68               status.h          \
69               plaintext.c       \
70               sig-check.c       \
71               keylist.c         \
72               signal.c
73
74 if ENABLE_CARD_SUPPORT
75 card_support_source_g10 = card-util.c 
76 card_support_source_scd = \
77         app-common.h \
78         app-openpgp.c \
79         iso7816.c iso7816.h \
80         apdu.c apdu.h \
81         ccid-driver.c ccid-driver.h
82 card_support_source_local = cardglue.c cardglue.h tlv.c tlv.h
83 else
84 card_support_source_g10 =
85 card_support_source_scd = 
86 card_support_source_local =
87 endif
88
89 card_support_source = $(card_support_source_local) $(card_support_source_g10) $(card_support_source_scd)
90
91 gpg_SOURCES  = g10.c            \
92               $(common_source)  \
93               $(card_support_source) \
94               pkclist.c         \
95               skclist.c         \
96               pubkey-enc.c      \
97               passphrase.c      \
98               seckey-cert.c     \
99               encr-data.c       \
100               cipher.c          \
101               encode.c          \
102               sign.c            \
103               verify.c          \
104               revoke.c          \
105               decrypt.c         \
106               keyedit.c         \
107               dearmor.c         \
108               import.c          \
109               export.c          \
110               trustdb.c         \
111               trustdb.h         \
112               tdbdump.c         \
113               tdbio.c           \
114               tdbio.h           \
115               delkey.c          \
116               keygen.c          \
117               pipemode.c        \
118               helptext.c        \
119               keyserver.c       \
120               keyserver-internal.h \
121               photoid.c photoid.h \
122               exec.c exec.h
123
124 gpgv_SOURCES = gpgv.c           \
125               $(common_source)  \
126               verify.c          
127
128 #gpgd_SOURCES = gpgd.c \
129 #              ks-proto.h \
130 #              ks-proto.c \
131 #              ks-db.c \
132 #              ks-db.h \
133 #              $(common_source)
134
135 LDADD =  $(needed_libs) $(other_libs) @ZLIBS@ @W32LIBS@ @LIBREADLINE@
136 gpg_LDADD = $(LDADD) @DLLIBS@ @NETLIBS@ @LIBUSB_LIBS@
137
138 $(PROGRAMS): $(needed_libs)
139
140 install-data-local:
141         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
142         $(INSTALL_DATA) $(srcdir)/options.skel \
143                                 $(DESTDIR)$(pkgdatadir)/options.skel
144         @set -e;\
145          if test -f $(DESTDIR)$(bindir)/gpgm ; then \
146            echo "removing obsolete gpgm binary" ;   \
147            rm $(DESTDIR)$(bindir)/gpgm ;            \
148          fi
149
150 # Helper to update some source files.
151 update-source-from-gnupg-2:
152         @set -e; \
153          if test -d ../../gnupg-1.9/scd; then dir="../../gnupg-1.9"; \
154          elif test -d ../../gnupg/scd; then dir="../../gnupg"; \
155          else exit 1; \
156          fi; \
157          for i in $(card_support_source_scd); do \
158            cp $$dir/scd/$$i $$i; echo $$i; \
159          done ;\
160          for i in $(card_support_source_g10); do \
161            cp $$dir/g10/$$i $$i; echo $$i; \
162          done ; \
163          echo "Please remember to update the ChangeLog accordingly!"