]>
Commit | Line | Data |
---|---|---|
6fac238f | 1 | ACLOCAL_AMFLAGS = -I build-aux/m4 |
f9aac5b0 | 2 | |
78cd96b1 | 3 | lib_LTLIBRARIES = libsecp256k1.la |
3093576a G |
4 | if USE_JNI |
5 | JNI_LIB = libsecp256k1_jni.la | |
6 | noinst_LTLIBRARIES = $(JNI_LIB) | |
7 | else | |
8 | JNI_LIB = | |
9 | endif | |
78cd96b1 | 10 | include_HEADERS = include/secp256k1.h |
238305fd | 11 | include_HEADERS += include/secp256k1_preallocated.h |
78cd96b1 | 12 | noinst_HEADERS = |
a9f5c8b8 | 13 | noinst_HEADERS += src/scalar.h |
1d52a8b1 PW |
14 | noinst_HEADERS += src/scalar_4x64.h |
15 | noinst_HEADERS += src/scalar_8x32.h | |
83836a95 | 16 | noinst_HEADERS += src/scalar_low.h |
a9f5c8b8 | 17 | noinst_HEADERS += src/scalar_impl.h |
1d52a8b1 PW |
18 | noinst_HEADERS += src/scalar_4x64_impl.h |
19 | noinst_HEADERS += src/scalar_8x32_impl.h | |
83836a95 | 20 | noinst_HEADERS += src/scalar_low_impl.h |
78cd96b1 | 21 | noinst_HEADERS += src/group.h |
11ab5622 | 22 | noinst_HEADERS += src/group_impl.h |
78cd96b1 | 23 | noinst_HEADERS += src/num_gmp.h |
11ab5622 | 24 | noinst_HEADERS += src/num_gmp_impl.h |
78cd96b1 | 25 | noinst_HEADERS += src/ecdsa.h |
11ab5622 | 26 | noinst_HEADERS += src/ecdsa_impl.h |
e2f71f1e PW |
27 | noinst_HEADERS += src/eckey.h |
28 | noinst_HEADERS += src/eckey_impl.h | |
78cd96b1 | 29 | noinst_HEADERS += src/ecmult.h |
11ab5622 | 30 | noinst_HEADERS += src/ecmult_impl.h |
44015000 AP |
31 | noinst_HEADERS += src/ecmult_const.h |
32 | noinst_HEADERS += src/ecmult_const_impl.h | |
949c1ebb PW |
33 | noinst_HEADERS += src/ecmult_gen.h |
34 | noinst_HEADERS += src/ecmult_gen_impl.h | |
78cd96b1 | 35 | noinst_HEADERS += src/num.h |
11ab5622 | 36 | noinst_HEADERS += src/num_impl.h |
78cd96b1 | 37 | noinst_HEADERS += src/field_10x26.h |
11ab5622 | 38 | noinst_HEADERS += src/field_10x26_impl.h |
78cd96b1 | 39 | noinst_HEADERS += src/field_5x52.h |
11ab5622 PW |
40 | noinst_HEADERS += src/field_5x52_impl.h |
41 | noinst_HEADERS += src/field_5x52_int128_impl.h | |
42 | noinst_HEADERS += src/field_5x52_asm_impl.h | |
78cd96b1 | 43 | noinst_HEADERS += src/java/org_bitcoin_NativeSecp256k1.h |
3093576a | 44 | noinst_HEADERS += src/java/org_bitcoin_Secp256k1Context.h |
78cd96b1 | 45 | noinst_HEADERS += src/util.h |
548de42e AP |
46 | noinst_HEADERS += src/scratch.h |
47 | noinst_HEADERS += src/scratch_impl.h | |
861f9a59 GM |
48 | noinst_HEADERS += src/testrand.h |
49 | noinst_HEADERS += src/testrand_impl.h | |
bbd5ba7c PW |
50 | noinst_HEADERS += src/hash.h |
51 | noinst_HEADERS += src/hash_impl.h | |
78cd96b1 | 52 | noinst_HEADERS += src/field.h |
11ab5622 | 53 | noinst_HEADERS += src/field_impl.h |
6558a267 | 54 | noinst_HEADERS += src/bench.h |
fea19e7b | 55 | noinst_HEADERS += contrib/lax_der_parsing.h |
eed87af1 | 56 | noinst_HEADERS += contrib/lax_der_parsing.c |
4a243da4 | 57 | noinst_HEADERS += contrib/lax_der_privatekey_parsing.h |
eed87af1 | 58 | noinst_HEADERS += contrib/lax_der_privatekey_parsing.c |
78cd96b1 | 59 | |
001f1763 WL |
60 | if USE_EXTERNAL_ASM |
61 | COMMON_LIB = libsecp256k1_common.la | |
62 | noinst_LTLIBRARIES = $(COMMON_LIB) | |
63 | else | |
64 | COMMON_LIB = | |
65 | endif | |
66 | ||
81b2faeb | 67 | pkgconfigdir = $(libdir)/pkgconfig |
c7ee71f7 AT |
68 | pkgconfig_DATA = libsecp256k1.pc |
69 | ||
001f1763 WL |
70 | if USE_EXTERNAL_ASM |
71 | if USE_ASM_ARM | |
72 | libsecp256k1_common_la_SOURCES = src/asm/field_10x26_arm.s | |
73 | endif | |
74 | endif | |
75 | ||
8881212e | 76 | libsecp256k1_la_SOURCES = src/secp256k1.c |
3093576a | 77 | libsecp256k1_la_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES) |
001f1763 | 78 | libsecp256k1_la_LIBADD = $(JNI_LIB) $(SECP_LIBS) $(COMMON_LIB) |
e2d66a2c | 79 | |
3093576a G |
80 | libsecp256k1_jni_la_SOURCES = src/java/org_bitcoin_NativeSecp256k1.c src/java/org_bitcoin_Secp256k1Context.c |
81 | libsecp256k1_jni_la_CPPFLAGS = -DSECP256K1_BUILD $(JNI_INCLUDES) | |
8881212e | 82 | |
78cd96b1 CF |
83 | noinst_PROGRAMS = |
84 | if USE_BENCHMARK | |
bc65aa79 | 85 | noinst_PROGRAMS += bench_verify bench_sign bench_internal bench_ecmult |
504c63d7 | 86 | bench_verify_SOURCES = src/bench_verify.c |
001f1763 | 87 | bench_verify_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB) |
fa5c13ff | 88 | bench_sign_SOURCES = src/bench_sign.c |
001f1763 | 89 | bench_sign_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB) |
039723d5 | 90 | bench_internal_SOURCES = src/bench_internal.c |
001f1763 | 91 | bench_internal_LDADD = $(SECP_LIBS) $(COMMON_LIB) |
ac01378c | 92 | bench_internal_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES) |
bc65aa79 PW |
93 | bench_ecmult_SOURCES = src/bench_ecmult.c |
94 | bench_ecmult_LDADD = $(SECP_LIBS) $(COMMON_LIB) | |
95 | bench_ecmult_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES) | |
78cd96b1 CF |
96 | endif |
97 | ||
20b8877b | 98 | TESTS = |
78cd96b1 CF |
99 | if USE_TESTS |
100 | noinst_PROGRAMS += tests | |
101 | tests_SOURCES = src/tests.c | |
a724d729 AP |
102 | tests_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/src -I$(top_srcdir)/include $(SECP_INCLUDES) $(SECP_TEST_INCLUDES) |
103 | if !ENABLE_COVERAGE | |
104 | tests_CPPFLAGS += -DVERIFY | |
105 | endif | |
001f1763 | 106 | tests_LDADD = $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB) |
78cd96b1 | 107 | tests_LDFLAGS = -static |
20b8877b AP |
108 | TESTS += tests |
109 | endif | |
110 | ||
111 | if USE_EXHAUSTIVE_TESTS | |
112 | noinst_PROGRAMS += exhaustive_tests | |
113 | exhaustive_tests_SOURCES = src/tests_exhaustive.c | |
a724d729 AP |
114 | exhaustive_tests_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/src $(SECP_INCLUDES) |
115 | if !ENABLE_COVERAGE | |
116 | exhaustive_tests_CPPFLAGS += -DVERIFY | |
117 | endif | |
83483869 | 118 | exhaustive_tests_LDADD = $(SECP_LIBS) $(COMMON_LIB) |
20b8877b AP |
119 | exhaustive_tests_LDFLAGS = -static |
120 | TESTS += exhaustive_tests | |
78cd96b1 CF |
121 | endif |
122 | ||
3093576a G |
123 | JAVAROOT=src/java |
124 | JAVAORG=org/bitcoin | |
125 | JAVA_GUAVA=$(srcdir)/$(JAVAROOT)/guava/guava-18.0.jar | |
126 | CLASSPATH_ENV=CLASSPATH=$(JAVA_GUAVA) | |
127 | JAVA_FILES= \ | |
128 | $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1.java \ | |
129 | $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1Test.java \ | |
130 | $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1Util.java \ | |
131 | $(JAVAROOT)/$(JAVAORG)/Secp256k1Context.java | |
132 | ||
133 | if USE_JNI | |
134 | ||
135 | $(JAVA_GUAVA): | |
136 | @echo Guava is missing. Fetch it via: \ | |
137 | wget https://search.maven.org/remotecontent?filepath=com/google/guava/guava/18.0/guava-18.0.jar -O $(@) | |
138 | @false | |
139 | ||
140 | .stamp-java: $(JAVA_FILES) | |
141 | @echo Compiling $^ | |
142 | $(AM_V_at)$(CLASSPATH_ENV) javac $^ | |
143 | @touch $@ | |
144 | ||
145 | if USE_TESTS | |
146 | ||
147 | check-java: libsecp256k1.la $(JAVA_GUAVA) .stamp-java | |
148 | $(AM_V_at)java -Djava.library.path="./:./src:./src/.libs:.libs/" -cp "$(JAVA_GUAVA):$(JAVAROOT)" $(JAVAORG)/NativeSecp256k1Test | |
149 | ||
150 | endif | |
151 | endif | |
152 | ||
fbecc38a | 153 | if USE_ECMULT_STATIC_PRECOMPUTATION |
dcb2e3b3 | 154 | CPPFLAGS_FOR_BUILD +=-I$(top_srcdir) -I$(builddir)/src |
fbecc38a TD |
155 | |
156 | gen_context_OBJECTS = gen_context.o | |
e4ce3936 | 157 | gen_context_BIN = gen_context$(BUILD_EXEEXT) |
dcb2e3b3 | 158 | gen_%.o: src/gen_%.c src/libsecp256k1-config.h |
fbecc38a TD |
159 | $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c $< -o $@ |
160 | ||
e4ce3936 | 161 | $(gen_context_BIN): $(gen_context_OBJECTS) |
a34bcaad | 162 | $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $^ -o $@ |
fbecc38a | 163 | |
b8e39ac5 CF |
164 | $(libsecp256k1_la_OBJECTS): src/ecmult_static_context.h |
165 | $(tests_OBJECTS): src/ecmult_static_context.h | |
6da1446d | 166 | $(bench_internal_OBJECTS): src/ecmult_static_context.h |
bc65aa79 | 167 | $(bench_ecmult_OBJECTS): src/ecmult_static_context.h |
fbecc38a | 168 | |
e4ce3936 CF |
169 | src/ecmult_static_context.h: $(gen_context_BIN) |
170 | ./$(gen_context_BIN) | |
c37812f5 | 171 | |
3093576a | 172 | CLEANFILES = $(gen_context_BIN) src/ecmult_static_context.h $(JAVAROOT)/$(JAVAORG)/*.class .stamp-java |
fbecc38a TD |
173 | endif |
174 | ||
3093576a | 175 | EXTRA_DIST = autogen.sh src/gen_context.c src/basic-config.h $(JAVA_FILES) |
0739bbb6 AP |
176 | |
177 | if ENABLE_MODULE_ECDH | |
178 | include src/modules/ecdh/Makefile.am.include | |
179 | endif | |
a5a66c70 | 180 | |
9f443be0 PW |
181 | if ENABLE_MODULE_RECOVERY |
182 | include src/modules/recovery/Makefile.am.include | |
183 | endif |