Merge pull request #5890
[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) \
17 OPT="$(CXXFLAGS) $(CPPFLAGS)"
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 \
84ce18ca 80 chainparamsbase.h \
bfc60703 81 chainparams.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 \
561e9e9d 89 compressor.h \
ae775b5b 90 core_io.h \
50c72f23 91 wallet/db.h \
900078ae 92 eccryptoverify.h \
50f71cd5 93 ecwrapper.h \
5a407bd0
WL
94 hash.h \
95 init.h \
96 key.h \
97 keystore.h \
98 leveldbwrapper.h \
99 limitedmap.h \
100 main.h \
afd4b94b 101 merkleblock.h \
5a407bd0
WL
102 miner.h \
103 mruset.h \
104 netbase.h \
105 net.h \
106 noui.h \
df852d2b 107 pow.h \
bfc60703
WL
108 primitives/block.h \
109 primitives/transaction.h \
5a407bd0 110 protocol.h \
d2e74c55 111 pubkey.h \
6354935c 112 random.h \
fb78cc23
WL
113 rpcclient.h \
114 rpcprotocol.h \
115 rpcserver.h \
611116d4 116 script/interpreter.h \
bfc60703 117 script/script_error.h \
cbd22a50 118 script/script.h \
5c1e798a 119 script/sigcache.h \
e088d65a 120 script/sign.h \
c4408a6c 121 script/standard.h \
5a407bd0 122 serialize.h \
fa736190 123 streams.h \
d7d187e8
CF
124 support/allocators/secure.h \
125 support/allocators/zeroafterfree.h \
1630219d 126 support/cleanse.h \
d7d187e8 127 support/pagelocker.h \
5a407bd0
WL
128 sync.h \
129 threadsafety.h \
14f888ca 130 timedata.h \
b77dfdc9 131 tinyformat.h \
5a407bd0
WL
132 txdb.h \
133 txmempool.h \
134 ui_interface.h \
135 uint256.h \
999a2ab4 136 undo.h \
5a407bd0 137 util.h \
ad49c256 138 utilmoneystr.h \
bfc60703 139 utilstrencodings.h \
ad49c256 140 utiltime.h \
5a407bd0 141 version.h \
a354a59f 142 wallet/crypter.h \
50c72f23
JS
143 wallet/walletdb.h \
144 wallet/wallet.h \
145 wallet/wallet_ismine.h \
4414f5ff
WL
146 compat/byteswap.h \
147 compat/endian.h \
679240d0 148 compat/sanity.h
5a407bd0
WL
149
150JSON_H = \
151 json/json_spirit.h \
152 json/json_spirit_error_position.h \
153 json/json_spirit_reader.h \
154 json/json_spirit_reader_template.h \
155 json/json_spirit_stream_reader.h \
156 json/json_spirit_utils.h \
157 json/json_spirit_value.h \
158 json/json_spirit_writer.h \
35b8af92
CF
159 json/json_spirit_writer_template.h
160
161obj/build.h: FORCE
56c157d5 162 @$(MKDIR_P) $(builddir)/obj
35b8af92
CF
163 @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
164 $(abs_top_srcdir)
71697f97 165libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
35b8af92 166
84ce18ca 167# server: shared between bitcoind and bitcoin-qt
9f7f504e 168libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
4f9e993b
WL
169libbitcoin_server_a_SOURCES = \
170 addrman.cpp \
171 alert.cpp \
fb78cc23 172 bloom.cpp \
e8b5f0d5 173 chain.cpp \
4f9e993b 174 checkpoints.cpp \
4f9e993b 175 init.cpp \
4f9e993b
WL
176 leveldbwrapper.cpp \
177 main.cpp \
afd4b94b 178 merkleblock.cpp \
4a85e067 179 miner.cpp \
4f9e993b
WL
180 net.cpp \
181 noui.cpp \
df852d2b 182 pow.cpp \
e2655e0a 183 rest.cpp \
4f9e993b 184 rpcblockchain.cpp \
4a85e067 185 rpcmining.cpp \
652e1569 186 rpcmisc.cpp \
4f9e993b
WL
187 rpcnet.cpp \
188 rpcrawtransaction.cpp \
dfd39962 189 rpcserver.cpp \
bfe029fe 190 script/sigcache.cpp \
14f888ca 191 timedata.cpp \
4f9e993b
WL
192 txdb.cpp \
193 txmempool.cpp \
194 $(JSON_H) \
195 $(BITCOIN_CORE_H)
196
84ce18ca
WL
197# wallet: shared between bitcoind and bitcoin-qt, but only linked
198# when wallet enabled
f4d81129 199libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
4f9e993b 200libbitcoin_wallet_a_SOURCES = \
a354a59f 201 wallet/crypter.cpp \
50c72f23 202 wallet/db.cpp \
50c72f23
JS
203 wallet/rpcdump.cpp \
204 wallet/rpcwallet.cpp \
205 wallet/wallet.cpp \
206 wallet/wallet_ismine.cpp \
207 wallet/walletdb.cpp \
0b47fe6b
WL
208 $(BITCOIN_CORE_H)
209
84ce18ca 210# crypto primitives library
4791b99e
CF
211crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES)
212crypto_libbitcoin_crypto_a_SOURCES = \
213 crypto/sha1.cpp \
36fa4a78
PW
214 crypto/sha256.cpp \
215 crypto/sha512.cpp \
a8f5087e 216 crypto/hmac_sha256.cpp \
36fa4a78 217 crypto/hmac_sha512.cpp \
4791b99e
CF
218 crypto/ripemd160.cpp \
219 crypto/common.h \
36fa4a78
PW
220 crypto/sha256.h \
221 crypto/sha512.h \
a8f5087e 222 crypto/hmac_sha256.h \
36fa4a78 223 crypto/hmac_sha512.h \
4791b99e
CF
224 crypto/sha1.h \
225 crypto/ripemd160.h
226
cbe39a38
JG
227# univalue JSON library
228univalue_libbitcoin_univalue_a_SOURCES = \
229 univalue/univalue.cpp \
230 univalue/univalue_read.cpp \
231 univalue/univalue_write.cpp \
3cceba7a 232 univalue/univalue_escapes.h \
cbe39a38
JG
233 univalue/univalue.h
234
84ce18ca 235# common: shared between bitcoind, and bitcoin-qt and non-server tools
f4d81129 236libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
0b47fe6b 237libbitcoin_common_a_SOURCES = \
7268f7b1 238 arith_uint256.cpp \
eda37330 239 amount.cpp \
75c82d49 240 base58.cpp \
0b47fe6b 241 chainparams.cpp \
75c82d49 242 coins.cpp \
561e9e9d 243 compressor.cpp \
d2270111
LD
244 primitives/block.cpp \
245 primitives/transaction.cpp \
ae775b5b
JG
246 core_read.cpp \
247 core_write.cpp \
900078ae 248 eccryptoverify.cpp \
50f71cd5 249 ecwrapper.cpp \
0b47fe6b
WL
250 hash.cpp \
251 key.cpp \
75c82d49 252 keystore.cpp \
0b47fe6b
WL
253 netbase.cpp \
254 protocol.cpp \
d2e74c55 255 pubkey.cpp \
611116d4 256 script/interpreter.cpp \
cbd22a50 257 script/script.cpp \
e088d65a 258 script/sign.cpp \
c4408a6c 259 script/standard.cpp \
ab9edbd6 260 script/script_error.cpp \
84ce18ca
WL
261 $(BITCOIN_CORE_H)
262
263# util: shared between all executables.
264# This library *must* be included to make sure that the glibc
265# backward-compatibility objects and their sanity checks are linked.
266libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
267libbitcoin_util_a_SOURCES = \
d7d187e8 268 support/pagelocker.cpp \
84ce18ca 269 chainparamsbase.cpp \
71697f97 270 clientversion.cpp \
bfc60703
WL
271 compat/glibc_sanity.cpp \
272 compat/glibcxx_sanity.cpp \
273 compat/strnlen.cpp \
6354935c 274 random.cpp \
84ce18ca 275 rpcprotocol.cpp \
1630219d 276 support/cleanse.cpp \
0b47fe6b 277 sync.cpp \
de79aaa7 278 uint256.cpp \
0b47fe6b 279 util.cpp \
ad49c256 280 utilmoneystr.cpp \
bfc60703 281 utilstrencodings.cpp \
ad49c256 282 utiltime.cpp \
35b8af92
CF
283 $(BITCOIN_CORE_H)
284
d5aab704 285if GLIBC_BACK_COMPAT
84ce18ca 286libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
d5aab704
CF
287endif
288
84ce18ca 289# cli: shared between bitcoin-cli and bitcoin-qt
a65668dd 290libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
0b47fe6b
WL
291libbitcoin_cli_a_SOURCES = \
292 rpcclient.cpp \
293 $(BITCOIN_CORE_H)
294
84ce18ca 295nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
35b8af92
CF
296#
297
298# bitcoind binary #
72ac792b 299bitcoind_SOURCES = bitcoind.cpp
300bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES)
301bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
302
303if TARGET_WINDOWS
304bitcoind_SOURCES += bitcoind-res.rc
305endif
306
5a407bd0 307bitcoind_LDADD = \
84ce18ca
WL
308 $(LIBBITCOIN_SERVER) \
309 $(LIBBITCOIN_COMMON) \
cbe39a38 310 $(LIBBITCOIN_UNIVALUE) \
84ce18ca
WL
311 $(LIBBITCOIN_UTIL) \
312 $(LIBBITCOIN_CRYPTO) \
4a290b52 313 $(LIBLEVELDB) \
07a99017
PW
314 $(LIBMEMENV) \
315 $(LIBSECP256K1)
55668266 316
4f9e993b
WL
317if ENABLE_WALLET
318bitcoind_LDADD += libbitcoin_wallet.a
319endif
72ac792b 320
321bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
35b8af92
CF
322#
323
72ac792b 324# bitcoin-cli binary #
325bitcoin_cli_SOURCES = bitcoin-cli.cpp
326bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
327bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
328
dee632cc 329if TARGET_WINDOWS
72ac792b 330bitcoin_cli_SOURCES += bitcoin-cli-res.rc
dee632cc
CF
331endif
332
5a407bd0 333bitcoin_cli_LDADD = \
84ce18ca 334 $(LIBBITCOIN_CLI) \
84ce18ca 335 $(LIBBITCOIN_UTIL) \
72ac792b 336 $(LIBSECP256K1)
55668266 337
72ac792b 338bitcoin_cli_LDADD += $(BOOST_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
2a03a390
WL
339#
340
cbe39a38 341# bitcoin-tx binary #
72ac792b 342bitcoin_tx_SOURCES = bitcoin-tx.cpp
343bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
344bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
345
cbe39a38
JG
346bitcoin_tx_LDADD = \
347 $(LIBBITCOIN_UNIVALUE) \
348 $(LIBBITCOIN_COMMON) \
349 $(LIBBITCOIN_UTIL) \
07a99017 350 $(LIBBITCOIN_CRYPTO) \
72ac792b 351 $(LIBSECP256K1)
28d412ff 352
72ac792b 353bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
cbe39a38 354#
2a03a390 355
72ac792b 356# bitcoinconsensus library #
2cf5f16c
CF
357if BUILD_BITCOIN_LIBS
358include_HEADERS = script/bitcoinconsensus.h
359libbitcoinconsensus_la_SOURCES = \
36fa4a78 360 crypto/hmac_sha512.cpp \
bfc60703 361 crypto/ripemd160.cpp \
2cf5f16c 362 crypto/sha1.cpp \
36fa4a78
PW
363 crypto/sha256.cpp \
364 crypto/sha512.cpp \
2cf5f16c
CF
365 eccryptoverify.cpp \
366 ecwrapper.cpp \
367 hash.cpp \
bfc60703 368 primitives/transaction.cpp \
2cf5f16c 369 pubkey.cpp \
2cf5f16c 370 script/bitcoinconsensus.cpp \
bfc60703
WL
371 script/interpreter.cpp \
372 script/script.cpp \
2cf5f16c
CF
373 uint256.cpp \
374 utilstrencodings.cpp
375
376if GLIBC_BACK_COMPAT
377 libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
2cf5f16c
CF
378endif
379
380libbitcoinconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)
381libbitcoinconsensus_la_LIBADD = $(CRYPTO_LIBS)
382libbitcoinconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BITCOIN_INTERNAL
72ac792b 383
cdd36c6c 384endif
72ac792b 385#
2cf5f16c 386
35b8af92
CF
387CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno
388
389DISTCLEANFILES = obj/build.h
390
4300876c 391EXTRA_DIST = leveldb
35b8af92
CF
392
393clean-local:
394 -$(MAKE) -C leveldb clean
4300876c 395 -$(MAKE) -C secp256k1 clean
26d1b65c 396 rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
54372482 397 -rm -f config.h
65e8ba4d 398
6b9f0d55 399.rc.o:
70c71c50 400 @test -f $(WINDRES)
71697f97 401 $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
6b9f0d55
CF
402
403.mm.o:
70c71c50 404 $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
6b9f0d55
CF
405 $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $<
406
407%.pb.cc %.pb.h: %.proto
70c71c50
CF
408 @test -f $(PROTOC)
409 $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
6b9f0d55 410
65e8ba4d
CF
411if ENABLE_TESTS
412include Makefile.test.include
413endif
414
415if ENABLE_QT
416include Makefile.qt.include
417endif
418
419if ENABLE_QT_TESTS
420include Makefile.qttest.include
421endif
This page took 0.177615 seconds and 4 git commands to generate.