You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile.am 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. ACLOCAL_AMFLAGS = -I build-aux/m4
  2. lib_LTLIBRARIES = libsecp256k1.la
  3. if USE_JNI
  4. JNI_LIB = libsecp256k1_jni.la
  5. noinst_LTLIBRARIES = $(JNI_LIB)
  6. else
  7. JNI_LIB =
  8. endif
  9. include_HEADERS = include/secp256k1.h
  10. noinst_HEADERS =
  11. noinst_HEADERS += src/scalar.h
  12. noinst_HEADERS += src/scalar_4x64.h
  13. noinst_HEADERS += src/scalar_8x32.h
  14. noinst_HEADERS += src/scalar_low.h
  15. noinst_HEADERS += src/scalar_impl.h
  16. noinst_HEADERS += src/scalar_4x64_impl.h
  17. noinst_HEADERS += src/scalar_8x32_impl.h
  18. noinst_HEADERS += src/scalar_low_impl.h
  19. noinst_HEADERS += src/group.h
  20. noinst_HEADERS += src/group_impl.h
  21. noinst_HEADERS += src/num_gmp.h
  22. noinst_HEADERS += src/num_gmp_impl.h
  23. noinst_HEADERS += src/ecdsa.h
  24. noinst_HEADERS += src/ecdsa_impl.h
  25. noinst_HEADERS += src/eckey.h
  26. noinst_HEADERS += src/eckey_impl.h
  27. noinst_HEADERS += src/ecmult.h
  28. noinst_HEADERS += src/ecmult_impl.h
  29. noinst_HEADERS += src/ecmult_const.h
  30. noinst_HEADERS += src/ecmult_const_impl.h
  31. noinst_HEADERS += src/ecmult_gen.h
  32. noinst_HEADERS += src/ecmult_gen_impl.h
  33. noinst_HEADERS += src/num.h
  34. noinst_HEADERS += src/num_impl.h
  35. noinst_HEADERS += src/field_10x26.h
  36. noinst_HEADERS += src/field_10x26_impl.h
  37. noinst_HEADERS += src/field_5x52.h
  38. noinst_HEADERS += src/field_5x52_impl.h
  39. noinst_HEADERS += src/field_5x52_int128_impl.h
  40. noinst_HEADERS += src/field_5x52_asm_impl.h
  41. noinst_HEADERS += src/java/org_bitcoin_NativeSecp256k1.h
  42. noinst_HEADERS += src/java/org_bitcoin_Secp256k1Context.h
  43. noinst_HEADERS += src/util.h
  44. noinst_HEADERS += src/scratch.h
  45. noinst_HEADERS += src/scratch_impl.h
  46. noinst_HEADERS += src/testrand.h
  47. noinst_HEADERS += src/testrand_impl.h
  48. noinst_HEADERS += src/hash.h
  49. noinst_HEADERS += src/hash_impl.h
  50. noinst_HEADERS += src/field.h
  51. noinst_HEADERS += src/field_impl.h
  52. noinst_HEADERS += src/bench.h
  53. noinst_HEADERS += contrib/lax_der_parsing.h
  54. noinst_HEADERS += contrib/lax_der_parsing.c
  55. noinst_HEADERS += contrib/lax_der_privatekey_parsing.h
  56. noinst_HEADERS += contrib/lax_der_privatekey_parsing.c
  57. if USE_EXTERNAL_ASM
  58. COMMON_LIB = libsecp256k1_common.la
  59. noinst_LTLIBRARIES = $(COMMON_LIB)
  60. else
  61. COMMON_LIB =
  62. endif
  63. pkgconfigdir = $(libdir)/pkgconfig
  64. pkgconfig_DATA = libsecp256k1.pc
  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. libsecp256k1_la_SOURCES = src/secp256k1.c
  71. libsecp256k1_la_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
  72. libsecp256k1_la_LIBADD = $(JNI_LIB) $(SECP_LIBS) $(COMMON_LIB)
  73. libsecp256k1_jni_la_SOURCES = src/java/org_bitcoin_NativeSecp256k1.c src/java/org_bitcoin_Secp256k1Context.c
  74. libsecp256k1_jni_la_CPPFLAGS = -DSECP256K1_BUILD $(JNI_INCLUDES)
  75. noinst_PROGRAMS =
  76. if USE_BENCHMARK
  77. noinst_PROGRAMS += bench_verify bench_sign bench_internal bench_ecmult
  78. bench_verify_SOURCES = src/bench_verify.c
  79. bench_verify_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
  80. bench_sign_SOURCES = src/bench_sign.c
  81. bench_sign_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
  82. bench_internal_SOURCES = src/bench_internal.c
  83. bench_internal_LDADD = $(SECP_LIBS) $(COMMON_LIB)
  84. bench_internal_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES)
  85. bench_ecmult_SOURCES = src/bench_ecmult.c
  86. bench_ecmult_LDADD = $(SECP_LIBS) $(COMMON_LIB)
  87. bench_ecmult_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES)
  88. endif
  89. TESTS =
  90. if USE_TESTS
  91. noinst_PROGRAMS += tests
  92. tests_SOURCES = src/tests.c
  93. tests_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/src -I$(top_srcdir)/include $(SECP_INCLUDES) $(SECP_TEST_INCLUDES)
  94. if !ENABLE_COVERAGE
  95. tests_CPPFLAGS += -DVERIFY
  96. endif
  97. tests_LDADD = $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
  98. tests_LDFLAGS = -static
  99. TESTS += tests
  100. endif
  101. if USE_EXHAUSTIVE_TESTS
  102. noinst_PROGRAMS += exhaustive_tests
  103. exhaustive_tests_SOURCES = src/tests_exhaustive.c
  104. exhaustive_tests_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/src $(SECP_INCLUDES)
  105. if !ENABLE_COVERAGE
  106. exhaustive_tests_CPPFLAGS += -DVERIFY
  107. endif
  108. exhaustive_tests_LDADD = $(SECP_LIBS)
  109. exhaustive_tests_LDFLAGS = -static
  110. TESTS += exhaustive_tests
  111. endif
  112. JAVAROOT=src/java
  113. JAVAORG=org/bitcoin
  114. JAVA_GUAVA=$(srcdir)/$(JAVAROOT)/guava/guava-18.0.jar
  115. CLASSPATH_ENV=CLASSPATH=$(JAVA_GUAVA)
  116. JAVA_FILES= \
  117. $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1.java \
  118. $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1Test.java \
  119. $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1Util.java \
  120. $(JAVAROOT)/$(JAVAORG)/Secp256k1Context.java
  121. if USE_JNI
  122. $(JAVA_GUAVA):
  123. @echo Guava is missing. Fetch it via: \
  124. wget https://search.maven.org/remotecontent?filepath=com/google/guava/guava/18.0/guava-18.0.jar -O $(@)
  125. @false
  126. .stamp-java: $(JAVA_FILES)
  127. @echo Compiling $^
  128. $(AM_V_at)$(CLASSPATH_ENV) javac $^
  129. @touch $@
  130. if USE_TESTS
  131. check-java: libsecp256k1.la $(JAVA_GUAVA) .stamp-java
  132. $(AM_V_at)java -Djava.library.path="./:./src:./src/.libs:.libs/" -cp "$(JAVA_GUAVA):$(JAVAROOT)" $(JAVAORG)/NativeSecp256k1Test
  133. endif
  134. endif
  135. if USE_ECMULT_STATIC_PRECOMPUTATION
  136. CPPFLAGS_FOR_BUILD +=-I$(top_srcdir)
  137. CFLAGS_FOR_BUILD += -Wall -Wextra -Wno-unused-function
  138. gen_context_OBJECTS = gen_context.o
  139. gen_context_BIN = gen_context$(BUILD_EXEEXT)
  140. gen_%.o: src/gen_%.c
  141. $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c $< -o $@
  142. $(gen_context_BIN): $(gen_context_OBJECTS)
  143. $(CC_FOR_BUILD) $^ -o $@
  144. $(libsecp256k1_la_OBJECTS): src/ecmult_static_context.h
  145. $(tests_OBJECTS): src/ecmult_static_context.h
  146. $(bench_internal_OBJECTS): src/ecmult_static_context.h
  147. $(bench_ecmult_OBJECTS): src/ecmult_static_context.h
  148. src/ecmult_static_context.h: $(gen_context_BIN)
  149. ./$(gen_context_BIN)
  150. CLEANFILES = $(gen_context_BIN) src/ecmult_static_context.h $(JAVAROOT)/$(JAVAORG)/*.class .stamp-java
  151. endif
  152. EXTRA_DIST = autogen.sh src/gen_context.c src/basic-config.h $(JAVA_FILES)
  153. if ENABLE_MODULE_ECDH
  154. include src/modules/ecdh/Makefile.am.include
  155. endif
  156. if ENABLE_MODULE_RECOVERY
  157. include src/modules/recovery/Makefile.am.include
  158. endif