37fbe0079cd964e96b29fa0effadd3fd5553cbdb
[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
32 #noinst_PROGRAMS = gpgd
33 bin_PROGRAMS = gpg gpgv
34
35 common_source =  \
36               global.h          \
37               build-packet.c    \
38               compress.c        \
39               filter.h          \
40               free-packet.c     \
41               getkey.c          \
42               keydb.c keydb.h    \
43               keyring.c keyring.h \
44               seskey.c          \
45               kbnode.c          \
46               main.h            \
47               mainproc.c        \
48               armor.c           \
49               mdfilter.c        \
50               textfilter.c      \
51               progress.c        \
52               misc.c            \
53               options.h         \
54               openfile.c        \
55               keyid.c           \
56               packet.h          \
57               parse-packet.c    \
58               comment.c         \
59               status.c          \
60               status.h          \
61               plaintext.c       \
62               sig-check.c       \
63               keylist.c         \
64               signal.c
65
66 if ENABLE_CARD_SUPPORT
67 card_support_source_g10 = card-util.c 
68 card_support_source_scd = \
69         app-common.h \
70         app-openpgp.c \
71         iso7816.c iso7816.h \
72         apdu.c apdu.h \
73         ccid-driver.c ccid-driver.h
74 card_support_source_local = cardglue.c cardglue.h
75 else
76 card_support_source_g10 =
77 card_support_source_scd = 
78 card_support_source_local =
79 endif
80
81 card_support_source = $(card_support_source_local) $(card_support_source_g10) $(card_support_source_scd)
82
83 gpg_SOURCES  = g10.c            \
84               $(common_source)  \
85               $(card_support_source) \
86               pkclist.c         \
87               skclist.c         \
88               pubkey-enc.c      \
89               passphrase.c      \
90               seckey-cert.c     \
91               encr-data.c       \
92               cipher.c          \
93               encode.c          \
94               sign.c            \
95               verify.c          \
96               revoke.c          \
97               decrypt.c         \
98               keyedit.c         \
99               dearmor.c         \
100               import.c          \
101               export.c          \
102               trustdb.c         \
103               trustdb.h         \
104               tdbdump.c         \
105               tdbio.c           \
106               tdbio.h           \
107               delkey.c          \
108               keygen.c          \
109               pipemode.c        \
110               helptext.c        \
111               keyserver.c       \
112               keyserver-internal.h \
113               photoid.c photoid.h \
114               exec.c exec.h
115
116 gpgv_SOURCES = gpgv.c           \
117               $(common_source)  \
118               verify.c          
119
120 #gpgd_SOURCES = gpgd.c \
121 #              ks-proto.h \
122 #              ks-proto.c \
123 #              ks-db.c \
124 #              ks-db.h \
125 #              $(common_source)
126
127 LDADD =  $(needed_libs) @LIBINTL@ @CAPLIBS@ @ZLIBS@ @W32LIBS@
128 # gpg gets LIBOBJS to add in mkdtemp if the platform doesn't have it
129 gpg_LDADD = @LIBOBJS@ $(LDADD) @DLLIBS@ @NETLIBS@ @LIBUSB_LIBS@
130
131 $(PROGRAMS): $(needed_libs)
132
133 install-data-local:
134         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
135         $(INSTALL_DATA) $(srcdir)/options.skel \
136                                 $(DESTDIR)$(pkgdatadir)/options.skel
137         @set -e;\
138          if test -f $(DESTDIR)$(bindir)/gpgm ; then \
139            echo "removing obsolete gpgm binary" ;   \
140            rm $(DESTDIR)$(bindir)/gpgm ;            \
141          fi
142
143 # Helper to update some source files.
144 update-source-from-gnupg-2:
145         @set -e; \
146          if test -d ../../gnupg-1.9/scd; then dir="../../gnupg-1.9"; \
147          elif test -d ../../gnupg/scd; then dir="../../gnupg"; \
148          else exit 1; \
149          fi; \
150          for i in $(card_support_source_scd); do \
151            cp $$dir/scd/$$i $$i; echo $$i; \
152          done ;\
153          for i in $(card_support_source_g10); do \
154            cp $$dir/g10/$$i $$i; echo $$i; \
155          done ; \
156          echo "Please remember to update the ChangeLog accordingly!"
157