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