1 DIST_SUBDIRS = secp256k1
2 AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
6 LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include
7 LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv
8 LIBLEVELDB += $(builddir)/leveldb/libleveldb.a
9 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)
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) -D__STDC_LIMIT_MACROS"
20 BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
21 BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
23 BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
25 LIBBITCOIN_SERVER=libbitcoin_server.a
26 LIBBITCOIN_WALLET=libbitcoin_wallet.a
27 LIBBITCOIN_COMMON=libbitcoin_common.a
28 LIBBITCOIN_CLI=libbitcoin_cli.a
29 LIBBITCOIN_UTIL=libbitcoin_util.a
30 LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
31 LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a
32 LIBBITCOINQT=qt/libbitcoinqt.a
33 LIBSECP256K1=secp256k1/libsecp256k1.la
36 $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
37 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
39 # Make is not made aware of per-object dependencies to avoid limiting building parallelization
40 # But to build the less dependent modules first, we manually select their order here:
42 crypto/libbitcoin_crypto.a \
45 univalue/libbitcoin_univalue.a \
50 BITCOIN_INCLUDES += $(BDB_CPPFLAGS)
51 EXTRA_LIBRARIES += libbitcoin_wallet.a
55 lib_LTLIBRARIES = libbitcoinconsensus.la
56 LIBBITCOIN_CONSENSUS=libbitcoinconsensus.la
65 bin_PROGRAMS += zcashd
68 if BUILD_BITCOIN_UTILS
69 bin_PROGRAMS += zcash-cli bitcoin-tx
72 # TODO: rename to libzcash
74 zcash/IncrementalMerkleTree.h \
75 zerocash/utils/util.h \
76 zcash/NoteEncryption.hpp \
106 consensus/consensus.h \
108 consensus/validation.h \
129 primitives/transaction.h \
138 script/interpreter.h \
140 script/script_error.h \
146 support/allocators/secure.h \
147 support/allocators/zeroafterfree.h \
149 support/pagelocker.h \
164 validationinterface.h \
169 wallet/wallet_ismine.h \
174 json/json_spirit_error_position.h \
175 json/json_spirit_reader.h \
176 json/json_spirit_reader_template.h \
177 json/json_spirit_stream_reader.h \
178 json/json_spirit_utils.h \
179 json/json_spirit_value.h \
180 json/json_spirit_writer.h \
181 json/json_spirit_writer_template.h
184 @$(MKDIR_P) $(builddir)/obj
185 @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
187 libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
189 # server: shared between bitcoind and bitcoin-qt
190 libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
191 libbitcoin_server_a_SOURCES = \
211 rpcrawtransaction.cpp \
213 script/sigcache.cpp \
217 validationinterface.cpp \
222 # wallet: shared between bitcoind and bitcoin-qt, but only linked
223 # when wallet enabled
224 libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
225 libbitcoin_wallet_a_SOURCES = \
230 wallet/rpcwallet.cpp \
232 wallet/wallet_ismine.cpp \
233 wallet/walletdb.cpp \
237 # crypto primitives library
238 crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES)
239 crypto_libbitcoin_crypto_a_SOURCES = \
241 crypto/equihash.cpp \
243 crypto/hmac_sha256.cpp \
244 crypto/hmac_sha256.h \
245 crypto/hmac_sha512.cpp \
246 crypto/hmac_sha512.h \
247 crypto/ripemd160.cpp \
256 # univalue JSON library
257 univalue_libbitcoin_univalue_a_SOURCES = \
258 univalue/univalue.cpp \
259 univalue/univalue.h \
260 univalue/univalue_escapes.h \
261 univalue/univalue_read.cpp \
262 univalue/univalue_write.cpp
264 # common: shared between bitcoind, and bitcoin-qt and non-server tools
265 libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
266 libbitcoin_common_a_SOURCES = \
281 primitives/block.cpp \
282 primitives/transaction.cpp \
286 script/interpreter.cpp \
288 script/script_error.cpp \
290 script/standard.cpp \
294 # util: shared between all executables.
295 # This library *must* be included to make sure that the glibc
296 # backward-compatibility objects and their sanity checks are linked.
297 libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
298 libbitcoin_util_a_SOURCES = \
299 support/pagelocker.cpp \
300 chainparamsbase.cpp \
302 compat/glibc_sanity.cpp \
303 compat/glibcxx_sanity.cpp \
307 support/cleanse.cpp \
312 utilstrencodings.cpp \
318 libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
321 # cli: shared between bitcoin-cli and bitcoin-qt
322 libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
323 libbitcoin_cli_a_SOURCES = \
328 nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
332 zcashd_SOURCES = bitcoind.cpp
333 zcashd_CPPFLAGS = $(BITCOIN_INCLUDES)
334 zcashd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
337 zcashd_SOURCES += bitcoind-res.rc
341 $(LIBBITCOIN_SERVER) \
342 $(LIBBITCOIN_COMMON) \
343 $(LIBBITCOIN_UNIVALUE) \
345 $(LIBBITCOIN_CRYPTO) \
352 zcashd_LDADD += libbitcoin_wallet.a
362 $(LIBBITCOIN_CRYPTO) \
366 # bitcoin-cli binary #
367 zcash_cli_SOURCES = bitcoin-cli.cpp
368 zcash_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
369 zcash_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
372 zcash_cli_SOURCES += bitcoin-cli-res.rc
382 $(LIBBITCOIN_CRYPTO) \
386 # bitcoin-tx binary #
387 bitcoin_tx_SOURCES = bitcoin-tx.cpp
388 bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
389 bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
392 bitcoin_tx_SOURCES += bitcoin-tx-res.rc
395 # FIXME: Is libzcash needed for bitcoin_tx?
397 $(LIBBITCOIN_UNIVALUE) \
398 $(LIBBITCOIN_COMMON) \
402 $(LIBBITCOIN_CRYPTO) \
405 bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
408 # zerocash protocol primitives #
409 libzcash_a_SOURCES = \
410 zcash/IncrementalMerkleTree.cpp \
411 zerocash/utils/util.cpp \
412 zcash/NoteEncryption.cpp \
414 zcash/JoinSplit.cpp \
419 libzcash_a_CPPFLAGS = -DMULTICORE -fopenmp -fPIC -DBINARY_OUTPUT -DCURVE_ALT_BN128 -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS $(HARDENED_CPPFLAGS) -pipe -O2 -O0 -g -Wstack-protector -fstack-protector-all -fPIE -fvisibility=hidden -DSTATIC $(BITCOIN_INCLUDES)
421 # bitcoinconsensus library #
422 if BUILD_BITCOIN_LIBS
423 include_HEADERS = script/bitcoinconsensus.h
424 libbitcoinconsensus_la_SOURCES = \
425 crypto/equihash.cpp \
426 crypto/hmac_sha512.cpp \
427 crypto/ripemd160.cpp \
434 primitives/transaction.cpp \
436 script/bitcoinconsensus.cpp \
437 script/interpreter.cpp \
443 libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
446 libbitcoinconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)
447 libbitcoinconsensus_la_LIBADD = $(CRYPTO_LIBS)
448 libbitcoinconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BITCOIN_INTERNAL
453 CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno
455 DISTCLEANFILES = obj/build.h
460 -$(MAKE) -C leveldb clean
461 -$(MAKE) -C secp256k1 clean
462 rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
467 $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
470 $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
471 $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $<
473 %.pb.cc %.pb.h: %.proto
475 $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
478 include Makefile.test.include
479 include Makefile.gtest.include
483 include Makefile.qt.include
487 include Makefile.qttest.include
490 include Makefile.zcash.include