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

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