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 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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_impl.h
  15. noinst_HEADERS += src/scalar_4x64_impl.h
  16. noinst_HEADERS += src/scalar_8x32_impl.h
  17. noinst_HEADERS += src/group.h
  18. noinst_HEADERS += src/group_impl.h
  19. noinst_HEADERS += src/num_gmp.h
  20. noinst_HEADERS += src/num_gmp_impl.h
  21. noinst_HEADERS += src/ecdsa.h
  22. noinst_HEADERS += src/ecdsa_impl.h
  23. noinst_HEADERS += src/eckey.h
  24. noinst_HEADERS += src/eckey_impl.h
  25. noinst_HEADERS += src/ecmult.h
  26. noinst_HEADERS += src/ecmult_impl.h
  27. noinst_HEADERS += src/ecmult_const.h
  28. noinst_HEADERS += src/ecmult_const_impl.h
  29. noinst_HEADERS += src/ecmult_gen.h
  30. noinst_HEADERS += src/ecmult_gen_impl.h
  31. noinst_HEADERS += src/num.h
  32. noinst_HEADERS += src/num_impl.h
  33. noinst_HEADERS += src/field_10x26.h
  34. noinst_HEADERS += src/field_10x26_impl.h
  35. noinst_HEADERS += src/field_5x52.h
  36. noinst_HEADERS += src/field_5x52_impl.h
  37. noinst_HEADERS += src/field_5x52_int128_impl.h
  38. noinst_HEADERS += src/field_5x52_asm_impl.h
  39. noinst_HEADERS += src/java/org_bitcoin_NativeSecp256k1.h
  40. noinst_HEADERS += src/java/org_bitcoin_Secp256k1Context.h
  41. noinst_HEADERS += src/util.h
  42. noinst_HEADERS += src/testrand.h
  43. noinst_HEADERS += src/testrand_impl.h
  44. noinst_HEADERS += src/hash.h
  45. noinst_HEADERS += src/hash_impl.h
  46. noinst_HEADERS += src/field.h
  47. noinst_HEADERS += src/field_impl.h
  48. noinst_HEADERS += src/bench.h
  49. noinst_HEADERS += contrib/lax_der_parsing.h
  50. noinst_HEADERS += contrib/lax_der_parsing.c
  51. noinst_HEADERS += contrib/lax_der_privatekey_parsing.h
  52. noinst_HEADERS += contrib/lax_der_privatekey_parsing.c
  53. if USE_EXTERNAL_ASM
  54. COMMON_LIB = libsecp256k1_common.la
  55. noinst_LTLIBRARIES = $(COMMON_LIB)
  56. else
  57. COMMON_LIB =
  58. endif
  59. pkgconfigdir = $(libdir)/pkgconfig
  60. pkgconfig_DATA = libsecp256k1.pc
  61. if USE_EXTERNAL_ASM
  62. if USE_ASM_ARM
  63. libsecp256k1_common_la_SOURCES = src/asm/field_10x26_arm.s
  64. endif
  65. endif
  66. libsecp256k1_la_SOURCES = src/secp256k1.c
  67. libsecp256k1_la_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
  68. libsecp256k1_la_LIBADD = $(JNI_LIB) $(SECP_LIBS) $(COMMON_LIB)
  69. libsecp256k1_jni_la_SOURCES = src/java/org_bitcoin_NativeSecp256k1.c src/java/org_bitcoin_Secp256k1Context.c
  70. libsecp256k1_jni_la_CPPFLAGS = -DSECP256K1_BUILD $(JNI_INCLUDES)
  71. noinst_PROGRAMS =
  72. if USE_BENCHMARK
  73. noinst_PROGRAMS += bench_verify bench_sign bench_internal
  74. bench_verify_SOURCES = src/bench_verify.c
  75. bench_verify_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
  76. bench_sign_SOURCES = src/bench_sign.c
  77. bench_sign_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
  78. bench_internal_SOURCES = src/bench_internal.c
  79. bench_internal_LDADD = $(SECP_LIBS) $(COMMON_LIB)
  80. bench_internal_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES)
  81. endif
  82. if USE_TESTS
  83. noinst_PROGRAMS += tests
  84. tests_SOURCES = src/tests.c
  85. tests_CPPFLAGS = -DSECP256K1_BUILD -DVERIFY -I$(top_srcdir)/src -I$(top_srcdir)/include $(SECP_INCLUDES) $(SECP_TEST_INCLUDES)
  86. tests_LDADD = $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
  87. tests_LDFLAGS = -static
  88. TESTS = tests
  89. endif
  90. JAVAROOT=src/java
  91. JAVAORG=org/bitcoin
  92. JAVA_GUAVA=$(srcdir)/$(JAVAROOT)/guava/guava-18.0.jar
  93. CLASSPATH_ENV=CLASSPATH=$(JAVA_GUAVA)
  94. JAVA_FILES= \
  95. $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1.java \
  96. $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1Test.java \
  97. $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1Util.java \
  98. $(JAVAROOT)/$(JAVAORG)/Secp256k1Context.java
  99. if USE_JNI
  100. $(JAVA_GUAVA):
  101. @echo Guava is missing. Fetch it via: \
  102. wget https://search.maven.org/remotecontent?filepath=com/google/guava/guava/18.0/guava-18.0.jar -O $(@)
  103. @false
  104. .stamp-java: $(JAVA_FILES)
  105. @echo Compiling $^
  106. $(AM_V_at)$(CLASSPATH_ENV) javac $^
  107. @touch $@
  108. if USE_TESTS
  109. check-java: libsecp256k1.la $(JAVA_GUAVA) .stamp-java
  110. $(AM_V_at)java -Djava.library.path="./:./src:./src/.libs:.libs/" -cp "$(JAVA_GUAVA):$(JAVAROOT)" $(JAVAORG)/NativeSecp256k1Test
  111. endif
  112. endif
  113. if USE_ECMULT_STATIC_PRECOMPUTATION
  114. CPPFLAGS_FOR_BUILD +=-I$(top_srcdir)
  115. CFLAGS_FOR_BUILD += -Wall -Wextra -Wno-unused-function
  116. gen_context_OBJECTS = gen_context.o
  117. gen_context_BIN = gen_context$(BUILD_EXEEXT)
  118. gen_%.o: src/gen_%.c
  119. $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c $< -o $@
  120. $(gen_context_BIN): $(gen_context_OBJECTS)
  121. $(CC_FOR_BUILD) $^ -o $@
  122. $(libsecp256k1_la_OBJECTS): src/ecmult_static_context.h
  123. $(tests_OBJECTS): src/ecmult_static_context.h
  124. $(bench_internal_OBJECTS): src/ecmult_static_context.h
  125. src/ecmult_static_context.h: $(gen_context_BIN)
  126. ./$(gen_context_BIN)
  127. CLEANFILES = $(gen_context_BIN) src/ecmult_static_context.h $(JAVAROOT)/$(JAVAORG)/*.class .stamp-java
  128. endif
  129. EXTRA_DIST = autogen.sh src/gen_context.c src/basic-config.h $(JAVA_FILES)
  130. if ENABLE_MODULE_ECDH
  131. include src/modules/ecdh/Makefile.am.include
  132. endif
  133. if ENABLE_MODULE_RECOVERY
  134. include src/modules/recovery/Makefile.am.include
  135. endif