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