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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. DIST_SUBDIRS = secp256k1
  2. AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
  3. if EMBEDDED_LEVELDB
  4. LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include
  5. LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv
  6. LIBLEVELDB += $(builddir)/leveldb/libleveldb.a
  7. LIBMEMENV += $(builddir)/leveldb/libmemenv.a
  8. # 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
  9. $(LIBLEVELDB): $(LIBMEMENV)
  10. $(LIBLEVELDB) $(LIBMEMENV):
  11. @echo "Building LevelDB ..." && $(MAKE) -C $(@D) $(@F) CXX="$(CXX)" \
  12. CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \
  13. OPT="$(CXXFLAGS) $(CPPFLAGS)"
  14. endif
  15. BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
  16. BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
  17. BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
  18. LIBBITCOIN_SERVER=libbitcoin_server.a
  19. LIBBITCOIN_WALLET=libbitcoin_wallet.a
  20. LIBBITCOIN_COMMON=libbitcoin_common.a
  21. LIBBITCOIN_CLI=libbitcoin_cli.a
  22. LIBBITCOIN_UTIL=libbitcoin_util.a
  23. LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
  24. LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a
  25. LIBBITCOINQT=qt/libbitcoinqt.a
  26. LIBSECP256K1=secp256k1/libsecp256k1.la
  27. $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
  28. $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
  29. # Make is not made aware of per-object dependencies to avoid limiting building parallelization
  30. # But to build the less dependent modules first, we manually select their order here:
  31. EXTRA_LIBRARIES = \
  32. crypto/libbitcoin_crypto.a \
  33. libbitcoin_util.a \
  34. libbitcoin_common.a \
  35. univalue/libbitcoin_univalue.a \
  36. libbitcoin_server.a \
  37. libbitcoin_cli.a
  38. if ENABLE_WALLET
  39. BITCOIN_INCLUDES += $(BDB_CPPFLAGS)
  40. EXTRA_LIBRARIES += libbitcoin_wallet.a
  41. endif
  42. if BUILD_BITCOIN_LIBS
  43. lib_LTLIBRARIES = libbitcoinconsensus.la
  44. LIBBITCOIN_CONSENSUS=libbitcoinconsensus.la
  45. else
  46. LIBBITCOIN_CONSENSUS=
  47. endif
  48. bin_PROGRAMS =
  49. TESTS =
  50. if BUILD_BITCOIND
  51. bin_PROGRAMS += bitcoind
  52. endif
  53. if BUILD_BITCOIN_UTILS
  54. bin_PROGRAMS += bitcoin-cli bitcoin-tx
  55. endif
  56. .PHONY: FORCE
  57. # bitcoin core #
  58. BITCOIN_CORE_H = \
  59. addrman.h \
  60. alert.h \
  61. amount.h \
  62. arith_uint256.h \
  63. base58.h \
  64. bloom.h \
  65. chain.h \
  66. chainparamsbase.h \
  67. chainparams.h \
  68. chainparamsseeds.h \
  69. checkpoints.h \
  70. checkqueue.h \
  71. clientversion.h \
  72. coincontrol.h \
  73. coins.h \
  74. compat.h \
  75. compressor.h \
  76. consensus/params.h \
  77. core_io.h \
  78. wallet/db.h \
  79. eccryptoverify.h \
  80. ecwrapper.h \
  81. hash.h \
  82. init.h \
  83. key.h \
  84. keystore.h \
  85. leveldbwrapper.h \
  86. limitedmap.h \
  87. main.h \
  88. merkleblock.h \
  89. miner.h \
  90. mruset.h \
  91. netbase.h \
  92. net.h \
  93. noui.h \
  94. pow.h \
  95. primitives/block.h \
  96. primitives/transaction.h \
  97. protocol.h \
  98. pubkey.h \
  99. random.h \
  100. rpcclient.h \
  101. rpcprotocol.h \
  102. rpcserver.h \
  103. script/interpreter.h \
  104. script/script_error.h \
  105. script/script.h \
  106. script/sigcache.h \
  107. script/sign.h \
  108. script/standard.h \
  109. serialize.h \
  110. streams.h \
  111. support/allocators/secure.h \
  112. support/allocators/zeroafterfree.h \
  113. support/cleanse.h \
  114. support/pagelocker.h \
  115. sync.h \
  116. threadsafety.h \
  117. timedata.h \
  118. tinyformat.h \
  119. txdb.h \
  120. txmempool.h \
  121. ui_interface.h \
  122. uint256.h \
  123. undo.h \
  124. util.h \
  125. utilmoneystr.h \
  126. utilstrencodings.h \
  127. utiltime.h \
  128. validationinterface.h \
  129. version.h \
  130. wallet/crypter.h \
  131. wallet/walletdb.h \
  132. wallet/wallet.h \
  133. wallet/wallet_ismine.h \
  134. compat/byteswap.h \
  135. compat/endian.h \
  136. compat/sanity.h
  137. JSON_H = \
  138. json/json_spirit.h \
  139. json/json_spirit_error_position.h \
  140. json/json_spirit_reader.h \
  141. json/json_spirit_reader_template.h \
  142. json/json_spirit_stream_reader.h \
  143. json/json_spirit_utils.h \
  144. json/json_spirit_value.h \
  145. json/json_spirit_writer.h \
  146. json/json_spirit_writer_template.h
  147. obj/build.h: FORCE
  148. @$(MKDIR_P) $(builddir)/obj
  149. @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
  150. $(abs_top_srcdir)
  151. libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
  152. # server: shared between bitcoind and bitcoin-qt
  153. libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
  154. libbitcoin_server_a_SOURCES = \
  155. addrman.cpp \
  156. alert.cpp \
  157. bloom.cpp \
  158. chain.cpp \
  159. checkpoints.cpp \
  160. init.cpp \
  161. leveldbwrapper.cpp \
  162. main.cpp \
  163. merkleblock.cpp \
  164. miner.cpp \
  165. net.cpp \
  166. noui.cpp \
  167. pow.cpp \
  168. rest.cpp \
  169. rpcblockchain.cpp \
  170. rpcmining.cpp \
  171. rpcmisc.cpp \
  172. rpcnet.cpp \
  173. rpcrawtransaction.cpp \
  174. rpcserver.cpp \
  175. script/sigcache.cpp \
  176. timedata.cpp \
  177. txdb.cpp \
  178. txmempool.cpp \
  179. validationinterface.cpp \
  180. $(JSON_H) \
  181. $(BITCOIN_CORE_H)
  182. # wallet: shared between bitcoind and bitcoin-qt, but only linked
  183. # when wallet enabled
  184. libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
  185. libbitcoin_wallet_a_SOURCES = \
  186. wallet/crypter.cpp \
  187. wallet/db.cpp \
  188. wallet/rpcdump.cpp \
  189. wallet/rpcwallet.cpp \
  190. wallet/wallet.cpp \
  191. wallet/wallet_ismine.cpp \
  192. wallet/walletdb.cpp \
  193. $(BITCOIN_CORE_H)
  194. # crypto primitives library
  195. crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES)
  196. crypto_libbitcoin_crypto_a_SOURCES = \
  197. crypto/sha1.cpp \
  198. crypto/sha256.cpp \
  199. crypto/sha512.cpp \
  200. crypto/hmac_sha256.cpp \
  201. crypto/hmac_sha512.cpp \
  202. crypto/ripemd160.cpp \
  203. crypto/common.h \
  204. crypto/sha256.h \
  205. crypto/sha512.h \
  206. crypto/hmac_sha256.h \
  207. crypto/hmac_sha512.h \
  208. crypto/sha1.h \
  209. crypto/ripemd160.h
  210. # univalue JSON library
  211. univalue_libbitcoin_univalue_a_SOURCES = \
  212. univalue/univalue.cpp \
  213. univalue/univalue_read.cpp \
  214. univalue/univalue_write.cpp \
  215. univalue/univalue_escapes.h \
  216. univalue/univalue.h
  217. # common: shared between bitcoind, and bitcoin-qt and non-server tools
  218. libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
  219. libbitcoin_common_a_SOURCES = \
  220. arith_uint256.cpp \
  221. amount.cpp \
  222. base58.cpp \
  223. chainparams.cpp \
  224. coins.cpp \
  225. compressor.cpp \
  226. primitives/block.cpp \
  227. primitives/transaction.cpp \
  228. core_read.cpp \
  229. core_write.cpp \
  230. eccryptoverify.cpp \
  231. ecwrapper.cpp \
  232. hash.cpp \
  233. key.cpp \
  234. keystore.cpp \
  235. netbase.cpp \
  236. protocol.cpp \
  237. pubkey.cpp \
  238. script/interpreter.cpp \
  239. script/script.cpp \
  240. script/sign.cpp \
  241. script/standard.cpp \
  242. script/script_error.cpp \
  243. $(BITCOIN_CORE_H)
  244. # util: shared between all executables.
  245. # This library *must* be included to make sure that the glibc
  246. # backward-compatibility objects and their sanity checks are linked.
  247. libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
  248. libbitcoin_util_a_SOURCES = \
  249. support/pagelocker.cpp \
  250. chainparamsbase.cpp \
  251. clientversion.cpp \
  252. compat/glibc_sanity.cpp \
  253. compat/glibcxx_sanity.cpp \
  254. compat/strnlen.cpp \
  255. random.cpp \
  256. rpcprotocol.cpp \
  257. support/cleanse.cpp \
  258. sync.cpp \
  259. uint256.cpp \
  260. util.cpp \
  261. utilmoneystr.cpp \
  262. utilstrencodings.cpp \
  263. utiltime.cpp \
  264. $(BITCOIN_CORE_H)
  265. if GLIBC_BACK_COMPAT
  266. libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
  267. endif
  268. # cli: shared between bitcoin-cli and bitcoin-qt
  269. libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
  270. libbitcoin_cli_a_SOURCES = \
  271. rpcclient.cpp \
  272. $(BITCOIN_CORE_H)
  273. nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
  274. #
  275. # bitcoind binary #
  276. bitcoind_SOURCES = bitcoind.cpp
  277. bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES)
  278. bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
  279. if TARGET_WINDOWS
  280. bitcoind_SOURCES += bitcoind-res.rc
  281. endif
  282. bitcoind_LDADD = \
  283. $(LIBBITCOIN_SERVER) \
  284. $(LIBBITCOIN_COMMON) \
  285. $(LIBBITCOIN_UNIVALUE) \
  286. $(LIBBITCOIN_UTIL) \
  287. $(LIBBITCOIN_CRYPTO) \
  288. $(LIBLEVELDB) \
  289. $(LIBMEMENV) \
  290. $(LIBSECP256K1)
  291. if ENABLE_WALLET
  292. bitcoind_LDADD += libbitcoin_wallet.a
  293. endif
  294. bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
  295. #
  296. # bitcoin-cli binary #
  297. bitcoin_cli_SOURCES = bitcoin-cli.cpp
  298. bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
  299. bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
  300. if TARGET_WINDOWS
  301. bitcoin_cli_SOURCES += bitcoin-cli-res.rc
  302. endif
  303. bitcoin_cli_LDADD = \
  304. $(LIBBITCOIN_CLI) \
  305. $(LIBBITCOIN_UTIL) \
  306. $(LIBSECP256K1)
  307. bitcoin_cli_LDADD += $(BOOST_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
  308. #
  309. # bitcoin-tx binary #
  310. bitcoin_tx_SOURCES = bitcoin-tx.cpp
  311. bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
  312. bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
  313. bitcoin_tx_LDADD = \
  314. $(LIBBITCOIN_UNIVALUE) \
  315. $(LIBBITCOIN_COMMON) \
  316. $(LIBBITCOIN_UTIL) \
  317. $(LIBBITCOIN_CRYPTO) \
  318. $(LIBSECP256K1)
  319. bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
  320. #
  321. # bitcoinconsensus library #
  322. if BUILD_BITCOIN_LIBS
  323. include_HEADERS = script/bitcoinconsensus.h
  324. libbitcoinconsensus_la_SOURCES = \
  325. crypto/hmac_sha512.cpp \
  326. crypto/ripemd160.cpp \
  327. crypto/sha1.cpp \
  328. crypto/sha256.cpp \
  329. crypto/sha512.cpp \
  330. eccryptoverify.cpp \
  331. ecwrapper.cpp \
  332. hash.cpp \
  333. primitives/transaction.cpp \
  334. pubkey.cpp \
  335. script/bitcoinconsensus.cpp \
  336. script/interpreter.cpp \
  337. script/script.cpp \
  338. uint256.cpp \
  339. utilstrencodings.cpp
  340. if GLIBC_BACK_COMPAT
  341. libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
  342. endif
  343. libbitcoinconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)
  344. libbitcoinconsensus_la_LIBADD = $(CRYPTO_LIBS)
  345. libbitcoinconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BITCOIN_INTERNAL
  346. endif
  347. #
  348. CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno
  349. DISTCLEANFILES = obj/build.h
  350. EXTRA_DIST = leveldb
  351. clean-local:
  352. -$(MAKE) -C leveldb clean
  353. -$(MAKE) -C secp256k1 clean
  354. rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
  355. -rm -f config.h
  356. .rc.o:
  357. @test -f $(WINDRES)
  358. $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
  359. .mm.o:
  360. $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
  361. $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $<
  362. %.pb.cc %.pb.h: %.proto
  363. @test -f $(PROTOC)
  364. $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
  365. if ENABLE_TESTS
  366. include Makefile.test.include
  367. endif
  368. if ENABLE_QT
  369. include Makefile.qt.include
  370. endif
  371. if ENABLE_QT_TESTS
  372. include Makefile.qttest.include
  373. endif