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
73 zcash/IncrementalMerkleTree.hpp \
74 zcash/NoteEncryption.hpp \
83 .PHONY: FORCE check-symbols check-security
108 consensus/consensus.h \
110 consensus/validation.h \
131 primitives/transaction.h \
140 script/interpreter.h \
142 script/script_error.h \
148 support/allocators/secure.h \
149 support/allocators/zeroafterfree.h \
151 support/pagelocker.h \
166 validationinterface.h \
168 wallet/asyncrpcoperation_sendmany.h \
172 wallet/wallet_ismine.h \
177 json/json_spirit_error_position.h \
178 json/json_spirit_reader.h \
179 json/json_spirit_reader_template.h \
180 json/json_spirit_stream_reader.h \
181 json/json_spirit_utils.h \
182 json/json_spirit_value.h \
183 json/json_spirit_writer.h \
184 json/json_spirit_writer_template.h
187 @$(MKDIR_P) $(builddir)/obj
188 @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
190 libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
192 # server: shared between bitcoind and bitcoin-qt
193 libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
194 libbitcoin_server_a_SOURCES = \
199 asyncrpcoperation.cpp \
218 rpcrawtransaction.cpp \
220 script/sigcache.cpp \
224 validationinterface.cpp \
229 # wallet: shared between bitcoind and bitcoin-qt, but only linked
230 # when wallet enabled
231 libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
232 libbitcoin_wallet_a_SOURCES = \
235 wallet/asyncrpcoperation_sendmany.cpp \
239 wallet/rpcwallet.cpp \
241 wallet/wallet_ismine.cpp \
242 wallet/walletdb.cpp \
246 EQUIHASH_TROMP_SOURCES = \
247 pow/tromp/equi_miner.h \
249 pow/tromp/osx_barrier.h
251 # crypto primitives library
252 crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES) -DEQUIHASH_TROMP_ATOMIC
253 crypto_libbitcoin_crypto_a_SOURCES = \
255 crypto/equihash.cpp \
257 crypto/equihash.tcc \
258 crypto/hmac_sha256.cpp \
259 crypto/hmac_sha256.h \
260 crypto/hmac_sha512.cpp \
261 crypto/hmac_sha512.h \
262 crypto/ripemd160.cpp \
270 ${EQUIHASH_TROMP_SOURCES}
272 # univalue JSON library
273 univalue_libbitcoin_univalue_a_SOURCES = \
274 univalue/univalue.cpp \
275 univalue/univalue.h \
276 univalue/univalue_escapes.h \
277 univalue/univalue_read.cpp \
278 univalue/univalue_write.cpp
280 # common: shared between bitcoind, and bitcoin-qt and non-server tools
281 libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
282 libbitcoin_common_a_SOURCES = \
297 primitives/block.cpp \
298 primitives/transaction.cpp \
302 script/interpreter.cpp \
304 script/script_error.cpp \
306 script/standard.cpp \
310 # util: shared between all executables.
311 # This library *must* be included to make sure that the glibc
312 # backward-compatibility objects and their sanity checks are linked.
313 libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
314 libbitcoin_util_a_SOURCES = \
315 support/pagelocker.cpp \
316 chainparamsbase.cpp \
318 compat/glibc_sanity.cpp \
319 compat/glibcxx_sanity.cpp \
323 support/cleanse.cpp \
328 utilstrencodings.cpp \
334 libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
337 # cli: shared between bitcoin-cli and bitcoin-qt
338 libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
339 libbitcoin_cli_a_SOURCES = \
344 nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
348 zcashd_SOURCES = bitcoind.cpp
349 zcashd_CPPFLAGS = $(BITCOIN_INCLUDES)
350 zcashd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
353 zcashd_SOURCES += bitcoind-res.rc
357 $(LIBBITCOIN_SERVER) \
358 $(LIBBITCOIN_COMMON) \
359 $(LIBBITCOIN_UNIVALUE) \
361 $(LIBBITCOIN_CRYPTO) \
368 zcashd_LDADD += libbitcoin_wallet.a
378 $(LIBBITCOIN_CRYPTO) \
382 # bitcoin-cli binary #
383 zcash_cli_SOURCES = bitcoin-cli.cpp
384 zcash_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
385 zcash_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
388 zcash_cli_SOURCES += bitcoin-cli-res.rc
398 $(LIBBITCOIN_CRYPTO) \
402 # bitcoin-tx binary #
403 bitcoin_tx_SOURCES = bitcoin-tx.cpp
404 bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
405 bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
408 bitcoin_tx_SOURCES += bitcoin-tx-res.rc
411 # FIXME: Is libzcash needed for bitcoin_tx?
413 $(LIBBITCOIN_UNIVALUE) \
414 $(LIBBITCOIN_COMMON) \
418 $(LIBBITCOIN_CRYPTO) \
421 bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
424 # zcash protocol primitives #
425 libzcash_a_SOURCES = \
426 zcash/IncrementalMerkleTree.cpp \
427 zcash/NoteEncryption.cpp \
429 zcash/JoinSplit.cpp \
434 zcash/circuit/commitment.tcc \
435 zcash/circuit/gadget.tcc \
436 zcash/circuit/merkle.tcc \
437 zcash/circuit/note.tcc \
438 zcash/circuit/prfs.tcc \
439 zcash/circuit/utils.tcc
441 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)
443 libzcash_a_CXXFLAGS = $(HARDENED_CXXFLAGS) -fwrapv -fno-strict-aliasing
445 libzcash_a_LDFLAGS = $(HARDENED_LDFLAGS)
447 libzcash_a_CPPFLAGS += -DMONTGOMERY_OUTPUT
449 # bitcoinconsensus library #
450 if BUILD_BITCOIN_LIBS
451 include_HEADERS = script/bitcoinconsensus.h
452 libbitcoinconsensus_la_SOURCES = \
453 crypto/equihash.cpp \
454 crypto/hmac_sha512.cpp \
455 crypto/ripemd160.cpp \
462 primitives/transaction.cpp \
464 script/bitcoinconsensus.cpp \
465 script/interpreter.cpp \
471 libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
474 libbitcoinconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)
475 libbitcoinconsensus_la_LIBADD = $(CRYPTO_LIBS)
476 libbitcoinconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BITCOIN_INTERNAL
481 CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno
483 DISTCLEANFILES = obj/build.h
488 -$(MAKE) -C leveldb clean
489 -$(MAKE) -C secp256k1 clean
490 rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
495 $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
498 $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
499 $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $<
501 check-symbols: $(bin_PROGRAMS)
503 @echo "Checking glibc back compat of [$(bin_PROGRAMS)]..."
504 $(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(top_srcdir)/contrib/devtools/symbol-check.py < $(bin_PROGRAMS)
507 check-security: $(bin_PROGRAMS)
509 @echo "Checking binary security of [$(bin_PROGRAMS)]..."
510 $(AM_V_at) READELF=$(READELF) OBJDUMP=$(OBJDUMP) $(top_srcdir)/contrib/devtools/security-check.py < $(bin_PROGRAMS)
513 %.pb.cc %.pb.h: %.proto
515 $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
518 include Makefile.test.include
519 include Makefile.gtest.include
523 include Makefile.qt.include
527 include Makefile.qttest.include
530 include Makefile.zcash.include