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