summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: 5e003bf05be90146245c9eb5cbcffe046772addc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Makefile.am - for gcrypt/src
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
#               2006, 2007  Free Software Foundation, Inc.
#
# This file is part of Libgcrypt.
#
# Libgcrypt is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# Libgcrypt is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.


## Process this file with automake to produce Makefile.in

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libgcrypt.pc

EXTRA_DIST = libgcrypt-config.in libgcrypt.m4 libgcrypt.vers \
             gcrypt.h.in libgcrypt.def libgcrypt.pc.in gen-note-integrity.sh

if USE_GPGRT_CONFIG
noinst_SCRIPTS = libgcrypt-config
else
bin_SCRIPTS = libgcrypt-config
endif
m4datadir = $(datadir)/aclocal
m4data_DATA = libgcrypt.m4
nodist_include_HEADERS = gcrypt.h

lib_LTLIBRARIES = libgcrypt.la
bin_PROGRAMS = dumpsexp hmac256 mpicalc

# Depending on the architecture some targets require libgpg-error.
if HAVE_W32CE_SYSTEM
arch_gpg_error_cflags = $(GPG_ERROR_CFLAGS)
arch_gpg_error_libs   = $(GPG_ERROR_LIBS)
else
arch_gpg_error_cflags =
arch_gpg_error_libs   =
endif

AM_CFLAGS = $(GPG_ERROR_CFLAGS)
AM_CCASFLAGS = $(NOEXECSTACK_FLAGS)

if HAVE_LD_VERSION_SCRIPT
  libgcrypt_version_script_cmd = -Wl,--version-script=$(srcdir)/libgcrypt.vers
else
  libgcrypt_version_script_cmd =
endif

libgcrypt_la_CFLAGS = $(GPG_ERROR_CFLAGS) @DEF_HMAC_BINARY_CHECK@
libgcrypt_la_SOURCES = \
        gcrypt-int.h g10lib.h visibility.c visibility.h types.h \
	gcrypt-testapi.h cipher.h cipher-proto.h \
	misc.c global.c sexp.c hwfeatures.c hwf-common.h \
	stdmem.c stdmem.h secmem.c secmem.h \
	mpi.h missing-string.c fips.c \
	context.c context.h \
	ec-context.h

EXTRA_libgcrypt_la_SOURCES = hwf-x86.c hwf-arm.c hwf-ppc.c hwf-s390x.c
gcrypt_hwf_modules = @GCRYPT_HWF_MODULES@


if HAVE_W32_SYSTEM

RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
	$(libgcrypt_la_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS)
LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)

SUFFIXES = .rc .lo

.rc.lo:
	$(LTRCCOMPILE) -i "$<" -o "$@"

gcrypt_res = versioninfo.lo
no_undefined = -no-undefined
export_symbols = -export-symbols $(srcdir)/libgcrypt.def
extra_ltoptions = -XCClinker -static-libgcc

install-def-file:
	-$(INSTALL) -d $(DESTDIR)$(libdir)
	$(INSTALL) $(srcdir)/libgcrypt.def $(DESTDIR)$(libdir)/libgcrypt.def

uninstall-def-file:
	-rm $(DESTDIR)$(libdir)/libgcrypt.def

gcrypt_deps = $(gcrypt_res) libgcrypt.def

else !HAVE_W32_SYSTEM

gcrypt_res =
gcrypt_res_ldflag =
no_undefined =
export_symbols =
extra_ltoptions =
install-def-file:
uninstall-def-file:

gcrypt_deps =

endif !HAVE_W32_SYSTEM


libgcrypt_la_LDFLAGS = $(no_undefined) $(export_symbols) $(extra_ltoptions) \
	$(libgcrypt_version_script_cmd) -version-info \
	@LIBGCRYPT_LT_CURRENT@:@LIBGCRYPT_LT_REVISION@:@LIBGCRYPT_LT_AGE@
libgcrypt_la_DEPENDENCIES = \
         $(gcrypt_hwf_modules) \
	../cipher/libcipher.la \
	../random/librandom.la \
	../mpi/libmpi.la \
	../compat/libcompat.la \
	$(srcdir)/libgcrypt.vers $(gcrypt_deps)
libgcrypt_la_LIBADD = $(gcrypt_res) \
        $(gcrypt_hwf_modules) \
	../cipher/libcipher.la \
	../random/librandom.la \
	../mpi/libmpi.la \
	../compat/libcompat.la $(DL_LIBS) $(GPG_ERROR_LIBS)


dumpsexp_SOURCES = dumpsexp.c
dumpsexp_CFLAGS = $(arch_gpg_error_cflags)
dumpsexp_LDADD = $(arch_gpg_error_libs)

mpicalc_SOURCES = mpicalc.c
mpicalc_CFLAGS = $(GPG_ERROR_CFLAGS)
mpicalc_LDADD = libgcrypt.la $(GPG_ERROR_LIBS)
EXTRA_mpicalc_DEPENDENCIES = libgcrypt.la.done

hmac256_SOURCES = hmac256.c hmac256.h
hmac256_CFLAGS = -DSTANDALONE @DEF_HMAC_BINARY_CHECK@ \
	$(arch_gpg_error_cflags)
hmac256_LDADD = $(arch_gpg_error_libs)

CLEANFILES = libgcrypt.la.done
if USE_HMAC_BINARY_CHECK
CLEANFILES += libgcrypt.so.hmac

libgcrypt.la.done: libgcrypt.so.hmac
	$(OBJCOPY) --add-section .note.fdo.integrity=libgcrypt.so.hmac \
	  --set-section-flags .note.fdo.integrity=noload,readonly \
	  .libs/libgcrypt.so .libs/libgcrypt.so.new
	mv -f .libs/libgcrypt.so.new .libs/libgcrypt.so.*.*
	@touch libgcrypt.la.done

libgcrypt.so.hmac: hmac256 libgcrypt.la
	ECHO_N=$(ECHO_N) READELF=$(READELF) AWK=$(AWK) \
	$(srcdir)/gen-note-integrity.sh > $@
else !USE_HMAC_BINARY_CHECK
libgcrypt.la.done: libgcrypt.la
	@touch libgcrypt.la.done
endif !USE_HMAC_BINARY_CHECK

install-data-local: install-def-file

uninstall-local: uninstall-def-file