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

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