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