-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile.am
162 lines (137 loc) · 4.34 KB
/
Makefile.am
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
AUTOMAKE_OPTIONS = foreign 1.9 subdir-objects
ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = -I$(top_srcdir)/include
AM_CFLAGS += -Wall -Wshadow
if COVERAGE_ENABLED
TEST_CFLAGS=-fno-inline -fprofile-arcs -ftest-coverage
TEST_LFLAGS=-lgcov -coverage
else
TEST_CFLAGS=
TEST_LFLAGS=
endif
noinst_PROGRAMS = \
bin/sanity \
bin/bench \
bin/sample_NTRUEncrypt
# Set conditionally below
TESTS =
check_PROGRAMS =
check_LTLIBRARIES =
noinst_LTLIBRARIES = libntrutests.la
lib_LTLIBRARIES = libntruencrypt.la
pkginclude_HEADERS = \
include/ntru_crypto_error.h \
include/ntru_crypto_platform.h \
include/ntru_crypto_drbg.h \
include/ntru_crypto.h
noinst_HEADERS = \
src/ntru_crypto_hash_basics.h \
src/ntru_crypto_hash.h \
src/ntru_crypto_hmac.h \
src/ntru_crypto_msbyte_uint32.h \
src/ntru_crypto_ntru_convert.h \
src/ntru_crypto_ntru_encrypt_key.h \
src/ntru_crypto_ntru_encrypt_param_sets.h \
src/ntru_crypto_ntru_mgf1.h \
src/ntru_crypto_ntru_poly.h \
src/ntru_crypto_sha1.h \
src/ntru_crypto_sha256.h \
src/ntru_crypto_sha2.h \
src/ntru_crypto_sha.h \
test/test_common.h \
test/check_common.h
EXTRA_DIST = \
autogen.sh \
libntruencrypt.sym \
src/ntru_crypto_ntru_mult_indices_32.c \
src/ntru_crypto_ntru_mult_indices_64.c\
doc \
driver_test \
vs2012
# libntruencrypt.la
libntruencrypt_la_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS) -Wno-parentheses
libntruencrypt_la_LDFLAGS = \
$(TEST_LFLAGS) \
-version-info $(LIBNTRUENCRYPT_SO_VERSION) \
-export-symbols $(top_srcdir)/libntruencrypt.sym
libntruencrypt_la_SOURCES = \
src/ntru_crypto_drbg.c \
src/ntru_crypto_hash.c \
src/ntru_crypto_hmac.c \
src/ntru_crypto_msbyte_uint32.c \
src/ntru_crypto_ntru_convert.c \
src/ntru_crypto_ntru_encrypt.c \
src/ntru_crypto_ntru_encrypt_key.c \
src/ntru_crypto_ntru_encrypt_param_sets.c \
src/ntru_crypto_ntru_mgf1.c \
src/ntru_crypto_ntru_poly.c \
src/ntru_crypto_sha256.c \
src/ntru_crypto_sha1.c \
src/ntru_crypto_sha2.c
if SIMD_ENABLED
libntruencrypt_la_SOURCES += \
src/ntru_crypto_ntru_mult_indices_simd.c \
src/ntru_crypto_ntru_mult_coeffs_simd.c
libntruencrypt_la_CFLAGS += $(SIMD_FLAGS)
else
libntruencrypt_la_SOURCES += \
src/ntru_crypto_ntru_mult_indices.c \
src/ntru_crypto_ntru_mult_coeffs_karat.c
endif
# Test helper library
libntrutests_la_SOURCES = test/test_common.c
# If we have the CHECK package then link an extra copy of the library
# with all internal functions exposed and build unit tests.
if HAVE_CHECK
libntrutests_la_SOURCES += test/check_common.c
check_PROGRAMS += bin/check_public bin/check_internal
check_LTLIBRARIES += libntruencrypt_check.la
libntruencrypt_check_la_CFLAGS = $(libntruencrypt_la_CFLAGS)
libntruencrypt_check_la_LDFLAGS = $(TEST_LFLAGS)
libntruencrypt_check_la_SOURCES = $(libntruencrypt_la_SOURCES)
else
# If we don't have CHECK fall back to the basic sanity test
check_PROGRAMS += bin/sanity
endif
TESTS += $(check_PROGRAMS)
# Crude benchmarking program
bin_bench_SOURCES = test/bench.c
bin_bench_LDADD = \
$(top_builddir)/libntruencrypt.la \
$(top_builddir)/libntrutests.la
# Sample program
bin_sample_NTRUEncrypt_SOURCES = sample/sample_NTRUEncrypt.c
bin_sample_NTRUEncrypt_LDADD = libntruencrypt.la
# Sanity test for when CHECK package is not available
bin_sanity_SOURCES = test/sanity.c
bin_sanity_LDADD = \
$(top_builddir)/libntruencrypt.la \
$(top_builddir)/libntrutests.la
# Tests using only the public API
bin_check_public_SOURCES = test/check_public.c
bin_check_public_CFLAGS = $(AM_CFLAGS) @CHECK_CFLAGS@
bin_check_public_LDADD = \
$(top_builddir)/libntruencrypt.la \
$(top_builddir)/libntrutests.la \
@CHECK_LIBS@
# Tests requiring access to internals
bin_check_internal_SOURCES = test/check_internal.c \
test/check_internal_key.c \
test/check_internal_poly.c \
test/check_internal_sha.c \
test/check_internal_mgf.c
bin_check_internal_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/src @CHECK_CFLAGS@
bin_check_internal_LDADD = \
$(top_builddir)/libntruencrypt_check.la \
$(top_builddir)/libntrutests.la \
@CHECK_LIBS@
COVER_DIR=./coverage
coverage-html:
test -d "$(COVER_DIR)" || mkdir -p "$(COVER_DIR)"
lcov --rc lcov_branch_coverage=1 --directory ./src --zerocounters
$(MAKE) check
lcov --capture --rc lcov_branch_coverage=1 --no-external --directory . --output-file "$(COVER_DIR)/lcov.info"
genhtml --branch-coverage -o "coverage" "$(COVER_DIR)/lcov.info"
mostlyclean-local:
rm -f src/*.gc{da,no}
test ! -d coverage || rm -rf coverage