1 DIST_SUBDIRS = secp256k1 univalue
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
24 BITCOIN_INCLUDES += -I$(srcdir)/univalue/include
26 LIBBITCOIN_SERVER=libbitcoin_server.a
27 LIBBITCOIN_WALLET=libbitcoin_wallet.a
28 LIBBITCOIN_COMMON=libbitcoin_common.a
29 LIBBITCOIN_CLI=libbitcoin_cli.a
30 LIBBITCOIN_UTIL=libbitcoin_util.a
31 LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
32 LIBSECP256K1=secp256k1/libsecp256k1.la
33 LIBUNIVALUE=univalue/libunivalue.la
36 $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
37 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
39 $(LIBUNIVALUE): $(wildcard univalue/lib/*)
40 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue/
42 # Make is not made aware of per-object dependencies to avoid limiting building parallelization
43 # But to build the less dependent modules first, we manually select their order here:
45 crypto/libbitcoin_crypto.a \
52 BITCOIN_INCLUDES += $(BDB_CPPFLAGS)
53 EXTRA_LIBRARIES += libbitcoin_wallet.a
56 EXTRA_LIBRARIES += libbitcoin_zmq.a
59 EXTRA_LIBRARIES += libbitcoin_proton.a
63 lib_LTLIBRARIES = libzcashconsensus.la
64 LIBZCASH_CONSENSUS=libzcashconsensus.la
74 bin_PROGRAMS += zcashd
77 if BUILD_BITCOIN_UTILS
78 bin_PROGRAMS += zcash-cli zcash-tx
82 zcash/IncrementalMerkleTree.hpp \
83 zcash/NoteEncryption.hpp \
92 .PHONY: FORCE check-symbols check-security
98 amqp/amqpabstractnotifier.h \
100 amqp/amqpnotificationinterface.h \
101 amqp/amqppublishnotifier.h \
104 asyncrpcoperation.h \
122 consensus/consensus.h \
124 consensus/validation.h \
148 primitives/transaction.h \
157 script/interpreter.h \
159 script/script_error.h \
165 support/allocators/secure.h \
166 support/allocators/zeroafterfree.h \
169 support/pagelocker.h \
185 validationinterface.h \
187 wallet/asyncrpcoperation_sendmany.h \
191 wallet/wallet_ismine.h \
193 zmq/zmqabstractnotifier.h \
195 zmq/zmqnotificationinterface.h \
196 zmq/zmqpublishnotifier.h
200 @$(MKDIR_P) $(builddir)/obj
201 @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
203 libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
206 libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS)
207 libbitcoin_server_a_SOURCES = \
212 asyncrpcoperation.cpp \
235 rpcrawtransaction.cpp \
237 script/sigcache.cpp \
242 validationinterface.cpp \
247 LIBBITCOIN_ZMQ=libbitcoin_zmq.a
249 libbitcoin_zmq_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(ZMQ_CFLAGS)
250 libbitcoin_zmq_a_SOURCES = \
251 zmq/zmqabstractnotifier.cpp \
252 zmq/zmqnotificationinterface.cpp \
253 zmq/zmqpublishnotifier.cpp
257 LIBBITCOIN_PROTON=libbitcoin_proton.a
259 libbitcoin_proton_a_CPPFLAGS = $(BITCOIN_INCLUDES)
260 libbitcoin_proton_a_SOURCES = \
261 amqp/amqpabstractnotifier.cpp \
262 amqp/amqpnotificationinterface.cpp \
263 amqp/amqppublishnotifier.cpp
266 # wallet: zcashd, but only linked when wallet enabled
267 libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
268 libbitcoin_wallet_a_SOURCES = \
273 wallet/asyncrpcoperation_sendmany.cpp \
277 wallet/rpcwallet.cpp \
279 wallet/wallet_ismine.cpp \
280 wallet/walletdb.cpp \
284 # crypto primitives library
285 crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES)
286 crypto_libbitcoin_crypto_a_SOURCES = \
288 crypto/equihash.cpp \
290 crypto/equihash.tcc \
291 crypto/hmac_sha256.cpp \
292 crypto/hmac_sha256.h \
293 crypto/hmac_sha512.cpp \
294 crypto/hmac_sha512.h \
295 crypto/ripemd160.cpp \
305 EQUIHASH_TROMP_SOURCES = \
306 pow/tromp/equi_miner.h \
308 pow/tromp/osx_barrier.h
310 crypto_libbitcoin_crypto_a_CPPFLAGS += \
311 -DEQUIHASH_TROMP_ATOMIC
312 crypto_libbitcoin_crypto_a_SOURCES += \
313 ${EQUIHASH_TROMP_SOURCES}
316 # common: shared between zcashd and non-server tools
317 libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
318 libbitcoin_common_a_SOURCES = \
331 primitives/block.cpp \
332 primitives/transaction.cpp \
336 script/interpreter.cpp \
338 script/script_error.cpp \
340 script/standard.cpp \
344 # util: shared between all executables.
345 # This library *must* be included to make sure that the glibc
346 # backward-compatibility objects and their sanity checks are linked.
347 libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
348 libbitcoin_util_a_SOURCES = \
349 support/pagelocker.cpp \
350 chainparamsbase.cpp \
352 compat/glibc_sanity.cpp \
353 compat/glibcxx_sanity.cpp \
357 support/cleanse.cpp \
362 utilstrencodings.cpp \
368 libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
372 libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
373 libbitcoin_cli_a_SOURCES = \
378 nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
382 zcashd_SOURCES = bitcoind.cpp
383 zcashd_CPPFLAGS = $(BITCOIN_INCLUDES)
384 zcashd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
387 zcashd_SOURCES += bitcoind-res.rc
391 $(LIBBITCOIN_SERVER) \
392 $(LIBBITCOIN_COMMON) \
395 $(LIBBITCOIN_CRYPTO) \
402 zcashd_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
406 zcashd_LDADD += libbitcoin_wallet.a
414 $(EVENT_PTHREADS_LIBS) \
417 $(LIBBITCOIN_CRYPTO) \
421 zcashd_LDADD += $(LIBBITCOIN_PROTON) $(PROTON_LIBS)
424 # bitcoin-cli binary #
425 zcash_cli_SOURCES = bitcoin-cli.cpp
426 zcash_cli_CPPFLAGS = $(BITCOIN_INCLUDES) $(EVENT_CFLAGS)
427 zcash_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
430 zcash_cli_SOURCES += bitcoin-cli-res.rc
442 $(LIBBITCOIN_CRYPTO) \
447 zcash_tx_SOURCES = bitcoin-tx.cpp
448 zcash_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
449 zcash_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
452 zcash_tx_SOURCES += bitcoin-tx-res.rc
455 # FIXME: Is libzcash needed for zcash_tx?
458 $(LIBBITCOIN_COMMON) \
462 $(LIBBITCOIN_CRYPTO) \
465 zcash_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
468 # zcash protocol primitives #
469 libzcash_a_SOURCES = \
470 zcash/IncrementalMerkleTree.cpp \
471 zcash/NoteEncryption.cpp \
473 zcash/JoinSplit.cpp \
478 zcash/circuit/commitment.tcc \
479 zcash/circuit/gadget.tcc \
480 zcash/circuit/merkle.tcc \
481 zcash/circuit/note.tcc \
482 zcash/circuit/prfs.tcc \
483 zcash/circuit/utils.tcc
485 libzcash_a_CPPFLAGS = -DMULTICORE -fopenmp -fPIC -DBINARY_OUTPUT -DCURVE_ALT_BN128 -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS $(HARDENED_CPPFLAGS) -pipe -O1 -g -Wstack-protector -fstack-protector-all -fPIE -fvisibility=hidden -DSTATIC $(BITCOIN_INCLUDES)
487 libzcash_a_CXXFLAGS = $(HARDENED_CXXFLAGS) -fwrapv -fno-strict-aliasing
489 libzcash_a_LDFLAGS = $(HARDENED_LDFLAGS)
491 libzcash_a_CPPFLAGS += -DMONTGOMERY_OUTPUT
493 # zcashconsensus library #
494 if BUILD_BITCOIN_LIBS
495 include_HEADERS = script/zcashconsensus.h
496 libzcashconsensus_la_SOURCES = \
497 crypto/equihash.cpp \
498 crypto/hmac_sha512.cpp \
499 crypto/ripemd160.cpp \
504 primitives/transaction.cpp \
506 script/zcashconsensus.cpp \
507 script/interpreter.cpp \
513 libzcashconsensus_la_SOURCES += compat/glibc_compat.cpp
516 libzcashconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)
517 libzcashconsensus_la_LIBADD = $(LIBSECP256K1)
518 libzcashconsensus_la_CPPFLAGS = -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL
523 CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno */*.gcno wallet/*/*.gcno
525 DISTCLEANFILES = obj/build.h
530 -$(MAKE) -C leveldb clean
531 -$(MAKE) -C secp256k1 clean
532 rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
537 $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
540 $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
541 $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o $@ $<
543 check-symbols: $(bin_PROGRAMS)
545 @echo "Checking glibc back compat of [$(bin_PROGRAMS)]..."
546 $(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(top_srcdir)/contrib/devtools/symbol-check.py < $(bin_PROGRAMS)
549 check-security: $(bin_PROGRAMS)
551 @echo "Checking binary security of [$(bin_PROGRAMS)]..."
552 $(AM_V_at) READELF=$(READELF) OBJDUMP=$(OBJDUMP) $(top_srcdir)/contrib/devtools/security-check.py < $(bin_PROGRAMS)
555 %.pb.cc %.pb.h: %.proto
557 $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
560 include Makefile.test.include
561 include Makefile.gtest.include
564 include Makefile.zcash.include