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
54 EXTRA_LIBRARIES += libbitcoin_zmq.a
58 lib_LTLIBRARIES = libzcashconsensus.la
59 LIBZCASH_CONSENSUS=libzcashconsensus.la
69 bin_PROGRAMS += zcashd
72 if BUILD_BITCOIN_UTILS
73 bin_PROGRAMS += zcash-cli zcash-tx
77 zcash/IncrementalMerkleTree.hpp \
78 zcash/NoteEncryption.hpp \
87 .PHONY: FORCE check-symbols check-security
112 consensus/consensus.h \
114 consensus/validation.h \
136 primitives/transaction.h \
145 script/interpreter.h \
147 script/script_error.h \
153 support/allocators/secure.h \
154 support/allocators/zeroafterfree.h \
156 support/pagelocker.h \
171 validationinterface.h \
173 wallet/asyncrpcoperation_sendmany.h \
177 wallet/wallet_ismine.h \
179 zmq/zmqabstractnotifier.h \
181 zmq/zmqnotificationinterface.h \
182 zmq/zmqpublishnotifier.h
187 json/json_spirit_error_position.h \
188 json/json_spirit_reader.h \
189 json/json_spirit_reader_template.h \
190 json/json_spirit_stream_reader.h \
191 json/json_spirit_utils.h \
192 json/json_spirit_value.h \
193 json/json_spirit_writer.h \
194 json/json_spirit_writer_template.h
197 @$(MKDIR_P) $(builddir)/obj
198 @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
200 libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
202 # server: shared between bitcoind and bitcoin-qt
203 libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
204 libbitcoin_server_a_SOURCES = \
209 asyncrpcoperation.cpp \
229 rpcrawtransaction.cpp \
231 script/sigcache.cpp \
235 validationinterface.cpp \
241 LIBBITCOIN_ZMQ=libbitcoin_zmq.a
243 libbitcoin_zmq_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(ZMQ_CFLAGS)
244 libbitcoin_zmq_a_SOURCES = \
245 zmq/zmqabstractnotifier.cpp \
246 zmq/zmqnotificationinterface.cpp \
247 zmq/zmqpublishnotifier.cpp
251 # wallet: shared between bitcoind and bitcoin-qt, but only linked
252 # when wallet enabled
253 libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
254 libbitcoin_wallet_a_SOURCES = \
259 wallet/asyncrpcoperation_sendmany.cpp \
263 wallet/rpcwallet.cpp \
265 wallet/wallet_ismine.cpp \
266 wallet/walletdb.cpp \
270 # crypto primitives library
271 crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES)
272 crypto_libbitcoin_crypto_a_SOURCES = \
274 crypto/equihash.cpp \
276 crypto/equihash.tcc \
277 crypto/hmac_sha256.cpp \
278 crypto/hmac_sha256.h \
279 crypto/hmac_sha512.cpp \
280 crypto/hmac_sha512.h \
281 crypto/ripemd160.cpp \
291 EQUIHASH_TROMP_SOURCES = \
292 pow/tromp/equi_miner.h \
294 pow/tromp/osx_barrier.h
296 crypto_libbitcoin_crypto_a_CPPFLAGS += \
297 -DEQUIHASH_TROMP_ATOMIC
298 crypto_libbitcoin_crypto_a_SOURCES += \
299 ${EQUIHASH_TROMP_SOURCES}
302 # univalue JSON library
303 univalue_libbitcoin_univalue_a_SOURCES = \
304 univalue/univalue.cpp \
305 univalue/univalue.h \
306 univalue/univalue_escapes.h \
307 univalue/univalue_read.cpp \
308 univalue/univalue_write.cpp
310 # common: shared between bitcoind, and bitcoin-qt and non-server tools
311 libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
312 libbitcoin_common_a_SOURCES = \
327 primitives/block.cpp \
328 primitives/transaction.cpp \
332 script/interpreter.cpp \
334 script/script_error.cpp \
336 script/standard.cpp \
340 # util: shared between all executables.
341 # This library *must* be included to make sure that the glibc
342 # backward-compatibility objects and their sanity checks are linked.
343 libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
344 libbitcoin_util_a_SOURCES = \
345 support/pagelocker.cpp \
346 chainparamsbase.cpp \
348 compat/glibc_sanity.cpp \
349 compat/glibcxx_sanity.cpp \
353 support/cleanse.cpp \
358 utilstrencodings.cpp \
364 libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
367 # cli: shared between bitcoin-cli and bitcoin-qt
368 libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
369 libbitcoin_cli_a_SOURCES = \
374 nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
378 zcashd_SOURCES = bitcoind.cpp
379 zcashd_CPPFLAGS = $(BITCOIN_INCLUDES)
380 zcashd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
383 zcashd_SOURCES += bitcoind-res.rc
387 $(LIBBITCOIN_SERVER) \
388 $(LIBBITCOIN_COMMON) \
389 $(LIBBITCOIN_UNIVALUE) \
391 $(LIBBITCOIN_CRYPTO) \
398 zcashd_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
402 zcashd_LDADD += libbitcoin_wallet.a
412 $(LIBBITCOIN_CRYPTO) \
415 # bitcoin-cli binary #
416 zcash_cli_SOURCES = bitcoin-cli.cpp
417 zcash_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
418 zcash_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
421 zcash_cli_SOURCES += bitcoin-cli-res.rc
426 $(LIBBITCOIN_UNIVALUE) \
432 $(LIBBITCOIN_CRYPTO) \
437 zcash_tx_SOURCES = bitcoin-tx.cpp
438 zcash_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
439 zcash_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
442 zcash_tx_SOURCES += bitcoin-tx-res.rc
445 # FIXME: Is libzcash needed for zcash_tx?
447 $(LIBBITCOIN_UNIVALUE) \
448 $(LIBBITCOIN_COMMON) \
452 $(LIBBITCOIN_CRYPTO) \
455 zcash_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
458 # zcash protocol primitives #
459 libzcash_a_SOURCES = \
460 zcash/IncrementalMerkleTree.cpp \
461 zcash/NoteEncryption.cpp \
463 zcash/JoinSplit.cpp \
468 zcash/circuit/commitment.tcc \
469 zcash/circuit/gadget.tcc \
470 zcash/circuit/merkle.tcc \
471 zcash/circuit/note.tcc \
472 zcash/circuit/prfs.tcc \
473 zcash/circuit/utils.tcc
475 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)
477 libzcash_a_CXXFLAGS = $(HARDENED_CXXFLAGS) -fwrapv -fno-strict-aliasing
479 libzcash_a_LDFLAGS = $(HARDENED_LDFLAGS)
481 libzcash_a_CPPFLAGS += -DMONTGOMERY_OUTPUT
483 # zcashconsensus library #
484 if BUILD_BITCOIN_LIBS
485 include_HEADERS = script/zcashconsensus.h
486 libzcashconsensus_la_SOURCES = \
487 crypto/equihash.cpp \
488 crypto/hmac_sha512.cpp \
489 crypto/ripemd160.cpp \
496 primitives/transaction.cpp \
498 script/zcashconsensus.cpp \
499 script/interpreter.cpp \
505 libzcashconsensus_la_SOURCES += compat/glibc_compat.cpp
508 libzcashconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)
509 libzcashconsensus_la_LIBADD = $(CRYPTO_LIBS)
510 libzcashconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BITCOIN_INTERNAL
515 CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno */*.gcno wallet/*/*.gcno
517 DISTCLEANFILES = obj/build.h
522 -$(MAKE) -C leveldb clean
523 -$(MAKE) -C secp256k1 clean
524 rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
529 $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
532 $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
533 $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $<
535 check-symbols: $(bin_PROGRAMS)
537 @echo "Checking glibc back compat of [$(bin_PROGRAMS)]..."
538 $(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(top_srcdir)/contrib/devtools/symbol-check.py < $(bin_PROGRAMS)
541 check-security: $(bin_PROGRAMS)
543 @echo "Checking binary security of [$(bin_PROGRAMS)]..."
544 $(AM_V_at) READELF=$(READELF) OBJDUMP=$(OBJDUMP) $(top_srcdir)/contrib/devtools/security-check.py < $(bin_PROGRAMS)
547 %.pb.cc %.pb.h: %.proto
549 $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
552 include Makefile.test.include
553 include Makefile.gtest.include
557 include Makefile.qt.include
561 include Makefile.qttest.include
564 include Makefile.zcash.include