]>
Commit | Line | Data |
---|---|---|
575e70c0 | 1 | AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) |
eb12a14d | 2 | |
55668266 CF |
3 | if USE_LIBSECP256K1 |
4 | secp256k1/libsecp256k1.la: $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*) | |
5 | @$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) | |
6 | endif | |
35b8af92 | 7 | |
6b9f0d55 | 8 | if EMBEDDED_LEVELDB |
56c157d5 CF |
9 | LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include |
10 | LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv | |
11 | LIBLEVELDB += $(builddir)/leveldb/libleveldb.a | |
12 | LIBMEMENV += $(builddir)/leveldb/libmemenv.a | |
6b9f0d55 CF |
13 | |
14 | # 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 | |
15 | $(LIBLEVELDB): $(LIBMEMENV) | |
16 | ||
17 | $(LIBLEVELDB) $(LIBMEMENV): | |
18 | @echo "Building LevelDB ..." && $(MAKE) -C $(@D) $(@F) CXX="$(CXX)" \ | |
19 | CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \ | |
20 | OPT="$(CXXFLAGS) $(CPPFLAGS)" | |
21 | endif | |
22 | ||
54372482 | 23 | BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config |
6b099402 | 24 | BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) |
f4d81129 | 25 | |
55668266 CF |
26 | if USE_LIBSECP256K1 |
27 | BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include | |
28 | endif | |
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 | |
cbe39a38 | 36 | LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a |
84ce18ca WL |
37 | LIBBITCOINQT=qt/libbitcoinqt.a |
38 | ||
071473c5 | 39 | # Make is not made aware of per-object dependencies to avoid limiting building parallelization |
40 | # But to build the less dependent modules first, we manually select their order here: | |
5a407bd0 | 41 | noinst_LIBRARIES = \ |
071473c5 | 42 | crypto/libbitcoin_crypto.a \ |
84ce18ca | 43 | libbitcoin_util.a \ |
071473c5 | 44 | libbitcoin_common.a \ |
cbe39a38 | 45 | univalue/libbitcoin_univalue.a \ |
071473c5 | 46 | libbitcoin_server.a \ |
47 | libbitcoin_cli.a | |
4f9e993b | 48 | if ENABLE_WALLET |
f4d81129 | 49 | BITCOIN_INCLUDES += $(BDB_CPPFLAGS) |
4f9e993b WL |
50 | noinst_LIBRARIES += libbitcoin_wallet.a |
51 | endif | |
35b8af92 | 52 | |
f930341d | 53 | bin_PROGRAMS = |
65e8ba4d | 54 | TESTS = |
f930341d LD |
55 | |
56 | if BUILD_BITCOIND | |
57 | bin_PROGRAMS += bitcoind | |
58 | endif | |
59 | ||
c101c769 | 60 | if BUILD_BITCOIN_UTILS |
61 | bin_PROGRAMS += bitcoin-cli bitcoin-tx | |
f930341d | 62 | endif |
35b8af92 | 63 | |
35b8af92 CF |
64 | .PHONY: FORCE |
65 | # bitcoin core # | |
5a407bd0 WL |
66 | BITCOIN_CORE_H = \ |
67 | addrman.h \ | |
68 | alert.h \ | |
69 | allocators.h \ | |
a372168e | 70 | amount.h \ |
7cd0af7c | 71 | base58.h \ |
5a407bd0 | 72 | bloom.h \ |
e8b5f0d5 | 73 | chain.h \ |
5a407bd0 | 74 | chainparams.h \ |
84ce18ca | 75 | chainparamsbase.h \ |
a60120e9 | 76 | chainparamsseeds.h \ |
5a407bd0 WL |
77 | checkpoints.h \ |
78 | checkqueue.h \ | |
79 | clientversion.h \ | |
80 | coincontrol.h \ | |
81 | coins.h \ | |
82 | compat.h \ | |
561e9e9d | 83 | compressor.h \ |
99f41b9c | 84 | core/block.h \ |
4a3587d8 | 85 | core/transaction.h \ |
ae775b5b | 86 | core_io.h \ |
5a407bd0 WL |
87 | crypter.h \ |
88 | db.h \ | |
900078ae | 89 | eccryptoverify.h \ |
50f71cd5 | 90 | ecwrapper.h \ |
5a407bd0 WL |
91 | hash.h \ |
92 | init.h \ | |
93 | key.h \ | |
94 | keystore.h \ | |
95 | leveldbwrapper.h \ | |
96 | limitedmap.h \ | |
97 | main.h \ | |
98 | miner.h \ | |
99 | mruset.h \ | |
100 | netbase.h \ | |
101 | net.h \ | |
102 | noui.h \ | |
df852d2b | 103 | pow.h \ |
5a407bd0 | 104 | protocol.h \ |
d2e74c55 | 105 | pubkey.h \ |
6354935c | 106 | random.h \ |
fb78cc23 WL |
107 | rpcclient.h \ |
108 | rpcprotocol.h \ | |
109 | rpcserver.h \ | |
611116d4 | 110 | script/interpreter.h \ |
cbd22a50 | 111 | script/script.h \ |
5c1e798a | 112 | script/sigcache.h \ |
e088d65a | 113 | script/sign.h \ |
c4408a6c | 114 | script/standard.h \ |
ab9edbd6 | 115 | script/script_error.h \ |
5a407bd0 | 116 | serialize.h \ |
fa736190 | 117 | streams.h \ |
5a407bd0 WL |
118 | sync.h \ |
119 | threadsafety.h \ | |
14f888ca | 120 | timedata.h \ |
b77dfdc9 | 121 | tinyformat.h \ |
5a407bd0 WL |
122 | txdb.h \ |
123 | txmempool.h \ | |
124 | ui_interface.h \ | |
125 | uint256.h \ | |
999a2ab4 | 126 | undo.h \ |
5a407bd0 | 127 | util.h \ |
ad49c256 WL |
128 | utilstrencodings.h \ |
129 | utilmoneystr.h \ | |
130 | utiltime.h \ | |
5a407bd0 | 131 | version.h \ |
679240d0 | 132 | wallet.h \ |
611116d4 PK |
133 | wallet_ismine.h \ |
134 | walletdb.h \ | |
679240d0 | 135 | compat/sanity.h |
5a407bd0 WL |
136 | |
137 | JSON_H = \ | |
138 | json/json_spirit.h \ | |
139 | json/json_spirit_error_position.h \ | |
140 | json/json_spirit_reader.h \ | |
141 | json/json_spirit_reader_template.h \ | |
142 | json/json_spirit_stream_reader.h \ | |
143 | json/json_spirit_utils.h \ | |
144 | json/json_spirit_value.h \ | |
145 | json/json_spirit_writer.h \ | |
35b8af92 CF |
146 | json/json_spirit_writer_template.h |
147 | ||
148 | obj/build.h: FORCE | |
56c157d5 | 149 | @$(MKDIR_P) $(builddir)/obj |
35b8af92 CF |
150 | @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \ |
151 | $(abs_top_srcdir) | |
71697f97 | 152 | libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h |
35b8af92 | 153 | |
84ce18ca | 154 | # server: shared between bitcoind and bitcoin-qt |
9f7f504e | 155 | libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) |
4f9e993b WL |
156 | libbitcoin_server_a_SOURCES = \ |
157 | addrman.cpp \ | |
158 | alert.cpp \ | |
fb78cc23 | 159 | bloom.cpp \ |
e8b5f0d5 | 160 | chain.cpp \ |
4f9e993b | 161 | checkpoints.cpp \ |
4f9e993b | 162 | init.cpp \ |
4f9e993b WL |
163 | leveldbwrapper.cpp \ |
164 | main.cpp \ | |
4a85e067 | 165 | miner.cpp \ |
4f9e993b WL |
166 | net.cpp \ |
167 | noui.cpp \ | |
df852d2b | 168 | pow.cpp \ |
e2655e0a | 169 | rest.cpp \ |
4f9e993b | 170 | rpcblockchain.cpp \ |
4a85e067 | 171 | rpcmining.cpp \ |
652e1569 | 172 | rpcmisc.cpp \ |
4f9e993b WL |
173 | rpcnet.cpp \ |
174 | rpcrawtransaction.cpp \ | |
dfd39962 | 175 | rpcserver.cpp \ |
bfe029fe | 176 | script/sigcache.cpp \ |
14f888ca | 177 | timedata.cpp \ |
4f9e993b WL |
178 | txdb.cpp \ |
179 | txmempool.cpp \ | |
180 | $(JSON_H) \ | |
181 | $(BITCOIN_CORE_H) | |
182 | ||
84ce18ca WL |
183 | # wallet: shared between bitcoind and bitcoin-qt, but only linked |
184 | # when wallet enabled | |
f4d81129 | 185 | libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES) |
4f9e993b WL |
186 | libbitcoin_wallet_a_SOURCES = \ |
187 | db.cpp \ | |
829c9203 | 188 | crypter.cpp \ |
4f9e993b | 189 | rpcdump.cpp \ |
4f9e993b WL |
190 | rpcwallet.cpp \ |
191 | wallet.cpp \ | |
611116d4 | 192 | wallet_ismine.cpp \ |
4f9e993b | 193 | walletdb.cpp \ |
0b47fe6b WL |
194 | $(BITCOIN_CORE_H) |
195 | ||
84ce18ca | 196 | # crypto primitives library |
4791b99e CF |
197 | crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES) |
198 | crypto_libbitcoin_crypto_a_SOURCES = \ | |
199 | crypto/sha1.cpp \ | |
200 | crypto/sha2.cpp \ | |
201 | crypto/ripemd160.cpp \ | |
202 | crypto/common.h \ | |
203 | crypto/sha2.h \ | |
204 | crypto/sha1.h \ | |
205 | crypto/ripemd160.h | |
206 | ||
cbe39a38 JG |
207 | # univalue JSON library |
208 | univalue_libbitcoin_univalue_a_SOURCES = \ | |
209 | univalue/univalue.cpp \ | |
210 | univalue/univalue_read.cpp \ | |
211 | univalue/univalue_write.cpp \ | |
3cceba7a | 212 | univalue/univalue_escapes.h \ |
cbe39a38 JG |
213 | univalue/univalue.h |
214 | ||
84ce18ca | 215 | # common: shared between bitcoind, and bitcoin-qt and non-server tools |
f4d81129 | 216 | libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES) |
0b47fe6b WL |
217 | libbitcoin_common_a_SOURCES = \ |
218 | allocators.cpp \ | |
eda37330 | 219 | amount.cpp \ |
75c82d49 | 220 | base58.cpp \ |
0b47fe6b | 221 | chainparams.cpp \ |
75c82d49 | 222 | coins.cpp \ |
561e9e9d | 223 | compressor.cpp \ |
99f41b9c | 224 | core/block.cpp \ |
4a3587d8 | 225 | core/transaction.cpp \ |
ae775b5b JG |
226 | core_read.cpp \ |
227 | core_write.cpp \ | |
900078ae | 228 | eccryptoverify.cpp \ |
50f71cd5 | 229 | ecwrapper.cpp \ |
0b47fe6b WL |
230 | hash.cpp \ |
231 | key.cpp \ | |
75c82d49 | 232 | keystore.cpp \ |
0b47fe6b WL |
233 | netbase.cpp \ |
234 | protocol.cpp \ | |
d2e74c55 | 235 | pubkey.cpp \ |
611116d4 | 236 | script/interpreter.cpp \ |
cbd22a50 | 237 | script/script.cpp \ |
e088d65a | 238 | script/sign.cpp \ |
c4408a6c | 239 | script/standard.cpp \ |
ab9edbd6 | 240 | script/script_error.cpp \ |
84ce18ca WL |
241 | $(BITCOIN_CORE_H) |
242 | ||
243 | # util: shared between all executables. | |
244 | # This library *must* be included to make sure that the glibc | |
245 | # backward-compatibility objects and their sanity checks are linked. | |
246 | libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES) | |
247 | libbitcoin_util_a_SOURCES = \ | |
6354935c PK |
248 | compat/glibc_sanity.cpp \ |
249 | compat/glibcxx_sanity.cpp \ | |
84ce18ca | 250 | chainparamsbase.cpp \ |
71697f97 | 251 | clientversion.cpp \ |
6354935c | 252 | random.cpp \ |
84ce18ca | 253 | rpcprotocol.cpp \ |
0b47fe6b | 254 | sync.cpp \ |
de79aaa7 | 255 | uint256.cpp \ |
0b47fe6b | 256 | util.cpp \ |
ad49c256 WL |
257 | utilstrencodings.cpp \ |
258 | utilmoneystr.cpp \ | |
259 | utiltime.cpp \ | |
35b8af92 CF |
260 | $(BITCOIN_CORE_H) |
261 | ||
d5aab704 | 262 | if GLIBC_BACK_COMPAT |
84ce18ca WL |
263 | libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp |
264 | libbitcoin_util_a_SOURCES += compat/glibcxx_compat.cpp | |
d5aab704 CF |
265 | endif |
266 | ||
84ce18ca | 267 | # cli: shared between bitcoin-cli and bitcoin-qt |
a65668dd | 268 | libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES) |
0b47fe6b WL |
269 | libbitcoin_cli_a_SOURCES = \ |
270 | rpcclient.cpp \ | |
271 | $(BITCOIN_CORE_H) | |
272 | ||
84ce18ca | 273 | nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h |
35b8af92 CF |
274 | # |
275 | ||
276 | # bitcoind binary # | |
5a407bd0 | 277 | bitcoind_LDADD = \ |
84ce18ca WL |
278 | $(LIBBITCOIN_SERVER) \ |
279 | $(LIBBITCOIN_COMMON) \ | |
cbe39a38 | 280 | $(LIBBITCOIN_UNIVALUE) \ |
84ce18ca WL |
281 | $(LIBBITCOIN_UTIL) \ |
282 | $(LIBBITCOIN_CRYPTO) \ | |
4a290b52 LD |
283 | $(LIBLEVELDB) \ |
284 | $(LIBMEMENV) | |
55668266 CF |
285 | |
286 | if USE_LIBSECP256K1 | |
287 | bitcoind_LDADD += secp256k1/libsecp256k1.la | |
288 | endif | |
289 | ||
4f9e993b WL |
290 | if ENABLE_WALLET |
291 | bitcoind_LDADD += libbitcoin_wallet.a | |
292 | endif | |
35b8af92 CF |
293 | bitcoind_SOURCES = bitcoind.cpp |
294 | # | |
295 | ||
dee632cc | 296 | if TARGET_WINDOWS |
cbf87fc4 | 297 | bitcoind_SOURCES += bitcoind-res.rc |
dee632cc CF |
298 | endif |
299 | ||
28d412ff | 300 | bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) |
f4d81129 | 301 | bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES) |
e432a5f0 | 302 | bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) |
941dba17 | 303 | |
2a03a390 | 304 | # bitcoin-cli binary # |
5a407bd0 | 305 | bitcoin_cli_LDADD = \ |
84ce18ca | 306 | $(LIBBITCOIN_CLI) \ |
84ce18ca | 307 | $(LIBBITCOIN_UTIL) \ |
6b099402 CF |
308 | $(BOOST_LIBS) \ |
309 | $(SSL_LIBS) \ | |
93a60224 | 310 | $(CRYPTO_LIBS) |
6b099402 | 311 | |
84ce18ca WL |
312 | bitcoin_cli_SOURCES = \ |
313 | bitcoin-cli.cpp | |
55668266 CF |
314 | |
315 | if USE_LIBSECP256K1 | |
316 | bitcoin_cli_LDADD += secp256k1/libsecp256k1.la | |
317 | endif | |
f4d81129 | 318 | bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES) |
2a03a390 WL |
319 | # |
320 | ||
cbe39a38 JG |
321 | # bitcoin-tx binary # |
322 | bitcoin_tx_LDADD = \ | |
323 | $(LIBBITCOIN_UNIVALUE) \ | |
324 | $(LIBBITCOIN_COMMON) \ | |
325 | $(LIBBITCOIN_UTIL) \ | |
6b099402 CF |
326 | $(LIBBITCOIN_CRYPTO) |
327 | ||
328 | if USE_LIBSECP256K1 | |
329 | bitcoin_tx_LDADD += secp256k1/libsecp256k1.la | |
330 | endif | |
331 | ||
332 | bitcoin_tx_LDADD += $(BOOST_LIBS) \ | |
bfe029fe | 333 | $(CRYPTO_LIBS) |
28d412ff | 334 | |
cbe39a38 JG |
335 | bitcoin_tx_SOURCES = bitcoin-tx.cpp |
336 | bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES) | |
337 | # | |
e432a5f0 | 338 | bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) |
cbe39a38 | 339 | |
2a03a390 WL |
340 | if TARGET_WINDOWS |
341 | bitcoin_cli_SOURCES += bitcoin-cli-res.rc | |
342 | endif | |
e432a5f0 | 343 | bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) |
2a03a390 | 344 | |
35b8af92 CF |
345 | CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno |
346 | ||
347 | DISTCLEANFILES = obj/build.h | |
348 | ||
55668266 | 349 | EXTRA_DIST = leveldb secp256k1 |
35b8af92 CF |
350 | |
351 | clean-local: | |
352 | -$(MAKE) -C leveldb clean | |
1e72d5c0 | 353 | -$(MAKE) -C secp256k1 clean 2>/dev/null |
26d1b65c | 354 | rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno |
54372482 | 355 | -rm -f config.h |
65e8ba4d | 356 | |
6b9f0d55 | 357 | .rc.o: |
70c71c50 | 358 | @test -f $(WINDRES) |
71697f97 | 359 | $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@ |
6b9f0d55 CF |
360 | |
361 | .mm.o: | |
70c71c50 | 362 | $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
6b9f0d55 CF |
363 | $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $< |
364 | ||
365 | %.pb.cc %.pb.h: %.proto | |
70c71c50 CF |
366 | @test -f $(PROTOC) |
367 | $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<) | |
6b9f0d55 | 368 | |
65e8ba4d CF |
369 | if ENABLE_TESTS |
370 | include Makefile.test.include | |
371 | endif | |
372 | ||
373 | if ENABLE_QT | |
374 | include Makefile.qt.include | |
375 | endif | |
376 | ||
377 | if ENABLE_QT_TESTS | |
378 | include Makefile.qttest.include | |
379 | endif |