]>
Commit | Line | Data |
---|---|---|
83bef3fc | 1 | DIST_SUBDIRS = secp256k1 univalue |
eb12a14d | 2 | |
c4379e3a JG |
3 | AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) $(SAN_LDFLAGS) $(HARDENED_LDFLAGS) |
4 | AM_CXXFLAGS = $(SAN_CXXFLAGS) $(HARDENED_CXXFLAGS) $(ERROR_CXXFLAGS) | |
c459de2f | 5 | AM_CPPFLAGS = $(HARDENED_CPPFLAGS) |
35b8af92 | 6 | |
6b9f0d55 | 7 | if EMBEDDED_LEVELDB |
56c157d5 CF |
8 | LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include |
9 | LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv | |
10 | LIBLEVELDB += $(builddir)/leveldb/libleveldb.a | |
11 | LIBMEMENV += $(builddir)/leveldb/libmemenv.a | |
6b9f0d55 CF |
12 | |
13 | # 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 | |
14 | $(LIBLEVELDB): $(LIBMEMENV) | |
15 | ||
16 | $(LIBLEVELDB) $(LIBMEMENV): | |
17 | @echo "Building LevelDB ..." && $(MAKE) -C $(@D) $(@F) CXX="$(CXX)" \ | |
18 | CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \ | |
c459de2f | 19 | OPT="$(AM_CXXFLAGS) $(PIE_FLAGS) $(CXXFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -D__STDC_LIMIT_MACROS" |
6b9f0d55 CF |
20 | endif |
21 | ||
54372482 | 22 | BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config |
6b099402 | 23 | BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) |
f4d81129 | 24 | |
55668266 | 25 | BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include |
a55c186a | 26 | BITCOIN_INCLUDES += -I$(srcdir)/snark |
27 | BITCOIN_INCLUDES += -I$(srcdir)/snark/libsnark | |
a10a6e2a | 28 | BITCOIN_INCLUDES += -I$(srcdir)/univalue/include |
55668266 | 29 | |
84ce18ca WL |
30 | LIBBITCOIN_SERVER=libbitcoin_server.a |
31 | LIBBITCOIN_WALLET=libbitcoin_wallet.a | |
32 | LIBBITCOIN_COMMON=libbitcoin_common.a | |
33 | LIBBITCOIN_CLI=libbitcoin_cli.a | |
34 | LIBBITCOIN_UTIL=libbitcoin_util.a | |
35 | LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a | |
07a99017 | 36 | LIBSECP256K1=secp256k1/libsecp256k1.la |
a55c186a | 37 | LIBSNARK=snark/libsnark.a |
1dc62631 | 38 | LIBUNIVALUE=univalue/libunivalue.la |
1785bdb9 | 39 | LIBZCASH=libzcash.a |
07a99017 PW |
40 | |
41 | $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*) | |
4300876c | 42 | $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) |
38ba3c66 | 43 | |
d66bf190 | 44 | LIBSNARK_CXXFLAGS = -fPIC -DBINARY_OUTPUT -DNO_PT_COMPRESSION=1 -fstack-protector-all |
daad2c27 JG |
45 | LIBSNARK_CONFIG_FLAGS = CURVE=ALT_BN128 NO_PROCPS=1 NO_DOCS=1 STATIC=1 NO_SUPERCOP=1 FEATUREFLAGS=-DMONTGOMERY_OUTPUT NO_COPY_DEPINST=1 NO_COMPILE_LIBGTEST=1 |
46 | if HAVE_OPENMP | |
47 | LIBSNARK_CONFIG_FLAGS += MULTICORE=1 | |
48 | endif | |
792c05d8 JG |
49 | if TARGET_DARWIN |
50 | LIBSNARK_CONFIG_FLAGS += PLATFORM=darwin | |
51 | endif | |
82e839e4 | 52 | |
26a8f68e | 53 | $(LIBSNARK): $(wildcard snark/src/*) |
a55c186a | 54 | $(AM_V_at) CXXFLAGS="$(LIBSNARK_CXXFLAGS)" $(MAKE) $(AM_MAKEFLAGS) -C snark/ DEPINST="$(LIBSNARK_DEPINST)" $(LIBSNARK_CONFIG_FLAGS) OPTFLAGS="-O2 -march=x86-64" |
82e839e4 JG |
55 | |
56 | libsnark-tests: $(wildcard snark/src/*) | |
a55c186a | 57 | $(AM_V_at) CXXFLAGS="$(LIBSNARK_CXXFLAGS)" $(MAKE) $(AM_MAKEFLAGS) -C snark/ check DEPINST="$(LIBSNARK_DEPINST)" $(LIBSNARK_CONFIG_FLAGS) OPTFLAGS="-O2 -march=x86-64" |
26a8f68e | 58 | |
da96e3b7 CF |
59 | $(LIBUNIVALUE): $(wildcard univalue/lib/*) $(wildcard univalue/include/*) |
60 | $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) | |
84ce18ca | 61 | |
071473c5 | 62 | # Make is not made aware of per-object dependencies to avoid limiting building parallelization |
63 | # But to build the less dependent modules first, we manually select their order here: | |
fe925e22 | 64 | EXTRA_LIBRARIES = \ |
071473c5 | 65 | crypto/libbitcoin_crypto.a \ |
84ce18ca | 66 | libbitcoin_util.a \ |
071473c5 | 67 | libbitcoin_common.a \ |
071473c5 | 68 | libbitcoin_server.a \ |
e463edc1 | 69 | libbitcoin_cli.a \ |
1785bdb9 | 70 | libzcash.a |
4f9e993b | 71 | if ENABLE_WALLET |
f4d81129 | 72 | BITCOIN_INCLUDES += $(BDB_CPPFLAGS) |
fe925e22 | 73 | EXTRA_LIBRARIES += libbitcoin_wallet.a |
4f9e993b | 74 | endif |
f200002c JG |
75 | if ENABLE_ZMQ |
76 | EXTRA_LIBRARIES += libbitcoin_zmq.a | |
77 | endif | |
99eb947a S |
78 | if ENABLE_PROTON |
79 | EXTRA_LIBRARIES += libbitcoin_proton.a | |
80 | endif | |
35b8af92 | 81 | |
cdd36c6c | 82 | if BUILD_BITCOIN_LIBS |
08d6b02d JG |
83 | lib_LTLIBRARIES = libzcashconsensus.la |
84 | LIBZCASH_CONSENSUS=libzcashconsensus.la | |
cdd36c6c | 85 | else |
08d6b02d | 86 | LIBZCASH_CONSENSUS= |
cdd36c6c | 87 | endif |
2cf5f16c | 88 | |
f930341d | 89 | bin_PROGRAMS = |
8e0fc390 | 90 | noinst_PROGRAMS = |
65e8ba4d | 91 | TESTS = |
f930341d LD |
92 | |
93 | if BUILD_BITCOIND | |
8a183335 | 94 | bin_PROGRAMS += zcashd |
f930341d LD |
95 | endif |
96 | ||
c101c769 | 97 | if BUILD_BITCOIN_UTILS |
66a89c08 | 98 | bin_PROGRAMS += zcash-cli zcash-tx |
f930341d | 99 | endif |
35b8af92 | 100 | |
1785bdb9 | 101 | LIBZCASH_H = \ |
c06664fb | 102 | zcash/IncrementalMerkleTree.hpp \ |
6c36a9fe | 103 | zcash/NoteEncryption.hpp \ |
369df065 SB |
104 | zcash/Address.hpp \ |
105 | zcash/JoinSplit.hpp \ | |
106 | zcash/Note.hpp \ | |
81469bbb | 107 | zcash/prf.h \ |
9ffe371d | 108 | zcash/Proof.hpp \ |
cc552e4d KG |
109 | zcash/util.h \ |
110 | zcash/Zcash.h | |
e463edc1 | 111 | |
99ca5e1a | 112 | .PHONY: FORCE collate-libsnark check-symbols check-security |
35b8af92 | 113 | # bitcoin core # |
5a407bd0 WL |
114 | BITCOIN_CORE_H = \ |
115 | addrman.h \ | |
116 | alert.h \ | |
a372168e | 117 | amount.h \ |
99eb947a S |
118 | amqp/amqpabstractnotifier.h \ |
119 | amqp/amqpconfig.h \ | |
120 | amqp/amqpnotificationinterface.h \ | |
121 | amqp/amqppublishnotifier.h \ | |
122 | amqp/amqpsender.h \ | |
bfc60703 | 123 | arith_uint256.h \ |
fc72c078 S |
124 | asyncrpcoperation.h \ |
125 | asyncrpcqueue.h \ | |
7cd0af7c | 126 | base58.h \ |
10e5357e | 127 | bech32.h \ |
5a407bd0 | 128 | bloom.h \ |
e8b5f0d5 | 129 | chain.h \ |
bfc60703 | 130 | chainparams.h \ |
ff734e90 | 131 | chainparamsbase.h \ |
a60120e9 | 132 | chainparamsseeds.h \ |
5a407bd0 WL |
133 | checkpoints.h \ |
134 | checkqueue.h \ | |
135 | clientversion.h \ | |
136 | coincontrol.h \ | |
137 | coins.h \ | |
138 | compat.h \ | |
ff734e90 JT |
139 | compat/byteswap.h \ |
140 | compat/endian.h \ | |
141 | compat/sanity.h \ | |
561e9e9d | 142 | compressor.h \ |
691161d4 | 143 | consensus/consensus.h \ |
bd006110 | 144 | consensus/params.h \ |
780f526b | 145 | consensus/upgrades.h \ |
da29ecbc | 146 | consensus/validation.h \ |
ae775b5b | 147 | core_io.h \ |
6bd1d60c | 148 | core_memusage.h \ |
5b3bc971 | 149 | deprecation.h \ |
5a407bd0 | 150 | hash.h \ |
afd64f76 WL |
151 | httprpc.h \ |
152 | httpserver.h \ | |
5a407bd0 WL |
153 | init.h \ |
154 | key.h \ | |
155 | keystore.h \ | |
e3da7a57 | 156 | dbwrapper.h \ |
5a407bd0 WL |
157 | limitedmap.h \ |
158 | main.h \ | |
540629c6 | 159 | memusage.h \ |
afd4b94b | 160 | merkleblock.h \ |
a6df7ab5 | 161 | metrics.h \ |
5a407bd0 WL |
162 | miner.h \ |
163 | mruset.h \ | |
5a407bd0 | 164 | net.h \ |
ff734e90 | 165 | netbase.h \ |
5a407bd0 | 166 | noui.h \ |
45232b19 S |
167 | paymentdisclosure.h \ |
168 | paymentdisclosuredb.h \ | |
b649e039 | 169 | policy/fees.h \ |
df852d2b | 170 | pow.h \ |
29a8ade7 | 171 | prevector.h \ |
bfc60703 WL |
172 | primitives/block.h \ |
173 | primitives/transaction.h \ | |
5a407bd0 | 174 | protocol.h \ |
d2e74c55 | 175 | pubkey.h \ |
6354935c | 176 | random.h \ |
6b51b9b1 | 177 | reverselock.h \ |
fb78cc23 WL |
178 | rpcclient.h \ |
179 | rpcprotocol.h \ | |
180 | rpcserver.h \ | |
928b950e | 181 | scheduler.h \ |
611116d4 | 182 | script/interpreter.h \ |
cbd22a50 | 183 | script/script.h \ |
ff734e90 | 184 | script/script_error.h \ |
5c1e798a | 185 | script/sigcache.h \ |
e088d65a | 186 | script/sign.h \ |
c4408a6c | 187 | script/standard.h \ |
5a407bd0 | 188 | serialize.h \ |
fa736190 | 189 | streams.h \ |
d7d187e8 CF |
190 | support/allocators/secure.h \ |
191 | support/allocators/zeroafterfree.h \ | |
1630219d | 192 | support/cleanse.h \ |
17fb6090 | 193 | support/events.h \ |
d7d187e8 | 194 | support/pagelocker.h \ |
5a407bd0 WL |
195 | sync.h \ |
196 | threadsafety.h \ | |
14f888ca | 197 | timedata.h \ |
b77dfdc9 | 198 | tinyformat.h \ |
eb5f63fe | 199 | torcontrol.h \ |
5a407bd0 WL |
200 | txdb.h \ |
201 | txmempool.h \ | |
202 | ui_interface.h \ | |
203 | uint256.h \ | |
defe37a6 | 204 | uint252.h \ |
999a2ab4 | 205 | undo.h \ |
5a407bd0 | 206 | util.h \ |
ad49c256 | 207 | utilmoneystr.h \ |
bfc60703 | 208 | utilstrencodings.h \ |
ad49c256 | 209 | utiltime.h \ |
26c16d9d | 210 | validationinterface.h \ |
5a407bd0 | 211 | version.h \ |
6e9c7629 | 212 | wallet/asyncrpcoperation_mergetoaddress.h \ |
fc72c078 | 213 | wallet/asyncrpcoperation_sendmany.h \ |
06c19063 | 214 | wallet/asyncrpcoperation_shieldcoinbase.h \ |
a354a59f | 215 | wallet/crypter.h \ |
ff734e90 | 216 | wallet/db.h \ |
50c72f23 JS |
217 | wallet/wallet.h \ |
218 | wallet/wallet_ismine.h \ | |
f200002c JG |
219 | wallet/walletdb.h \ |
220 | zmq/zmqabstractnotifier.h \ | |
221 | zmq/zmqconfig.h\ | |
222 | zmq/zmqnotificationinterface.h \ | |
223 | zmq/zmqpublishnotifier.h | |
224 | ||
5a407bd0 | 225 | |
35b8af92 | 226 | obj/build.h: FORCE |
56c157d5 | 227 | @$(MKDIR_P) $(builddir)/obj |
35b8af92 CF |
228 | @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \ |
229 | $(abs_top_srcdir) | |
71697f97 | 230 | libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h |
35b8af92 | 231 | |
38ba3c66 | 232 | # server: zcashd |
c459de2f CF |
233 | libbitcoin_server_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS) |
234 | libbitcoin_server_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) | |
4f9e993b | 235 | libbitcoin_server_a_SOURCES = \ |
b39e1bdb | 236 | sendalert.cpp \ |
4f9e993b WL |
237 | addrman.cpp \ |
238 | alert.cpp \ | |
7553b173 | 239 | alertkeys.h \ |
fc72c078 S |
240 | asyncrpcoperation.cpp \ |
241 | asyncrpcqueue.cpp \ | |
fb78cc23 | 242 | bloom.cpp \ |
e8b5f0d5 | 243 | chain.cpp \ |
4f9e993b | 244 | checkpoints.cpp \ |
5b3bc971 | 245 | deprecation.cpp \ |
afd64f76 WL |
246 | httprpc.cpp \ |
247 | httpserver.cpp \ | |
4f9e993b | 248 | init.cpp \ |
e3da7a57 | 249 | dbwrapper.cpp \ |
4f9e993b | 250 | main.cpp \ |
afd4b94b | 251 | merkleblock.cpp \ |
a6df7ab5 | 252 | metrics.cpp \ |
4a85e067 | 253 | miner.cpp \ |
4f9e993b WL |
254 | net.cpp \ |
255 | noui.cpp \ | |
45232b19 S |
256 | paymentdisclosure.cpp \ |
257 | paymentdisclosuredb.cpp \ | |
b649e039 | 258 | policy/fees.cpp \ |
df852d2b | 259 | pow.cpp \ |
e2655e0a | 260 | rest.cpp \ |
4f9e993b | 261 | rpcblockchain.cpp \ |
4a85e067 | 262 | rpcmining.cpp \ |
652e1569 | 263 | rpcmisc.cpp \ |
4f9e993b WL |
264 | rpcnet.cpp \ |
265 | rpcrawtransaction.cpp \ | |
dfd39962 | 266 | rpcserver.cpp \ |
bfe029fe | 267 | script/sigcache.cpp \ |
14f888ca | 268 | timedata.cpp \ |
eb5f63fe | 269 | torcontrol.cpp \ |
4f9e993b WL |
270 | txdb.cpp \ |
271 | txmempool.cpp \ | |
26c16d9d | 272 | validationinterface.cpp \ |
e463edc1 | 273 | $(BITCOIN_CORE_H) \ |
1785bdb9 | 274 | $(LIBZCASH_H) |
4f9e993b | 275 | |
f200002c JG |
276 | if ENABLE_ZMQ |
277 | LIBBITCOIN_ZMQ=libbitcoin_zmq.a | |
278 | ||
007148fa | 279 | libbitcoin_zmq_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(ZMQ_CFLAGS) |
c459de2f | 280 | libbitcoin_zmq_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) |
f200002c JG |
281 | libbitcoin_zmq_a_SOURCES = \ |
282 | zmq/zmqabstractnotifier.cpp \ | |
283 | zmq/zmqnotificationinterface.cpp \ | |
284 | zmq/zmqpublishnotifier.cpp | |
285 | endif | |
286 | ||
99eb947a S |
287 | if ENABLE_PROTON |
288 | LIBBITCOIN_PROTON=libbitcoin_proton.a | |
289 | ||
290 | libbitcoin_proton_a_CPPFLAGS = $(BITCOIN_INCLUDES) | |
ad96d74a | 291 | libbitcoin_proton_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) |
99eb947a S |
292 | libbitcoin_proton_a_SOURCES = \ |
293 | amqp/amqpabstractnotifier.cpp \ | |
294 | amqp/amqpnotificationinterface.cpp \ | |
295 | amqp/amqppublishnotifier.cpp | |
296 | endif | |
f200002c | 297 | |
38ba3c66 | 298 | # wallet: zcashd, but only linked when wallet enabled |
c459de2f CF |
299 | libbitcoin_wallet_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) |
300 | libbitcoin_wallet_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) | |
4f9e993b | 301 | libbitcoin_wallet_a_SOURCES = \ |
0bb3d40f JG |
302 | utiltest.cpp \ |
303 | utiltest.h \ | |
6962bb3d | 304 | zcbenchmarks.cpp \ |
2f3ecb44 | 305 | zcbenchmarks.h \ |
6e9c7629 | 306 | wallet/asyncrpcoperation_mergetoaddress.cpp \ |
fc72c078 | 307 | wallet/asyncrpcoperation_sendmany.cpp \ |
06c19063 | 308 | wallet/asyncrpcoperation_shieldcoinbase.cpp \ |
a354a59f | 309 | wallet/crypter.cpp \ |
50c72f23 | 310 | wallet/db.cpp \ |
45232b19 S |
311 | paymentdisclosure.cpp \ |
312 | paymentdisclosuredb.cpp \ | |
313 | wallet/rpcdisclosure.cpp \ | |
50c72f23 JS |
314 | wallet/rpcdump.cpp \ |
315 | wallet/rpcwallet.cpp \ | |
316 | wallet/wallet.cpp \ | |
317 | wallet/wallet_ismine.cpp \ | |
318 | wallet/walletdb.cpp \ | |
e463edc1 | 319 | $(BITCOIN_CORE_H) \ |
1785bdb9 | 320 | $(LIBZCASH_H) |
0b47fe6b | 321 | |
84ce18ca | 322 | # crypto primitives library |
c459de2f CF |
323 | crypto_libbitcoin_crypto_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_CONFIG_INCLUDES) |
324 | crypto_libbitcoin_crypto_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) | |
4791b99e | 325 | crypto_libbitcoin_crypto_a_SOURCES = \ |
4791b99e | 326 | crypto/common.h \ |
6d25662f JG |
327 | crypto/equihash.cpp \ |
328 | crypto/equihash.h \ | |
60157808 | 329 | crypto/equihash.tcc \ |
ff734e90 | 330 | crypto/hmac_sha256.cpp \ |
a8f5087e | 331 | crypto/hmac_sha256.h \ |
ff734e90 | 332 | crypto/hmac_sha512.cpp \ |
36fa4a78 | 333 | crypto/hmac_sha512.h \ |
ff734e90 JT |
334 | crypto/ripemd160.cpp \ |
335 | crypto/ripemd160.h \ | |
336 | crypto/sha1.cpp \ | |
4791b99e | 337 | crypto/sha1.h \ |
ff734e90 JT |
338 | crypto/sha256.cpp \ |
339 | crypto/sha256.h \ | |
340 | crypto/sha512.cpp \ | |
2cc0a252 JG |
341 | crypto/sha512.h |
342 | ||
343 | if ENABLE_MINING | |
344 | EQUIHASH_TROMP_SOURCES = \ | |
345 | pow/tromp/equi_miner.h \ | |
346 | pow/tromp/equi.h \ | |
347 | pow/tromp/osx_barrier.h | |
348 | ||
349 | crypto_libbitcoin_crypto_a_CPPFLAGS += \ | |
350 | -DEQUIHASH_TROMP_ATOMIC | |
351 | crypto_libbitcoin_crypto_a_SOURCES += \ | |
c7aaab7a | 352 | ${EQUIHASH_TROMP_SOURCES} |
2cc0a252 | 353 | endif |
4791b99e | 354 | |
38ba3c66 | 355 | # common: shared between zcashd and non-server tools |
c459de2f CF |
356 | libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) |
357 | libbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) | |
0b47fe6b | 358 | libbitcoin_common_a_SOURCES = \ |
eda37330 | 359 | amount.cpp \ |
ff734e90 | 360 | arith_uint256.cpp \ |
75c82d49 | 361 | base58.cpp \ |
10e5357e | 362 | bech32.cpp \ |
0b47fe6b | 363 | chainparams.cpp \ |
75c82d49 | 364 | coins.cpp \ |
561e9e9d | 365 | compressor.cpp \ |
780f526b | 366 | consensus/upgrades.cpp \ |
ae775b5b JG |
367 | core_read.cpp \ |
368 | core_write.cpp \ | |
0b47fe6b WL |
369 | hash.cpp \ |
370 | key.cpp \ | |
75c82d49 | 371 | keystore.cpp \ |
0b47fe6b | 372 | netbase.cpp \ |
ff734e90 JT |
373 | primitives/block.cpp \ |
374 | primitives/transaction.cpp \ | |
0b47fe6b | 375 | protocol.cpp \ |
d2e74c55 | 376 | pubkey.cpp \ |
928b950e | 377 | scheduler.cpp \ |
611116d4 | 378 | script/interpreter.cpp \ |
cbd22a50 | 379 | script/script.cpp \ |
ff734e90 | 380 | script/script_error.cpp \ |
e088d65a | 381 | script/sign.cpp \ |
c4408a6c | 382 | script/standard.cpp \ |
e463edc1 | 383 | $(BITCOIN_CORE_H) \ |
1785bdb9 | 384 | $(LIBZCASH_H) |
84ce18ca WL |
385 | |
386 | # util: shared between all executables. | |
387 | # This library *must* be included to make sure that the glibc | |
388 | # backward-compatibility objects and their sanity checks are linked. | |
c459de2f CF |
389 | libbitcoin_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) |
390 | libbitcoin_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) | |
84ce18ca | 391 | libbitcoin_util_a_SOURCES = \ |
d7d187e8 | 392 | support/pagelocker.cpp \ |
84ce18ca | 393 | chainparamsbase.cpp \ |
71697f97 | 394 | clientversion.cpp \ |
bfc60703 WL |
395 | compat/glibc_sanity.cpp \ |
396 | compat/glibcxx_sanity.cpp \ | |
397 | compat/strnlen.cpp \ | |
6354935c | 398 | random.cpp \ |
84ce18ca | 399 | rpcprotocol.cpp \ |
1630219d | 400 | support/cleanse.cpp \ |
0b47fe6b | 401 | sync.cpp \ |
de79aaa7 | 402 | uint256.cpp \ |
0b47fe6b | 403 | util.cpp \ |
ad49c256 | 404 | utilmoneystr.cpp \ |
bfc60703 | 405 | utilstrencodings.cpp \ |
ad49c256 | 406 | utiltime.cpp \ |
e463edc1 | 407 | $(BITCOIN_CORE_H) \ |
1785bdb9 | 408 | $(LIBZCASH_H) |
35b8af92 | 409 | |
d5aab704 | 410 | if GLIBC_BACK_COMPAT |
84ce18ca | 411 | libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp |
d5aab704 CF |
412 | endif |
413 | ||
38ba3c66 | 414 | # cli: zcash-cli |
c459de2f CF |
415 | libbitcoin_cli_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) |
416 | libbitcoin_cli_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) | |
0b47fe6b WL |
417 | libbitcoin_cli_a_SOURCES = \ |
418 | rpcclient.cpp \ | |
e463edc1 | 419 | $(BITCOIN_CORE_H) \ |
1785bdb9 | 420 | $(LIBZCASH_H) |
0b47fe6b | 421 | |
84ce18ca | 422 | nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h |
35b8af92 CF |
423 | # |
424 | ||
425 | # bitcoind binary # | |
8a183335 | 426 | zcashd_SOURCES = bitcoind.cpp |
c459de2f CF |
427 | zcashd_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) |
428 | zcashd_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) | |
8a183335 | 429 | zcashd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) |
72ac792b | 430 | |
431 | if TARGET_WINDOWS | |
8a183335 | 432 | zcashd_SOURCES += bitcoind-res.rc |
72ac792b | 433 | endif |
434 | ||
8a183335 | 435 | zcashd_LDADD = \ |
84ce18ca WL |
436 | $(LIBBITCOIN_SERVER) \ |
437 | $(LIBBITCOIN_COMMON) \ | |
a10a6e2a | 438 | $(LIBUNIVALUE) \ |
84ce18ca WL |
439 | $(LIBBITCOIN_UTIL) \ |
440 | $(LIBBITCOIN_CRYPTO) \ | |
1785bdb9 | 441 | $(LIBZCASH) \ |
26a8f68e | 442 | $(LIBSNARK) \ |
4a290b52 | 443 | $(LIBLEVELDB) \ |
07a99017 PW |
444 | $(LIBMEMENV) \ |
445 | $(LIBSECP256K1) | |
55668266 | 446 | |
f200002c JG |
447 | if ENABLE_ZMQ |
448 | zcashd_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) | |
449 | endif | |
450 | ||
4f9e993b | 451 | if ENABLE_WALLET |
8a183335 | 452 | zcashd_LDADD += libbitcoin_wallet.a |
4f9e993b | 453 | endif |
72ac792b | 454 | |
c4da0970 NW |
455 | zcashd_LDADD += \ |
456 | $(BOOST_LIBS) \ | |
457 | $(BDB_LIBS) \ | |
458 | $(SSL_LIBS) \ | |
459 | $(CRYPTO_LIBS) \ | |
df377ca8 WL |
460 | $(EVENT_PTHREADS_LIBS) \ |
461 | $(EVENT_LIBS) \ | |
d3612b1c | 462 | $(LIBBITCOIN_CRYPTO) \ |
1785bdb9 | 463 | $(LIBZCASH_LIBS) |
35b8af92 | 464 | |
99eb947a S |
465 | if ENABLE_PROTON |
466 | zcashd_LDADD += $(LIBBITCOIN_PROTON) $(PROTON_LIBS) | |
467 | endif | |
468 | ||
72ac792b | 469 | # bitcoin-cli binary # |
8a183335 | 470 | zcash_cli_SOURCES = bitcoin-cli.cpp |
c459de2f CF |
471 | zcash_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS) |
472 | zcash_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) | |
8a183335 | 473 | zcash_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) |
72ac792b | 474 | |
dee632cc | 475 | if TARGET_WINDOWS |
8a183335 | 476 | zcash_cli_SOURCES += bitcoin-cli-res.rc |
dee632cc CF |
477 | endif |
478 | ||
8a183335 | 479 | zcash_cli_LDADD = \ |
84ce18ca | 480 | $(LIBBITCOIN_CLI) \ |
a10a6e2a | 481 | $(LIBUNIVALUE) \ |
c4da0970 NW |
482 | $(LIBBITCOIN_UTIL) \ |
483 | $(BOOST_LIBS) \ | |
484 | $(SSL_LIBS) \ | |
485 | $(CRYPTO_LIBS) \ | |
df377ca8 | 486 | $(EVENT_LIBS) \ |
1785bdb9 | 487 | $(LIBZCASH) \ |
26a8f68e | 488 | $(LIBSNARK) \ |
d3612b1c | 489 | $(LIBBITCOIN_CRYPTO) \ |
1785bdb9 | 490 | $(LIBZCASH_LIBS) |
2a03a390 WL |
491 | # |
492 | ||
66a89c08 JG |
493 | # zcash-tx binary # |
494 | zcash_tx_SOURCES = bitcoin-tx.cpp | |
c459de2f CF |
495 | zcash_tx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) |
496 | zcash_tx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) | |
66a89c08 | 497 | zcash_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) |
72ac792b | 498 | |
cc24610f | 499 | if TARGET_WINDOWS |
66a89c08 | 500 | zcash_tx_SOURCES += bitcoin-tx-res.rc |
cc24610f LD |
501 | endif |
502 | ||
66a89c08 JG |
503 | # FIXME: Is libzcash needed for zcash_tx? |
504 | zcash_tx_LDADD = \ | |
a10a6e2a | 505 | $(LIBUNIVALUE) \ |
cbe39a38 JG |
506 | $(LIBBITCOIN_COMMON) \ |
507 | $(LIBBITCOIN_UTIL) \ | |
c4da0970 | 508 | $(LIBSECP256K1) \ |
1785bdb9 | 509 | $(LIBZCASH) \ |
26a8f68e | 510 | $(LIBSNARK) \ |
d3612b1c | 511 | $(LIBBITCOIN_CRYPTO) \ |
1785bdb9 | 512 | $(LIBZCASH_LIBS) |
28d412ff | 513 | |
66a89c08 | 514 | zcash_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS) |
cbe39a38 | 515 | # |
2a03a390 | 516 | |
c9c4611d | 517 | # zcash protocol primitives # |
1785bdb9 | 518 | libzcash_a_SOURCES = \ |
e1ff849d | 519 | zcash/IncrementalMerkleTree.cpp \ |
6c36a9fe | 520 | zcash/NoteEncryption.cpp \ |
369df065 SB |
521 | zcash/Address.cpp \ |
522 | zcash/JoinSplit.cpp \ | |
f0dab51c | 523 | zcash/Proof.cpp \ |
369df065 | 524 | zcash/Note.cpp \ |
81469bbb | 525 | zcash/prf.cpp \ |
58d09f27 KG |
526 | zcash/util.cpp \ |
527 | zcash/circuit/commitment.tcc \ | |
528 | zcash/circuit/gadget.tcc \ | |
529 | zcash/circuit/merkle.tcc \ | |
530 | zcash/circuit/note.tcc \ | |
531 | zcash/circuit/prfs.tcc \ | |
532 | zcash/circuit/utils.tcc | |
e463edc1 | 533 | |
7346f090 | 534 | libzcash_a_CPPFLAGS = -fPIC -DBINARY_OUTPUT -DCURVE_ALT_BN128 -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS $(HARDENED_CPPFLAGS) $(HARDENED_CXXFLAGS) $(HARDENED_LDFLAGS) -pipe $(SAN_LDFLAGS) -O1 -g -Wstack-protector $(SAN_CXXFLAGS) -fstack-protector-all -fPIE -fvisibility=hidden -DSTATIC $(BITCOIN_INCLUDES) |
f5d3d420 | 535 | |
c4379e3a | 536 | libzcash_a_CXXFLAGS = $(SAN_CXXFLAGS) $(HARDENED_CXXFLAGS) -fwrapv -fno-strict-aliasing |
f5d3d420 | 537 | |
c4379e3a | 538 | libzcash_a_LDFLAGS = $(SAN_LDFLAGS) $(HARDENED_LDFLAGS) |
e463edc1 | 539 | |
decde386 SB |
540 | libzcash_a_CPPFLAGS += -DMONTGOMERY_OUTPUT |
541 | ||
08d6b02d | 542 | # zcashconsensus library # |
2cf5f16c | 543 | if BUILD_BITCOIN_LIBS |
08d6b02d JG |
544 | include_HEADERS = script/zcashconsensus.h |
545 | libzcashconsensus_la_SOURCES = \ | |
6d25662f | 546 | crypto/equihash.cpp \ |
36fa4a78 | 547 | crypto/hmac_sha512.cpp \ |
bfc60703 | 548 | crypto/ripemd160.cpp \ |
2cf5f16c | 549 | crypto/sha1.cpp \ |
36fa4a78 PW |
550 | crypto/sha256.cpp \ |
551 | crypto/sha512.cpp \ | |
2cf5f16c | 552 | hash.cpp \ |
bfc60703 | 553 | primitives/transaction.cpp \ |
2cf5f16c | 554 | pubkey.cpp \ |
08d6b02d | 555 | script/zcashconsensus.cpp \ |
bfc60703 WL |
556 | script/interpreter.cpp \ |
557 | script/script.cpp \ | |
2cf5f16c CF |
558 | uint256.cpp \ |
559 | utilstrencodings.cpp | |
560 | ||
561 | if GLIBC_BACK_COMPAT | |
08d6b02d | 562 | libzcashconsensus_la_SOURCES += compat/glibc_compat.cpp |
2cf5f16c CF |
563 | endif |
564 | ||
c459de2f | 565 | libzcashconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS) |
3d02d0f6 | 566 | libzcashconsensus_la_LIBADD = $(LIBSECP256K1) |
c459de2f CF |
567 | libzcashconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL |
568 | libzcashconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) | |
72ac792b | 569 | |
cdd36c6c | 570 | endif |
72ac792b | 571 | # |
2cf5f16c | 572 | |
9773b95f | 573 | CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno */*.gcno wallet/*/*.gcno |
35b8af92 CF |
574 | |
575 | DISTCLEANFILES = obj/build.h | |
576 | ||
83bef3fc | 577 | EXTRA_DIST = leveldb snark |
35b8af92 CF |
578 | |
579 | clean-local: | |
580 | -$(MAKE) -C leveldb clean | |
4300876c | 581 | -$(MAKE) -C secp256k1 clean |
e2283742 | 582 | -$(MAKE) -C snark clean |
da96e3b7 | 583 | -$(MAKE) -C univalue clean |
26d1b65c | 584 | rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno |
54372482 | 585 | -rm -f config.h |
65e8ba4d | 586 | |
6b9f0d55 | 587 | .rc.o: |
70c71c50 | 588 | @test -f $(WINDRES) |
71697f97 | 589 | $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@ |
6b9f0d55 CF |
590 | |
591 | .mm.o: | |
70c71c50 | 592 | $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
c459de2f | 593 | $(CPPFLAGS) $(AM_CXXFLAGS) $(AM_CXXFLAGS) $(PIE_FLAGS) $(CXXFLAGS) -c -o $@ $< |
6b9f0d55 | 594 | |
a5e918a0 CF |
595 | check-symbols: $(bin_PROGRAMS) |
596 | if GLIBC_BACK_COMPAT | |
597 | @echo "Checking glibc back compat of [$(bin_PROGRAMS)]..." | |
2d342736 | 598 | $(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(top_srcdir)/contrib/devtools/symbol-check.py $(bin_PROGRAMS) |
a5e918a0 CF |
599 | endif |
600 | ||
56734f4b TH |
601 | check-security: $(bin_PROGRAMS) |
602 | if HARDEN | |
603 | @echo "Checking binary security of [$(bin_PROGRAMS)]..." | |
2d342736 | 604 | $(AM_V_at) READELF=$(READELF) OBJDUMP=$(OBJDUMP) $(top_srcdir)/contrib/devtools/security-check.py $(bin_PROGRAMS) |
56734f4b TH |
605 | endif |
606 | ||
6b9f0d55 | 607 | %.pb.cc %.pb.h: %.proto |
70c71c50 CF |
608 | @test -f $(PROTOC) |
609 | $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<) | |
6b9f0d55 | 610 | |
65e8ba4d CF |
611 | if ENABLE_TESTS |
612 | include Makefile.test.include | |
6bd8e469 | 613 | include Makefile.gtest.include |
65e8ba4d CF |
614 | endif |
615 | ||
6e96cf08 | 616 | include Makefile.zcash.include |