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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  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) -D__STDC_LIMIT_MACROS"
  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. chainparams.h \
  67. chainparamsbase.h \
  68. chainparamsseeds.h \
  69. checkpoints.h \
  70. checkqueue.h \
  71. clientversion.h \
  72. coincontrol.h \
  73. coins.h \
  74. compat.h \
  75. compat/byteswap.h \
  76. compat/endian.h \
  77. compat/sanity.h \
  78. compressor.h \
  79. consensus/consensus.h \
  80. consensus/params.h \
  81. consensus/validation.h \
  82. core_io.h \
  83. core_memusage.h \
  84. eccryptoverify.h \
  85. ecwrapper.h \
  86. hash.h \
  87. httprpc.h \
  88. httpserver.h \
  89. init.h \
  90. key.h \
  91. keystore.h \
  92. leveldbwrapper.h \
  93. limitedmap.h \
  94. main.h \
  95. memusage.h \
  96. merkleblock.h \
  97. miner.h \
  98. mruset.h \
  99. net.h \
  100. netbase.h \
  101. noui.h \
  102. policy/fees.h \
  103. policy/policy.h \
  104. pow.h \
  105. primitives/block.h \
  106. primitives/transaction.h \
  107. protocol.h \
  108. pubkey.h \
  109. random.h \
  110. rpcclient.h \
  111. rpcprotocol.h \
  112. rpcserver.h \
  113. scheduler.h \
  114. script/interpreter.h \
  115. script/script.h \
  116. script/script_error.h \
  117. script/sigcache.h \
  118. script/sign.h \
  119. script/standard.h \
  120. serialize.h \
  121. streams.h \
  122. support/allocators/secure.h \
  123. support/allocators/zeroafterfree.h \
  124. support/cleanse.h \
  125. support/pagelocker.h \
  126. sync.h \
  127. threadsafety.h \
  128. timedata.h \
  129. tinyformat.h \
  130. txdb.h \
  131. txmempool.h \
  132. ui_interface.h \
  133. uint256.h \
  134. undo.h \
  135. util.h \
  136. utilmoneystr.h \
  137. utilstrencodings.h \
  138. utiltime.h \
  139. validationinterface.h \
  140. version.h \
  141. wallet/crypter.h \
  142. wallet/db.h \
  143. wallet/wallet.h \
  144. wallet/wallet_ismine.h \
  145. wallet/walletdb.h
  146. obj/build.h: FORCE
  147. @$(MKDIR_P) $(builddir)/obj
  148. @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
  149. $(abs_top_srcdir)
  150. libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
  151. # server: shared between bitcoind and bitcoin-qt
  152. libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS)
  153. libbitcoin_server_a_SOURCES = \
  154. addrman.cpp \
  155. alert.cpp \
  156. bloom.cpp \
  157. chain.cpp \
  158. checkpoints.cpp \
  159. httprpc.cpp \
  160. httpserver.cpp \
  161. init.cpp \
  162. leveldbwrapper.cpp \
  163. main.cpp \
  164. merkleblock.cpp \
  165. miner.cpp \
  166. net.cpp \
  167. noui.cpp \
  168. policy/fees.cpp \
  169. policy/policy.cpp \
  170. pow.cpp \
  171. rest.cpp \
  172. rpcblockchain.cpp \
  173. rpcmining.cpp \
  174. rpcmisc.cpp \
  175. rpcnet.cpp \
  176. rpcrawtransaction.cpp \
  177. rpcserver.cpp \
  178. script/sigcache.cpp \
  179. timedata.cpp \
  180. txdb.cpp \
  181. txmempool.cpp \
  182. validationinterface.cpp \
  183. $(BITCOIN_CORE_H)
  184. # wallet: shared between bitcoind and bitcoin-qt, but only linked
  185. # when wallet enabled
  186. libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
  187. libbitcoin_wallet_a_SOURCES = \
  188. wallet/crypter.cpp \
  189. wallet/db.cpp \
  190. wallet/rpcdump.cpp \
  191. wallet/rpcwallet.cpp \
  192. wallet/wallet.cpp \
  193. wallet/wallet_ismine.cpp \
  194. wallet/walletdb.cpp \
  195. $(BITCOIN_CORE_H)
  196. # crypto primitives library
  197. crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES)
  198. crypto_libbitcoin_crypto_a_SOURCES = \
  199. crypto/common.h \
  200. crypto/hmac_sha256.cpp \
  201. crypto/hmac_sha256.h \
  202. crypto/hmac_sha512.cpp \
  203. crypto/hmac_sha512.h \
  204. crypto/ripemd160.cpp \
  205. crypto/ripemd160.h \
  206. crypto/sha1.cpp \
  207. crypto/sha1.h \
  208. crypto/sha256.cpp \
  209. crypto/sha256.h \
  210. crypto/sha512.cpp \
  211. crypto/sha512.h
  212. # univalue JSON library
  213. univalue_libbitcoin_univalue_a_SOURCES = \
  214. univalue/univalue.cpp \
  215. univalue/univalue.h \
  216. univalue/univalue_escapes.h \
  217. univalue/univalue_read.cpp \
  218. univalue/univalue_write.cpp
  219. # common: shared between bitcoind, and bitcoin-qt and non-server tools
  220. libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
  221. libbitcoin_common_a_SOURCES = \
  222. amount.cpp \
  223. arith_uint256.cpp \
  224. base58.cpp \
  225. chainparams.cpp \
  226. coins.cpp \
  227. compressor.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. primitives/block.cpp \
  237. primitives/transaction.cpp \
  238. protocol.cpp \
  239. pubkey.cpp \
  240. scheduler.cpp \
  241. script/interpreter.cpp \
  242. script/script.cpp \
  243. script/script_error.cpp \
  244. script/sign.cpp \
  245. script/standard.cpp \
  246. $(BITCOIN_CORE_H)
  247. # util: shared between all executables.
  248. # This library *must* be included to make sure that the glibc
  249. # backward-compatibility objects and their sanity checks are linked.
  250. libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
  251. libbitcoin_util_a_SOURCES = \
  252. support/pagelocker.cpp \
  253. chainparamsbase.cpp \
  254. clientversion.cpp \
  255. compat/glibc_sanity.cpp \
  256. compat/glibcxx_sanity.cpp \
  257. compat/strnlen.cpp \
  258. random.cpp \
  259. rpcprotocol.cpp \
  260. support/cleanse.cpp \
  261. sync.cpp \
  262. uint256.cpp \
  263. util.cpp \
  264. utilmoneystr.cpp \
  265. utilstrencodings.cpp \
  266. utiltime.cpp \
  267. $(BITCOIN_CORE_H)
  268. if GLIBC_BACK_COMPAT
  269. libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
  270. endif
  271. # cli: shared between bitcoin-cli and bitcoin-qt
  272. libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
  273. libbitcoin_cli_a_SOURCES = \
  274. rpcclient.cpp \
  275. $(BITCOIN_CORE_H)
  276. nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
  277. #
  278. # bitcoind binary #
  279. bitcoind_SOURCES = bitcoind.cpp
  280. bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES)
  281. bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
  282. if TARGET_WINDOWS
  283. bitcoind_SOURCES += bitcoind-res.rc
  284. endif
  285. bitcoind_LDADD = \
  286. $(LIBBITCOIN_SERVER) \
  287. $(LIBBITCOIN_COMMON) \
  288. $(LIBBITCOIN_UNIVALUE) \
  289. $(LIBBITCOIN_UTIL) \
  290. $(LIBBITCOIN_CRYPTO) \
  291. $(LIBLEVELDB) \
  292. $(LIBMEMENV) \
  293. $(LIBSECP256K1)
  294. if ENABLE_WALLET
  295. bitcoind_LDADD += libbitcoin_wallet.a
  296. endif
  297. bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
  298. #
  299. # bitcoin-cli binary #
  300. bitcoin_cli_SOURCES = bitcoin-cli.cpp
  301. bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES) $(EVENT_CFLAGS)
  302. bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
  303. if TARGET_WINDOWS
  304. bitcoin_cli_SOURCES += bitcoin-cli-res.rc
  305. endif
  306. bitcoin_cli_LDADD = \
  307. $(LIBBITCOIN_CLI) \
  308. $(LIBBITCOIN_UNIVALUE) \
  309. $(LIBBITCOIN_UTIL) \
  310. $(LIBSECP256K1)
  311. bitcoin_cli_LDADD += $(BOOST_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(EVENT_LIBS)
  312. #
  313. # bitcoin-tx binary #
  314. bitcoin_tx_SOURCES = bitcoin-tx.cpp
  315. bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
  316. bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
  317. if TARGET_WINDOWS
  318. bitcoin_tx_SOURCES += bitcoin-tx-res.rc
  319. endif
  320. bitcoin_tx_LDADD = \
  321. $(LIBBITCOIN_UNIVALUE) \
  322. $(LIBBITCOIN_COMMON) \
  323. $(LIBBITCOIN_UTIL) \
  324. $(LIBBITCOIN_CRYPTO) \
  325. $(LIBSECP256K1)
  326. bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
  327. #
  328. # bitcoinconsensus library #
  329. if BUILD_BITCOIN_LIBS
  330. include_HEADERS = script/bitcoinconsensus.h
  331. libbitcoinconsensus_la_SOURCES = \
  332. crypto/hmac_sha512.cpp \
  333. crypto/ripemd160.cpp \
  334. crypto/sha1.cpp \
  335. crypto/sha256.cpp \
  336. crypto/sha512.cpp \
  337. eccryptoverify.cpp \
  338. ecwrapper.cpp \
  339. hash.cpp \
  340. primitives/transaction.cpp \
  341. pubkey.cpp \
  342. script/bitcoinconsensus.cpp \
  343. script/interpreter.cpp \
  344. script/script.cpp \
  345. uint256.cpp \
  346. utilstrencodings.cpp
  347. if GLIBC_BACK_COMPAT
  348. libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
  349. endif
  350. libbitcoinconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)
  351. libbitcoinconsensus_la_LIBADD = $(CRYPTO_LIBS)
  352. libbitcoinconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BITCOIN_INTERNAL
  353. endif
  354. #
  355. CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno
  356. DISTCLEANFILES = obj/build.h
  357. EXTRA_DIST = leveldb
  358. clean-local:
  359. -$(MAKE) -C leveldb clean
  360. -$(MAKE) -C secp256k1 clean
  361. rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
  362. -rm -f config.h
  363. .rc.o:
  364. @test -f $(WINDRES)
  365. $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
  366. .mm.o:
  367. $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
  368. $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $<
  369. %.pb.cc %.pb.h: %.proto
  370. @test -f $(PROTOC)
  371. $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
  372. if ENABLE_TESTS
  373. include Makefile.test.include
  374. endif
  375. if ENABLE_QT
  376. include Makefile.qt.include
  377. endif
  378. if ENABLE_QT_TESTS
  379. include Makefile.qttest.include
  380. endif