Add zerocash-specific tests.
[VerusCoin.git] / src / Makefile.am
CommitLineData
4300876c 1DIST_SUBDIRS = secp256k1
575e70c0 2AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
eb12a14d 3
35b8af92 4
6b9f0d55 5if EMBEDDED_LEVELDB
56c157d5
CF
6LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include
7LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv
8LIBLEVELDB += $(builddir)/leveldb/libleveldb.a
9LIBMEMENV += $(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
18endif
19
54372482 20BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
6b099402 21BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
f4d81129 22
55668266 23BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
55668266 24
84ce18ca
WL
25LIBBITCOIN_SERVER=libbitcoin_server.a
26LIBBITCOIN_WALLET=libbitcoin_wallet.a
27LIBBITCOIN_COMMON=libbitcoin_common.a
28LIBBITCOIN_CLI=libbitcoin_cli.a
29LIBBITCOIN_UTIL=libbitcoin_util.a
30LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
cbe39a38 31LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a
84ce18ca 32LIBBITCOINQT=qt/libbitcoinqt.a
07a99017
PW
33LIBSECP256K1=secp256k1/libsecp256k1.la
34
35$(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
4300876c 36 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
84ce18ca 37
071473c5 38# Make is not made aware of per-object dependencies to avoid limiting building parallelization
39# But to build the less dependent modules first, we manually select their order here:
fe925e22 40EXTRA_LIBRARIES = \
071473c5 41 crypto/libbitcoin_crypto.a \
84ce18ca 42 libbitcoin_util.a \
071473c5 43 libbitcoin_common.a \
cbe39a38 44 univalue/libbitcoin_univalue.a \
071473c5 45 libbitcoin_server.a \
46 libbitcoin_cli.a
4f9e993b 47if ENABLE_WALLET
f4d81129 48BITCOIN_INCLUDES += $(BDB_CPPFLAGS)
fe925e22 49EXTRA_LIBRARIES += libbitcoin_wallet.a
4f9e993b 50endif
35b8af92 51
cdd36c6c 52if BUILD_BITCOIN_LIBS
2cf5f16c 53lib_LTLIBRARIES = libbitcoinconsensus.la
cdd36c6c
CF
54LIBBITCOIN_CONSENSUS=libbitcoinconsensus.la
55else
56LIBBITCOIN_CONSENSUS=
57endif
2cf5f16c 58
f930341d 59bin_PROGRAMS =
65e8ba4d 60TESTS =
f930341d
LD
61
62if BUILD_BITCOIND
63 bin_PROGRAMS += bitcoind
64endif
65
c101c769 66if BUILD_BITCOIN_UTILS
67 bin_PROGRAMS += bitcoin-cli bitcoin-tx
f930341d 68endif
35b8af92 69
35b8af92
CF
70.PHONY: FORCE
71# bitcoin core #
5a407bd0
WL
72BITCOIN_CORE_H = \
73 addrman.h \
74 alert.h \
a372168e 75 amount.h \
bfc60703 76 arith_uint256.h \
7cd0af7c 77 base58.h \
5a407bd0 78 bloom.h \
e8b5f0d5 79 chain.h \
bfc60703 80 chainparams.h \
ff734e90 81 chainparamsbase.h \
a60120e9 82 chainparamsseeds.h \
5a407bd0
WL
83 checkpoints.h \
84 checkqueue.h \
85 clientversion.h \
86 coincontrol.h \
87 coins.h \
88 compat.h \
ff734e90
JT
89 compat/byteswap.h \
90 compat/endian.h \
91 compat/sanity.h \
561e9e9d 92 compressor.h \
691161d4 93 consensus/consensus.h \
bd006110 94 consensus/params.h \
da29ecbc 95 consensus/validation.h \
ae775b5b 96 core_io.h \
900078ae 97 eccryptoverify.h \
50f71cd5 98 ecwrapper.h \
5a407bd0
WL
99 hash.h \
100 init.h \
101 key.h \
102 keystore.h \
103 leveldbwrapper.h \
104 limitedmap.h \
105 main.h \
540629c6 106 memusage.h \
afd4b94b 107 merkleblock.h \
5a407bd0
WL
108 miner.h \
109 mruset.h \
5a407bd0 110 net.h \
ff734e90 111 netbase.h \
5a407bd0 112 noui.h \
b649e039 113 policy/fees.h \
df852d2b 114 pow.h \
bfc60703
WL
115 primitives/block.h \
116 primitives/transaction.h \
5a407bd0 117 protocol.h \
d2e74c55 118 pubkey.h \
6354935c 119 random.h \
6b51b9b1 120 reverselock.h \
fb78cc23
WL
121 rpcclient.h \
122 rpcprotocol.h \
123 rpcserver.h \
928b950e 124 scheduler.h \
611116d4 125 script/interpreter.h \
cbd22a50 126 script/script.h \
ff734e90 127 script/script_error.h \
5c1e798a 128 script/sigcache.h \
e088d65a 129 script/sign.h \
c4408a6c 130 script/standard.h \
5a407bd0 131 serialize.h \
fa736190 132 streams.h \
d7d187e8
CF
133 support/allocators/secure.h \
134 support/allocators/zeroafterfree.h \
1630219d 135 support/cleanse.h \
d7d187e8 136 support/pagelocker.h \
5a407bd0
WL
137 sync.h \
138 threadsafety.h \
14f888ca 139 timedata.h \
b77dfdc9 140 tinyformat.h \
5a407bd0
WL
141 txdb.h \
142 txmempool.h \
143 ui_interface.h \
144 uint256.h \
999a2ab4 145 undo.h \
5a407bd0 146 util.h \
ad49c256 147 utilmoneystr.h \
bfc60703 148 utilstrencodings.h \
ad49c256 149 utiltime.h \
26c16d9d 150 validationinterface.h \
5a407bd0 151 version.h \
a354a59f 152 wallet/crypter.h \
ff734e90 153 wallet/db.h \
50c72f23
JS
154 wallet/wallet.h \
155 wallet/wallet_ismine.h \
ff734e90 156 wallet/walletdb.h
5a407bd0
WL
157
158JSON_H = \
159 json/json_spirit.h \
160 json/json_spirit_error_position.h \
161 json/json_spirit_reader.h \
162 json/json_spirit_reader_template.h \
163 json/json_spirit_stream_reader.h \
164 json/json_spirit_utils.h \
165 json/json_spirit_value.h \
166 json/json_spirit_writer.h \
35b8af92
CF
167 json/json_spirit_writer_template.h
168
169obj/build.h: FORCE
56c157d5 170 @$(MKDIR_P) $(builddir)/obj
35b8af92
CF
171 @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
172 $(abs_top_srcdir)
71697f97 173libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
35b8af92 174
84ce18ca 175# server: shared between bitcoind and bitcoin-qt
9f7f504e 176libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
4f9e993b
WL
177libbitcoin_server_a_SOURCES = \
178 addrman.cpp \
179 alert.cpp \
fb78cc23 180 bloom.cpp \
e8b5f0d5 181 chain.cpp \
4f9e993b 182 checkpoints.cpp \
4f9e993b 183 init.cpp \
4f9e993b
WL
184 leveldbwrapper.cpp \
185 main.cpp \
afd4b94b 186 merkleblock.cpp \
4a85e067 187 miner.cpp \
4f9e993b
WL
188 net.cpp \
189 noui.cpp \
b649e039 190 policy/fees.cpp \
df852d2b 191 pow.cpp \
e2655e0a 192 rest.cpp \
4f9e993b 193 rpcblockchain.cpp \
4a85e067 194 rpcmining.cpp \
652e1569 195 rpcmisc.cpp \
4f9e993b
WL
196 rpcnet.cpp \
197 rpcrawtransaction.cpp \
dfd39962 198 rpcserver.cpp \
bfe029fe 199 script/sigcache.cpp \
14f888ca 200 timedata.cpp \
4f9e993b
WL
201 txdb.cpp \
202 txmempool.cpp \
26c16d9d 203 validationinterface.cpp \
4f9e993b
WL
204 $(JSON_H) \
205 $(BITCOIN_CORE_H)
206
84ce18ca
WL
207# wallet: shared between bitcoind and bitcoin-qt, but only linked
208# when wallet enabled
f4d81129 209libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
4f9e993b 210libbitcoin_wallet_a_SOURCES = \
a354a59f 211 wallet/crypter.cpp \
50c72f23 212 wallet/db.cpp \
50c72f23
JS
213 wallet/rpcdump.cpp \
214 wallet/rpcwallet.cpp \
215 wallet/wallet.cpp \
216 wallet/wallet_ismine.cpp \
217 wallet/walletdb.cpp \
0b47fe6b
WL
218 $(BITCOIN_CORE_H)
219
84ce18ca 220# crypto primitives library
4791b99e
CF
221crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES)
222crypto_libbitcoin_crypto_a_SOURCES = \
4791b99e 223 crypto/common.h \
ff734e90 224 crypto/hmac_sha256.cpp \
a8f5087e 225 crypto/hmac_sha256.h \
ff734e90 226 crypto/hmac_sha512.cpp \
36fa4a78 227 crypto/hmac_sha512.h \
ff734e90
JT
228 crypto/ripemd160.cpp \
229 crypto/ripemd160.h \
230 crypto/sha1.cpp \
4791b99e 231 crypto/sha1.h \
ff734e90
JT
232 crypto/sha256.cpp \
233 crypto/sha256.h \
234 crypto/sha512.cpp \
235 crypto/sha512.h
4791b99e 236
cbe39a38
JG
237# univalue JSON library
238univalue_libbitcoin_univalue_a_SOURCES = \
239 univalue/univalue.cpp \
ff734e90 240 univalue/univalue.h \
3cceba7a 241 univalue/univalue_escapes.h \
ff734e90
JT
242 univalue/univalue_read.cpp \
243 univalue/univalue_write.cpp
cbe39a38 244
84ce18ca 245# common: shared between bitcoind, and bitcoin-qt and non-server tools
f4d81129 246libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
0b47fe6b 247libbitcoin_common_a_SOURCES = \
eda37330 248 amount.cpp \
ff734e90 249 arith_uint256.cpp \
75c82d49 250 base58.cpp \
0b47fe6b 251 chainparams.cpp \
75c82d49 252 coins.cpp \
561e9e9d 253 compressor.cpp \
ae775b5b
JG
254 core_read.cpp \
255 core_write.cpp \
900078ae 256 eccryptoverify.cpp \
50f71cd5 257 ecwrapper.cpp \
0b47fe6b
WL
258 hash.cpp \
259 key.cpp \
75c82d49 260 keystore.cpp \
0b47fe6b 261 netbase.cpp \
ff734e90
JT
262 primitives/block.cpp \
263 primitives/transaction.cpp \
0b47fe6b 264 protocol.cpp \
d2e74c55 265 pubkey.cpp \
928b950e 266 scheduler.cpp \
611116d4 267 script/interpreter.cpp \
cbd22a50 268 script/script.cpp \
ff734e90 269 script/script_error.cpp \
e088d65a 270 script/sign.cpp \
c4408a6c 271 script/standard.cpp \
84ce18ca
WL
272 $(BITCOIN_CORE_H)
273
274# util: shared between all executables.
275# This library *must* be included to make sure that the glibc
276# backward-compatibility objects and their sanity checks are linked.
277libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
278libbitcoin_util_a_SOURCES = \
d7d187e8 279 support/pagelocker.cpp \
84ce18ca 280 chainparamsbase.cpp \
71697f97 281 clientversion.cpp \
bfc60703
WL
282 compat/glibc_sanity.cpp \
283 compat/glibcxx_sanity.cpp \
284 compat/strnlen.cpp \
6354935c 285 random.cpp \
84ce18ca 286 rpcprotocol.cpp \
1630219d 287 support/cleanse.cpp \
0b47fe6b 288 sync.cpp \
de79aaa7 289 uint256.cpp \
0b47fe6b 290 util.cpp \
ad49c256 291 utilmoneystr.cpp \
bfc60703 292 utilstrencodings.cpp \
ad49c256 293 utiltime.cpp \
35b8af92
CF
294 $(BITCOIN_CORE_H)
295
d5aab704 296if GLIBC_BACK_COMPAT
84ce18ca 297libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
d5aab704
CF
298endif
299
84ce18ca 300# cli: shared between bitcoin-cli and bitcoin-qt
a65668dd 301libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
0b47fe6b
WL
302libbitcoin_cli_a_SOURCES = \
303 rpcclient.cpp \
304 $(BITCOIN_CORE_H)
305
84ce18ca 306nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
35b8af92
CF
307#
308
309# bitcoind binary #
72ac792b 310bitcoind_SOURCES = bitcoind.cpp
311bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES)
312bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
313
314if TARGET_WINDOWS
315bitcoind_SOURCES += bitcoind-res.rc
316endif
317
5a407bd0 318bitcoind_LDADD = \
84ce18ca
WL
319 $(LIBBITCOIN_SERVER) \
320 $(LIBBITCOIN_COMMON) \
cbe39a38 321 $(LIBBITCOIN_UNIVALUE) \
84ce18ca
WL
322 $(LIBBITCOIN_UTIL) \
323 $(LIBBITCOIN_CRYPTO) \
4a290b52 324 $(LIBLEVELDB) \
07a99017
PW
325 $(LIBMEMENV) \
326 $(LIBSECP256K1)
55668266 327
4f9e993b
WL
328if ENABLE_WALLET
329bitcoind_LDADD += libbitcoin_wallet.a
330endif
72ac792b 331
332bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
35b8af92
CF
333#
334
72ac792b 335# bitcoin-cli binary #
336bitcoin_cli_SOURCES = bitcoin-cli.cpp
337bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
338bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
339
dee632cc 340if TARGET_WINDOWS
72ac792b 341bitcoin_cli_SOURCES += bitcoin-cli-res.rc
dee632cc
CF
342endif
343
5a407bd0 344bitcoin_cli_LDADD = \
84ce18ca 345 $(LIBBITCOIN_CLI) \
87a797a0 346 $(LIBBITCOIN_UTIL)
55668266 347
72ac792b 348bitcoin_cli_LDADD += $(BOOST_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
2a03a390
WL
349#
350
cbe39a38 351# bitcoin-tx binary #
72ac792b 352bitcoin_tx_SOURCES = bitcoin-tx.cpp
353bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
354bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
355
cc24610f
LD
356if TARGET_WINDOWS
357bitcoin_tx_SOURCES += bitcoin-tx-res.rc
358endif
359
cbe39a38
JG
360bitcoin_tx_LDADD = \
361 $(LIBBITCOIN_UNIVALUE) \
362 $(LIBBITCOIN_COMMON) \
363 $(LIBBITCOIN_UTIL) \
07a99017 364 $(LIBBITCOIN_CRYPTO) \
72ac792b 365 $(LIBSECP256K1)
28d412ff 366
72ac792b 367bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
cbe39a38 368#
2a03a390 369
72ac792b 370# bitcoinconsensus library #
2cf5f16c
CF
371if BUILD_BITCOIN_LIBS
372include_HEADERS = script/bitcoinconsensus.h
373libbitcoinconsensus_la_SOURCES = \
36fa4a78 374 crypto/hmac_sha512.cpp \
bfc60703 375 crypto/ripemd160.cpp \
2cf5f16c 376 crypto/sha1.cpp \
36fa4a78
PW
377 crypto/sha256.cpp \
378 crypto/sha512.cpp \
2cf5f16c
CF
379 eccryptoverify.cpp \
380 ecwrapper.cpp \
381 hash.cpp \
bfc60703 382 primitives/transaction.cpp \
2cf5f16c 383 pubkey.cpp \
2cf5f16c 384 script/bitcoinconsensus.cpp \
bfc60703
WL
385 script/interpreter.cpp \
386 script/script.cpp \
2cf5f16c
CF
387 uint256.cpp \
388 utilstrencodings.cpp
389
390if GLIBC_BACK_COMPAT
391 libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
2cf5f16c
CF
392endif
393
394libbitcoinconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)
395libbitcoinconsensus_la_LIBADD = $(CRYPTO_LIBS)
396libbitcoinconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BITCOIN_INTERNAL
72ac792b 397
cdd36c6c 398endif
72ac792b 399#
2cf5f16c 400
35b8af92
CF
401CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno
402
403DISTCLEANFILES = obj/build.h
404
4300876c 405EXTRA_DIST = leveldb
35b8af92
CF
406
407clean-local:
408 -$(MAKE) -C leveldb clean
4300876c 409 -$(MAKE) -C secp256k1 clean
26d1b65c 410 rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
54372482 411 -rm -f config.h
65e8ba4d 412
6b9f0d55 413.rc.o:
70c71c50 414 @test -f $(WINDRES)
71697f97 415 $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
6b9f0d55
CF
416
417.mm.o:
70c71c50 418 $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
6b9f0d55
CF
419 $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $<
420
421%.pb.cc %.pb.h: %.proto
70c71c50
CF
422 @test -f $(PROTOC)
423 $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
6b9f0d55 424
65e8ba4d
CF
425if ENABLE_TESTS
426include Makefile.test.include
427endif
428
429if ENABLE_QT
430include Makefile.qt.include
431endif
432
433if ENABLE_QT_TESTS
434include Makefile.qttest.include
435endif
This page took 0.173717 seconds and 4 git commands to generate.