1# Makefile.am - for gcrypt/src
2# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
3#               2006, 2007  Free Software Foundation, Inc.
4#
5# This file is part of Libgcrypt.
6#
7# Libgcrypt is free software; you can redistribute it and/or modify
8# it under the terms of the GNU Lesser General Public License as
9# published by the Free Software Foundation; either version 2.1 of
10# the License, or (at your option) any later version.
11#
12# Libgcrypt is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU Lesser General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, see <http://www.gnu.org/licenses/>.
19
20
21## Process this file with automake to produce Makefile.in
22
23EXTRA_DIST = Manifest libgcrypt-config.in libgcrypt.m4 libgcrypt.vers \
24             gcrypt.h.in libgcrypt.def
25
26bin_SCRIPTS = libgcrypt-config
27m4datadir = $(datadir)/aclocal
28m4data_DATA = libgcrypt.m4
29include_HEADERS = gcrypt.h gcrypt-module.h
30
31lib_LTLIBRARIES = libgcrypt.la
32bin_PROGRAMS = dumpsexp hmac256
33if USE_RANDOM_DAEMON
34sbin_PROGRAMS = gcryptrnd
35bin_PROGRAMS += getrandom
36endif USE_RANDOM_DAEMON
37
38# Depending on the architecture some targets require libgpg-error.
39if HAVE_W32CE_SYSTEM
40arch_gpg_error_cflags = $(GPG_ERROR_CFLAGS)
41arch_gpg_error_libs   = $(GPG_ERROR_LIBS)
42else
43arch_gpg_error_cflags =
44arch_gpg_error_libs   =
45endif
46
47
48if HAVE_LD_VERSION_SCRIPT
49  libgcrypt_version_script_cmd = -Wl,--version-script=$(srcdir)/libgcrypt.vers
50else
51  libgcrypt_version_script_cmd =
52endif
53
54libgcrypt_la_CFLAGS = $(GPG_ERROR_CFLAGS)
55libgcrypt_la_SOURCES = g10lib.h visibility.c visibility.h types.h \
56	cipher.h cipher-proto.h \
57	misc.c global.c sexp.c hwfeatures.c \
58	stdmem.c stdmem.h secmem.c secmem.h \
59	mpi.h missing-string.c module.c fips.c \
60	hmac256.c hmac256.h \
61	ath.h ath.c
62
63if HAVE_W32_SYSTEM
64
65RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
66	$(libgcrypt_la_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS)
67LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
68
69SUFFIXES = .rc .lo
70
71.rc.lo:
72	$(LTRCCOMPILE) -i "$<" -o "$@"
73
74gcrypt_res = versioninfo.lo
75no_undefined = -no-undefined
76export_symbols = -export-symbols $(srcdir)/libgcrypt.def
77
78install-def-file:
79	$(INSTALL) $(srcdir)/libgcrypt.def $(DESTDIR)$(libdir)/libgcrypt.def
80
81uninstall-def-file:
82	-rm $(DESTDIR)$(libdir)/libgcrypt.def
83
84gcrypt_deps = $(gcrypt_res) libgcrypt.def
85
86else !HAVE_W32_SYSTEM
87
88gcrypt_res =
89gcrypt_res_ldflag =
90no_undefined =
91export_symbols =
92install-def-file:
93uninstall-def-file:
94
95gcrypt_deps =
96
97endif !HAVE_W32_SYSTEM
98
99
100libgcrypt_la_LDFLAGS = $(no_undefined) $(export_symbols) \
101	$(libgcrypt_version_script_cmd) -version-info \
102	@LIBGCRYPT_LT_CURRENT@:@LIBGCRYPT_LT_REVISION@:@LIBGCRYPT_LT_AGE@
103libgcrypt_la_DEPENDENCIES = \
104	../cipher/libcipher.la \
105	../random/librandom.la \
106	../mpi/libmpi.la \
107	../compat/libcompat.la \
108	$(srcdir)/libgcrypt.vers $(gcrypt_deps)
109libgcrypt_la_LIBADD = $(gcrypt_res) \
110	../cipher/libcipher.la \
111	../random/librandom.la \
112	../mpi/libmpi.la \
113	../compat/libcompat.la  $(GPG_ERROR_LIBS)
114
115
116dumpsexp_SOURCES = dumpsexp.c
117dumpsexp_CFLAGS = $(arch_gpg_error_cflags)
118dumpsexp_LDADD = $(arch_gpg_error_libs)
119
120hmac256_SOURCES = hmac256.c
121hmac256_CFLAGS = -DSTANDALONE $(arch_gpg_error_cflags)
122hmac256_LDADD = $(arch_gpg_error_libs)
123
124if USE_RANDOM_DAEMON
125gcryptrnd_SOURCES = gcryptrnd.c
126gcryptrnd_CFLAGS = $(GPG_ERROR_CFLAGS) $(PTH_CFLAGS)
127gcryptrnd_LDADD = libgcrypt.la $(GPG_ERROR_LIBS) $(PTH_LIBS)
128
129getrandom_SOURCES = getrandom.c
130endif USE_RANDOM_DAEMON
131
132
133install-data-local: install-def-file
134
135uninstall-local: uninstall-def-file
136
137# FIXME: We need to figure out how to get the actual name (parsing
138# libgcrypt.la?) and how to create the hmac file already at link time
139# so that it can be used without installing libgcrypt first.
140#install-exec-hook:
141#	./hmac256 "What am I, a doctor or a moonshuttle conductor?" \
142#          < $(DESTDIR)$(libdir)/libgcrypt.so.11.5.0 \
143#          > $(DESTDIR)$(libdir)/.libgcrypt.so.11.5.0.hmac
144