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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. AM_CPPFLAGS = $(INCLUDES)
  2. AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
  3. if USE_LIBSECP256K1
  4. secp256k1/libsecp256k1.la: $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
  5. @$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
  6. endif
  7. if EMBEDDED_LEVELDB
  8. LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include
  9. LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv
  10. LIBLEVELDB += $(builddir)/leveldb/libleveldb.a
  11. LIBMEMENV += $(builddir)/leveldb/libmemenv.a
  12. # NOTE: This dependency is not strictly necessary, but without it make may try to build both in parallel, which breaks the LevelDB build system in a race
  13. $(LIBLEVELDB): $(LIBMEMENV)
  14. $(LIBLEVELDB) $(LIBMEMENV):
  15. @echo "Building LevelDB ..." && $(MAKE) -C $(@D) $(@F) CXX="$(CXX)" \
  16. CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \
  17. OPT="$(CXXFLAGS) $(CPPFLAGS)"
  18. endif
  19. BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
  20. BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS)
  21. if USE_LIBSECP256K1
  22. BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
  23. endif
  24. LIBBITCOIN_SERVER=libbitcoin_server.a
  25. LIBBITCOIN_WALLET=libbitcoin_wallet.a
  26. LIBBITCOIN_COMMON=libbitcoin_common.a
  27. LIBBITCOIN_CLI=libbitcoin_cli.a
  28. LIBBITCOIN_UTIL=libbitcoin_util.a
  29. LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
  30. LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a
  31. LIBBITCOINQT=qt/libbitcoinqt.a
  32. noinst_LIBRARIES = \
  33. libbitcoin_server.a \
  34. libbitcoin_common.a \
  35. libbitcoin_cli.a \
  36. libbitcoin_util.a \
  37. univalue/libbitcoin_univalue.a \
  38. crypto/libbitcoin_crypto.a
  39. if ENABLE_WALLET
  40. BITCOIN_INCLUDES += $(BDB_CPPFLAGS)
  41. noinst_LIBRARIES += libbitcoin_wallet.a
  42. endif
  43. bin_PROGRAMS =
  44. TESTS =
  45. if BUILD_BITCOIND
  46. bin_PROGRAMS += bitcoind
  47. endif
  48. if BUILD_BITCOIN_CLI
  49. bin_PROGRAMS += bitcoin-cli
  50. endif
  51. bin_PROGRAMS += bitcoin-tx
  52. .PHONY: FORCE
  53. # bitcoin core #
  54. BITCOIN_CORE_H = \
  55. addrman.h \
  56. alert.h \
  57. allocators.h \
  58. base58.h \
  59. bloom.h \
  60. chainparams.h \
  61. chainparamsbase.h \
  62. chainparamsseeds.h \
  63. checkpoints.h \
  64. checkqueue.h \
  65. clientversion.h \
  66. coincontrol.h \
  67. coins.h \
  68. compat.h \
  69. core.h \
  70. core_io.h \
  71. crypter.h \
  72. db.h \
  73. hash.h \
  74. init.h \
  75. key.h \
  76. keystore.h \
  77. leveldbwrapper.h \
  78. limitedmap.h \
  79. main.h \
  80. miner.h \
  81. mruset.h \
  82. netbase.h \
  83. net.h \
  84. noui.h \
  85. pow.h \
  86. protocol.h \
  87. random.h \
  88. rpcclient.h \
  89. rpcprotocol.h \
  90. rpcserver.h \
  91. script.h \
  92. serialize.h \
  93. sync.h \
  94. threadsafety.h \
  95. timedata.h \
  96. tinyformat.h \
  97. txdb.h \
  98. txmempool.h \
  99. ui_interface.h \
  100. uint256.h \
  101. util.h \
  102. version.h \
  103. walletdb.h \
  104. wallet.h \
  105. compat/sanity.h
  106. JSON_H = \
  107. json/json_spirit.h \
  108. json/json_spirit_error_position.h \
  109. json/json_spirit_reader.h \
  110. json/json_spirit_reader_template.h \
  111. json/json_spirit_stream_reader.h \
  112. json/json_spirit_utils.h \
  113. json/json_spirit_value.h \
  114. json/json_spirit_writer.h \
  115. json/json_spirit_writer_template.h
  116. obj/build.h: FORCE
  117. @$(MKDIR_P) $(builddir)/obj
  118. @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
  119. $(abs_top_srcdir)
  120. libbitcoin_util_a-version.$(OBJEXT): obj/build.h
  121. # server: shared between bitcoind and bitcoin-qt
  122. libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES)
  123. libbitcoin_server_a_SOURCES = \
  124. addrman.cpp \
  125. alert.cpp \
  126. bloom.cpp \
  127. checkpoints.cpp \
  128. init.cpp \
  129. leveldbwrapper.cpp \
  130. main.cpp \
  131. miner.cpp \
  132. net.cpp \
  133. noui.cpp \
  134. pow.cpp \
  135. rpcblockchain.cpp \
  136. rpcmining.cpp \
  137. rpcmisc.cpp \
  138. rpcnet.cpp \
  139. rpcrawtransaction.cpp \
  140. rpcserver.cpp \
  141. timedata.cpp \
  142. txdb.cpp \
  143. txmempool.cpp \
  144. $(JSON_H) \
  145. $(BITCOIN_CORE_H)
  146. # wallet: shared between bitcoind and bitcoin-qt, but only linked
  147. # when wallet enabled
  148. libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
  149. libbitcoin_wallet_a_SOURCES = \
  150. db.cpp \
  151. crypter.cpp \
  152. rpcdump.cpp \
  153. rpcwallet.cpp \
  154. wallet.cpp \
  155. walletdb.cpp \
  156. $(BITCOIN_CORE_H)
  157. # crypto primitives library
  158. crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES)
  159. crypto_libbitcoin_crypto_a_SOURCES = \
  160. crypto/sha1.cpp \
  161. crypto/sha2.cpp \
  162. crypto/ripemd160.cpp \
  163. crypto/common.h \
  164. crypto/sha2.h \
  165. crypto/sha1.h \
  166. crypto/ripemd160.h
  167. # univalue JSON library
  168. univalue_libbitcoin_univalue_a_SOURCES = \
  169. univalue/univalue.cpp \
  170. univalue/univalue_read.cpp \
  171. univalue/univalue_write.cpp \
  172. univalue/univalue.h
  173. # common: shared between bitcoind, and bitcoin-qt and non-server tools
  174. libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
  175. libbitcoin_common_a_SOURCES = \
  176. allocators.cpp \
  177. base58.cpp \
  178. chainparams.cpp \
  179. coins.cpp \
  180. core.cpp \
  181. core_read.cpp \
  182. core_write.cpp \
  183. hash.cpp \
  184. key.cpp \
  185. keystore.cpp \
  186. netbase.cpp \
  187. protocol.cpp \
  188. script.cpp \
  189. $(BITCOIN_CORE_H)
  190. # util: shared between all executables.
  191. # This library *must* be included to make sure that the glibc
  192. # backward-compatibility objects and their sanity checks are linked.
  193. libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
  194. libbitcoin_util_a_SOURCES = \
  195. compat/glibc_sanity.cpp \
  196. compat/glibcxx_sanity.cpp \
  197. chainparamsbase.cpp \
  198. random.cpp \
  199. rpcprotocol.cpp \
  200. sync.cpp \
  201. uint256.cpp \
  202. util.cpp \
  203. version.cpp \
  204. $(BITCOIN_CORE_H)
  205. if GLIBC_BACK_COMPAT
  206. libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
  207. libbitcoin_util_a_SOURCES += compat/glibcxx_compat.cpp
  208. endif
  209. # cli: shared between bitcoin-cli and bitcoin-qt
  210. libbitcoin_cli_a_SOURCES = \
  211. rpcclient.cpp \
  212. $(BITCOIN_CORE_H)
  213. nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
  214. #
  215. # bitcoind binary #
  216. bitcoind_LDADD = \
  217. $(LIBBITCOIN_SERVER) \
  218. $(LIBBITCOIN_COMMON) \
  219. $(LIBBITCOIN_UNIVALUE) \
  220. $(LIBBITCOIN_UTIL) \
  221. $(LIBBITCOIN_CRYPTO) \
  222. $(LIBLEVELDB) \
  223. $(LIBMEMENV)
  224. if USE_LIBSECP256K1
  225. bitcoind_LDADD += secp256k1/libsecp256k1.la
  226. endif
  227. if ENABLE_WALLET
  228. bitcoind_LDADD += libbitcoin_wallet.a
  229. endif
  230. bitcoind_SOURCES = bitcoind.cpp
  231. #
  232. if TARGET_WINDOWS
  233. bitcoind_SOURCES += bitcoind-res.rc
  234. endif
  235. bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS)
  236. bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES)
  237. # bitcoin-cli binary #
  238. bitcoin_cli_LDADD = \
  239. $(LIBBITCOIN_CLI) \
  240. $(LIBBITCOIN_COMMON) \
  241. $(LIBBITCOIN_UTIL) \
  242. $(LIBBITCOIN_CRYPTO) \
  243. $(BOOST_LIBS)
  244. bitcoin_cli_SOURCES = \
  245. bitcoin-cli.cpp
  246. if USE_LIBSECP256K1
  247. bitcoin_cli_LDADD += secp256k1/libsecp256k1.la
  248. endif
  249. bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
  250. #
  251. # bitcoin-tx binary #
  252. bitcoin_tx_LDADD = \
  253. $(LIBBITCOIN_UNIVALUE) \
  254. $(LIBBITCOIN_COMMON) \
  255. $(LIBBITCOIN_UTIL) \
  256. $(LIBBITCOIN_CRYPTO) \
  257. $(BOOST_LIBS)
  258. bitcoin_tx_SOURCES = bitcoin-tx.cpp
  259. bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
  260. #
  261. if TARGET_WINDOWS
  262. bitcoin_cli_SOURCES += bitcoin-cli-res.rc
  263. endif
  264. CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno
  265. DISTCLEANFILES = obj/build.h
  266. EXTRA_DIST = leveldb secp256k1
  267. clean-local:
  268. -$(MAKE) -C leveldb clean
  269. -$(MAKE) -C secp256k1 clean 2>/dev/null
  270. rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
  271. -rm -f config.h
  272. .rc.o:
  273. @test -f $(WINDRES)
  274. $(AM_V_GEN) $(WINDRES) -i $< -o $@
  275. .mm.o:
  276. $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
  277. $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $<
  278. %.pb.cc %.pb.h: %.proto
  279. @test -f $(PROTOC)
  280. $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
  281. if ENABLE_TESTS
  282. include Makefile.test.include
  283. endif
  284. if ENABLE_QT
  285. include Makefile.qt.include
  286. endif
  287. if ENABLE_QT_TESTS
  288. include Makefile.qttest.include
  289. endif