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