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