1ACLOCAL_AMFLAGS = -I build-aux/m4
2
3lib_LTLIBRARIES = libsecp256k1.la
4include_HEADERS = include/secp256k1.h
5include_HEADERS += include/secp256k1_preallocated.h
6noinst_HEADERS =
7noinst_HEADERS += src/scalar.h
8noinst_HEADERS += src/scalar_4x64.h
9noinst_HEADERS += src/scalar_8x32.h
10noinst_HEADERS += src/scalar_low.h
11noinst_HEADERS += src/scalar_impl.h
12noinst_HEADERS += src/scalar_4x64_impl.h
13noinst_HEADERS += src/scalar_8x32_impl.h
14noinst_HEADERS += src/scalar_low_impl.h
15noinst_HEADERS += src/group.h
16noinst_HEADERS += src/group_impl.h
17noinst_HEADERS += src/ecdsa.h
18noinst_HEADERS += src/ecdsa_impl.h
19noinst_HEADERS += src/eckey.h
20noinst_HEADERS += src/eckey_impl.h
21noinst_HEADERS += src/ecmult.h
22noinst_HEADERS += src/ecmult_impl.h
23noinst_HEADERS += src/ecmult_const.h
24noinst_HEADERS += src/ecmult_const_impl.h
25noinst_HEADERS += src/ecmult_gen.h
26noinst_HEADERS += src/ecmult_gen_impl.h
27noinst_HEADERS += src/field_10x26.h
28noinst_HEADERS += src/field_10x26_impl.h
29noinst_HEADERS += src/field_5x52.h
30noinst_HEADERS += src/field_5x52_impl.h
31noinst_HEADERS += src/field_5x52_int128_impl.h
32noinst_HEADERS += src/field_5x52_asm_impl.h
33noinst_HEADERS += src/modinv32.h
34noinst_HEADERS += src/modinv32_impl.h
35noinst_HEADERS += src/modinv64.h
36noinst_HEADERS += src/modinv64_impl.h
37noinst_HEADERS += src/assumptions.h
38noinst_HEADERS += src/util.h
39noinst_HEADERS += src/scratch.h
40noinst_HEADERS += src/scratch_impl.h
41noinst_HEADERS += src/selftest.h
42noinst_HEADERS += src/testrand.h
43noinst_HEADERS += src/testrand_impl.h
44noinst_HEADERS += src/hash.h
45noinst_HEADERS += src/hash_impl.h
46noinst_HEADERS += src/field.h
47noinst_HEADERS += src/field_impl.h
48noinst_HEADERS += src/bench.h
49noinst_HEADERS += contrib/lax_der_parsing.h
50noinst_HEADERS += contrib/lax_der_parsing.c
51noinst_HEADERS += contrib/lax_der_privatekey_parsing.h
52noinst_HEADERS += contrib/lax_der_privatekey_parsing.c
53
54if USE_EXTERNAL_ASM
55COMMON_LIB = libsecp256k1_common.la
56noinst_LTLIBRARIES = $(COMMON_LIB)
57else
58COMMON_LIB =
59endif
60
61pkgconfigdir = $(libdir)/pkgconfig
62pkgconfig_DATA = libsecp256k1.pc
63
64if USE_EXTERNAL_ASM
65if USE_ASM_ARM
66libsecp256k1_common_la_SOURCES = src/asm/field_10x26_arm.s
67endif
68endif
69
70libsecp256k1_la_SOURCES = src/secp256k1.c
71libsecp256k1_la_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
72libsecp256k1_la_LIBADD = $(SECP_LIBS) $(COMMON_LIB)
73
74if VALGRIND_ENABLED
75libsecp256k1_la_CPPFLAGS += -DVALGRIND
76endif
77
78noinst_PROGRAMS =
79if USE_BENCHMARK
80noinst_PROGRAMS += bench_verify bench_sign bench_internal bench_ecmult
81bench_verify_SOURCES = src/bench_verify.c
82bench_verify_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
83# SECP_TEST_INCLUDES are only used here for CRYPTO_CPPFLAGS
84bench_verify_CPPFLAGS = -DSECP256K1_BUILD $(SECP_TEST_INCLUDES)
85bench_sign_SOURCES = src/bench_sign.c
86bench_sign_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
87bench_internal_SOURCES = src/bench_internal.c
88bench_internal_LDADD = $(SECP_LIBS) $(COMMON_LIB)
89bench_internal_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES)
90bench_ecmult_SOURCES = src/bench_ecmult.c
91bench_ecmult_LDADD = $(SECP_LIBS) $(COMMON_LIB)
92bench_ecmult_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES)
93endif
94
95TESTS =
96if USE_TESTS
97noinst_PROGRAMS += tests
98tests_SOURCES = src/tests.c
99tests_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/src -I$(top_srcdir)/include $(SECP_INCLUDES) $(SECP_TEST_INCLUDES)
100if VALGRIND_ENABLED
101tests_CPPFLAGS += -DVALGRIND
102noinst_PROGRAMS += valgrind_ctime_test
103valgrind_ctime_test_SOURCES = src/valgrind_ctime_test.c
104valgrind_ctime_test_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_LIBS) $(COMMON_LIB)
105endif
106if !ENABLE_COVERAGE
107tests_CPPFLAGS += -DVERIFY
108endif
109tests_LDADD = $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
110tests_LDFLAGS = -static
111TESTS += tests
112endif
113
114if USE_EXHAUSTIVE_TESTS
115noinst_PROGRAMS += exhaustive_tests
116exhaustive_tests_SOURCES = src/tests_exhaustive.c
117exhaustive_tests_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/src $(SECP_INCLUDES)
118if !ENABLE_COVERAGE
119exhaustive_tests_CPPFLAGS += -DVERIFY
120endif
121exhaustive_tests_LDADD = $(SECP_LIBS) $(COMMON_LIB)
122exhaustive_tests_LDFLAGS = -static
123TESTS += exhaustive_tests
124endif
125
126if USE_ECMULT_STATIC_PRECOMPUTATION
127CPPFLAGS_FOR_BUILD +=-I$(top_srcdir) -I$(builddir)/src
128
129gen_context_OBJECTS = gen_context.o
130gen_context_BIN = gen_context$(BUILD_EXEEXT)
131gen_%.o: src/gen_%.c src/libsecp256k1-config.h
132	$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c $< -o $@
133
134$(gen_context_BIN): $(gen_context_OBJECTS)
135	$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $^ -o $@
136
137$(libsecp256k1_la_OBJECTS): src/ecmult_static_context.h
138$(tests_OBJECTS): src/ecmult_static_context.h
139$(bench_internal_OBJECTS): src/ecmult_static_context.h
140$(bench_ecmult_OBJECTS): src/ecmult_static_context.h
141
142src/ecmult_static_context.h: $(gen_context_BIN)
143	./$(gen_context_BIN)
144
145CLEANFILES = $(gen_context_BIN) src/ecmult_static_context.h
146endif
147
148EXTRA_DIST = autogen.sh src/gen_context.c src/basic-config.h
149
150if ENABLE_MODULE_ECDH
151include src/modules/ecdh/Makefile.am.include
152endif
153
154if ENABLE_MODULE_RECOVERY
155include src/modules/recovery/Makefile.am.include
156endif
157
158if ENABLE_MODULE_EXTRAKEYS
159include src/modules/extrakeys/Makefile.am.include
160endif
161
162if ENABLE_MODULE_SCHNORRSIG
163include src/modules/schnorrsig/Makefile.am.include
164endif
165