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