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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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_starwels_NativeSecp256k1.h
  42. noinst_HEADERS += src/java/org_starwels_Secp256k1Context.h
  43. noinst_HEADERS += src/util.h
  44. noinst_HEADERS += src/testrand.h
  45. noinst_HEADERS += src/testrand_impl.h
  46. noinst_HEADERS += src/hash.h
  47. noinst_HEADERS += src/hash_impl.h
  48. noinst_HEADERS += src/field.h
  49. noinst_HEADERS += src/field_impl.h
  50. noinst_HEADERS += src/bench.h
  51. noinst_HEADERS += contrib/lax_der_parsing.h
  52. noinst_HEADERS += contrib/lax_der_parsing.c
  53. noinst_HEADERS += contrib/lax_der_privatekey_parsing.h
  54. noinst_HEADERS += contrib/lax_der_privatekey_parsing.c
  55. if USE_EXTERNAL_ASM
  56. COMMON_LIB = libsecp256k1_common.la
  57. noinst_LTLIBRARIES = $(COMMON_LIB)
  58. else
  59. COMMON_LIB =
  60. endif
  61. pkgconfigdir = $(libdir)/pkgconfig
  62. pkgconfig_DATA = libsecp256k1.pc
  63. if USE_EXTERNAL_ASM
  64. if USE_ASM_ARM
  65. libsecp256k1_common_la_SOURCES = src/asm/field_10x26_arm.s
  66. endif
  67. endif
  68. libsecp256k1_la_SOURCES = src/secp256k1.c
  69. libsecp256k1_la_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
  70. libsecp256k1_la_LIBADD = $(JNI_LIB) $(SECP_LIBS) $(COMMON_LIB)
  71. libsecp256k1_jni_la_SOURCES = src/java/org_starwels_NativeSecp256k1.c src/java/org_starwels_Secp256k1Context.c
  72. libsecp256k1_jni_la_CPPFLAGS = -DSECP256K1_BUILD $(JNI_INCLUDES)
  73. noinst_PROGRAMS =
  74. if USE_BENCHMARK
  75. noinst_PROGRAMS += bench_verify bench_sign bench_internal
  76. bench_verify_SOURCES = src/bench_verify.c
  77. bench_verify_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
  78. bench_sign_SOURCES = src/bench_sign.c
  79. bench_sign_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
  80. bench_internal_SOURCES = src/bench_internal.c
  81. bench_internal_LDADD = $(SECP_LIBS) $(COMMON_LIB)
  82. bench_internal_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES)
  83. endif
  84. TESTS =
  85. if USE_TESTS
  86. noinst_PROGRAMS += tests
  87. tests_SOURCES = src/tests.c
  88. tests_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/src -I$(top_srcdir)/include $(SECP_INCLUDES) $(SECP_TEST_INCLUDES)
  89. if !ENABLE_COVERAGE
  90. tests_CPPFLAGS += -DVERIFY
  91. endif
  92. tests_LDADD = $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
  93. tests_LDFLAGS = -static
  94. TESTS += tests
  95. endif
  96. if USE_EXHAUSTIVE_TESTS
  97. noinst_PROGRAMS += exhaustive_tests
  98. exhaustive_tests_SOURCES = src/tests_exhaustive.c
  99. exhaustive_tests_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/src $(SECP_INCLUDES)
  100. if !ENABLE_COVERAGE
  101. exhaustive_tests_CPPFLAGS += -DVERIFY
  102. endif
  103. exhaustive_tests_LDADD = $(SECP_LIBS)
  104. exhaustive_tests_LDFLAGS = -static
  105. TESTS += exhaustive_tests
  106. endif
  107. JAVAROOT=src/java
  108. JAVAORG=org/starwels
  109. JAVA_GUAVA=$(srcdir)/$(JAVAROOT)/guava/guava-18.0.jar
  110. CLASSPATH_ENV=CLASSPATH=$(JAVA_GUAVA)
  111. JAVA_FILES= \
  112. $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1.java \
  113. $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1Test.java \
  114. $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1Util.java \
  115. $(JAVAROOT)/$(JAVAORG)/Secp256k1Context.java
  116. if USE_JNI
  117. $(JAVA_GUAVA):
  118. @echo Guava is missing. Fetch it via: \
  119. wget https://search.maven.org/remotecontent?filepath=com/google/guava/guava/18.0/guava-18.0.jar -O $(@)
  120. @false
  121. .stamp-java: $(JAVA_FILES)
  122. @echo Compiling $^
  123. $(AM_V_at)$(CLASSPATH_ENV) javac $^
  124. @touch $@
  125. if USE_TESTS
  126. check-java: libsecp256k1.la $(JAVA_GUAVA) .stamp-java
  127. $(AM_V_at)java -Djava.library.path="./:./src:./src/.libs:.libs/" -cp "$(JAVA_GUAVA):$(JAVAROOT)" $(JAVAORG)/NativeSecp256k1Test
  128. endif
  129. endif
  130. if USE_ECMULT_STATIC_PRECOMPUTATION
  131. CPPFLAGS_FOR_BUILD +=-I$(top_srcdir)
  132. CFLAGS_FOR_BUILD += -Wall -Wextra -Wno-unused-function
  133. gen_context_OBJECTS = gen_context.o
  134. gen_context_BIN = gen_context$(BUILD_EXEEXT)
  135. gen_%.o: src/gen_%.c
  136. $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c $< -o $@
  137. $(gen_context_BIN): $(gen_context_OBJECTS)
  138. $(CC_FOR_BUILD) $^ -o $@
  139. $(libsecp256k1_la_OBJECTS): src/ecmult_static_context.h
  140. $(tests_OBJECTS): src/ecmult_static_context.h
  141. $(bench_internal_OBJECTS): src/ecmult_static_context.h
  142. src/ecmult_static_context.h: $(gen_context_BIN)
  143. ./$(gen_context_BIN)
  144. CLEANFILES = $(gen_context_BIN) src/ecmult_static_context.h $(JAVAROOT)/$(JAVAORG)/*.class .stamp-java
  145. endif
  146. EXTRA_DIST = autogen.sh src/gen_context.c src/basic-config.h $(JAVA_FILES)
  147. if ENABLE_MODULE_ECDH
  148. include src/modules/ecdh/Makefile.am.include
  149. endif
  150. if ENABLE_MODULE_RECOVERY
  151. include src/modules/recovery/Makefile.am.include
  152. endif