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