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 = libzcashconsensus.la
56 LIBZCASH_CONSENSUS=libzcashconsensus.la
66 bin_PROGRAMS += zcashd
69 if BUILD_BITCOIN_UTILS
70 bin_PROGRAMS += zcash-cli zcash-tx
74 zcash/IncrementalMerkleTree.hpp \
75 zcash/NoteEncryption.hpp \
84 .PHONY: FORCE check-symbols check-security
109 consensus/consensus.h \
111 consensus/validation.h \
133 primitives/transaction.h \
142 script/interpreter.h \
144 script/script_error.h \
150 support/allocators/secure.h \
151 support/allocators/zeroafterfree.h \
153 support/pagelocker.h \
168 validationinterface.h \
170 wallet/asyncrpcoperation_sendmany.h \
174 wallet/wallet_ismine.h \
179 json/json_spirit_error_position.h \
180 json/json_spirit_reader.h \
181 json/json_spirit_reader_template.h \
182 json/json_spirit_stream_reader.h \
183 json/json_spirit_utils.h \
184 json/json_spirit_value.h \
185 json/json_spirit_writer.h \
186 json/json_spirit_writer_template.h
189 @$(MKDIR_P) $(builddir)/obj
190 @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
192 libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
194 # server: shared between bitcoind and bitcoin-qt
195 libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
196 libbitcoin_server_a_SOURCES = \
201 asyncrpcoperation.cpp \
221 rpcrawtransaction.cpp \
223 script/sigcache.cpp \
227 validationinterface.cpp \
232 # wallet: shared between bitcoind and bitcoin-qt, but only linked
233 # when wallet enabled
234 libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
235 libbitcoin_wallet_a_SOURCES = \
240 wallet/asyncrpcoperation_sendmany.cpp \
244 wallet/rpcwallet.cpp \
246 wallet/wallet_ismine.cpp \
247 wallet/walletdb.cpp \
251 EQUIHASH_TROMP_SOURCES = \
252 pow/tromp/equi_miner.h \
254 pow/tromp/osx_barrier.h
256 # crypto primitives library
257 crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES) -DEQUIHASH_TROMP_ATOMIC
258 crypto_libbitcoin_crypto_a_SOURCES = \
260 crypto/equihash.cpp \
262 crypto/equihash.tcc \
263 crypto/hmac_sha256.cpp \
264 crypto/hmac_sha256.h \
265 crypto/hmac_sha512.cpp \
266 crypto/hmac_sha512.h \
267 crypto/ripemd160.cpp \
275 ${EQUIHASH_TROMP_SOURCES}
277 # univalue JSON library
278 univalue_libbitcoin_univalue_a_SOURCES = \
279 univalue/univalue.cpp \
280 univalue/univalue.h \
281 univalue/univalue_escapes.h \
282 univalue/univalue_read.cpp \
283 univalue/univalue_write.cpp
285 # common: shared between bitcoind, and bitcoin-qt and non-server tools
286 libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
287 libbitcoin_common_a_SOURCES = \
302 primitives/block.cpp \
303 primitives/transaction.cpp \
307 script/interpreter.cpp \
309 script/script_error.cpp \
311 script/standard.cpp \
315 # util: shared between all executables.
316 # This library *must* be included to make sure that the glibc
317 # backward-compatibility objects and their sanity checks are linked.
318 libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
319 libbitcoin_util_a_SOURCES = \
320 support/pagelocker.cpp \
321 chainparamsbase.cpp \
323 compat/glibc_sanity.cpp \
324 compat/glibcxx_sanity.cpp \
328 support/cleanse.cpp \
333 utilstrencodings.cpp \
339 libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
342 # cli: shared between bitcoin-cli and bitcoin-qt
343 libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
344 libbitcoin_cli_a_SOURCES = \
349 nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
353 zcashd_SOURCES = bitcoind.cpp
354 zcashd_CPPFLAGS = $(BITCOIN_INCLUDES)
355 zcashd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
358 zcashd_SOURCES += bitcoind-res.rc
362 $(LIBBITCOIN_SERVER) \
363 $(LIBBITCOIN_COMMON) \
364 $(LIBBITCOIN_UNIVALUE) \
366 $(LIBBITCOIN_CRYPTO) \
373 zcashd_LDADD += libbitcoin_wallet.a
383 $(LIBBITCOIN_CRYPTO) \
387 # bitcoin-cli binary #
388 zcash_cli_SOURCES = bitcoin-cli.cpp
389 zcash_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
390 zcash_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
393 zcash_cli_SOURCES += bitcoin-cli-res.rc
403 $(LIBBITCOIN_CRYPTO) \
408 zcash_tx_SOURCES = bitcoin-tx.cpp
409 zcash_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
410 zcash_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
413 zcash_tx_SOURCES += bitcoin-tx-res.rc
416 # FIXME: Is libzcash needed for zcash_tx?
418 $(LIBBITCOIN_UNIVALUE) \
419 $(LIBBITCOIN_COMMON) \
423 $(LIBBITCOIN_CRYPTO) \
426 zcash_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
429 # zcash protocol primitives #
430 libzcash_a_SOURCES = \
431 zcash/IncrementalMerkleTree.cpp \
432 zcash/NoteEncryption.cpp \
434 zcash/JoinSplit.cpp \
439 zcash/circuit/commitment.tcc \
440 zcash/circuit/gadget.tcc \
441 zcash/circuit/merkle.tcc \
442 zcash/circuit/note.tcc \
443 zcash/circuit/prfs.tcc \
444 zcash/circuit/utils.tcc
446 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)
448 libzcash_a_CXXFLAGS = $(HARDENED_CXXFLAGS) -fwrapv -fno-strict-aliasing
450 libzcash_a_LDFLAGS = $(HARDENED_LDFLAGS)
452 libzcash_a_CPPFLAGS += -DMONTGOMERY_OUTPUT
454 # zcashconsensus library #
455 if BUILD_BITCOIN_LIBS
456 include_HEADERS = script/zcashconsensus.h
457 libzcashconsensus_la_SOURCES = \
458 crypto/equihash.cpp \
459 crypto/hmac_sha512.cpp \
460 crypto/ripemd160.cpp \
467 primitives/transaction.cpp \
469 script/zcashconsensus.cpp \
470 script/interpreter.cpp \
476 libzcashconsensus_la_SOURCES += compat/glibc_compat.cpp
479 libzcashconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)
480 libzcashconsensus_la_LIBADD = $(CRYPTO_LIBS)
481 libzcashconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BITCOIN_INTERNAL
486 CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno */*.gcno wallet/*/*.gcno
488 DISTCLEANFILES = obj/build.h
493 -$(MAKE) -C leveldb clean
494 -$(MAKE) -C secp256k1 clean
495 rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
500 $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
503 $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
504 $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $<
506 check-symbols: $(bin_PROGRAMS)
508 @echo "Checking glibc back compat of [$(bin_PROGRAMS)]..."
509 $(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(top_srcdir)/contrib/devtools/symbol-check.py < $(bin_PROGRAMS)
512 check-security: $(bin_PROGRAMS)
514 @echo "Checking binary security of [$(bin_PROGRAMS)]..."
515 $(AM_V_at) READELF=$(READELF) OBJDUMP=$(OBJDUMP) $(top_srcdir)/contrib/devtools/security-check.py < $(bin_PROGRAMS)
518 %.pb.cc %.pb.h: %.proto
520 $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
523 include Makefile.test.include
524 include Makefile.gtest.include
528 include Makefile.qt.include
532 include Makefile.qttest.include
535 include Makefile.zcash.include