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