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