]> Git Repo - VerusCoin.git/blob - src/Makefile.am
Auto merge of #2081 - daira:1955-single-address-mining, r=bitcartel
[VerusCoin.git] / src / Makefile.am
1 DIST_SUBDIRS = secp256k1 univalue
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 BITCOIN_INCLUDES += -I$(srcdir)/univalue/include
25
26 LIBBITCOIN_SERVER=libbitcoin_server.a
27 LIBBITCOIN_WALLET=libbitcoin_wallet.a
28 LIBBITCOIN_COMMON=libbitcoin_common.a
29 LIBBITCOIN_CLI=libbitcoin_cli.a
30 LIBBITCOIN_UTIL=libbitcoin_util.a
31 LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
32 LIBBITCOINQT=qt/libbitcoinqt.a
33 LIBSECP256K1=secp256k1/libsecp256k1.la
34 LIBUNIVALUE=univalue/libunivalue.la
35 LIBZCASH=libzcash.a
36
37 $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
38         $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
39   
40 $(LIBUNIVALUE): $(wildcard univalue/lib/*)
41         $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue/
42
43 # Make is not made aware of per-object dependencies to avoid limiting building parallelization
44 # But to build the less dependent modules first, we manually select their order here:
45 EXTRA_LIBRARIES = \
46   crypto/libbitcoin_crypto.a \
47   libbitcoin_util.a \
48   libbitcoin_common.a \
49   libbitcoin_server.a \
50   libbitcoin_cli.a \
51   libzcash.a
52 if ENABLE_WALLET
53 BITCOIN_INCLUDES += $(BDB_CPPFLAGS)
54 EXTRA_LIBRARIES += libbitcoin_wallet.a
55 endif
56 if ENABLE_ZMQ
57 EXTRA_LIBRARIES += libbitcoin_zmq.a
58 endif
59
60 if BUILD_BITCOIN_LIBS
61 lib_LTLIBRARIES = libzcashconsensus.la
62 LIBZCASH_CONSENSUS=libzcashconsensus.la
63 else
64 LIBZCASH_CONSENSUS=
65 endif
66
67 bin_PROGRAMS =
68 noinst_PROGRAMS =
69 TESTS =
70
71 if BUILD_BITCOIND
72   bin_PROGRAMS += zcashd
73 endif
74
75 if BUILD_BITCOIN_UTILS
76   bin_PROGRAMS += zcash-cli zcash-tx
77 endif
78
79 LIBZCASH_H = \
80   zcash/IncrementalMerkleTree.hpp \
81   zcash/NoteEncryption.hpp \
82   zcash/Address.hpp \
83   zcash/JoinSplit.hpp \
84   zcash/Note.hpp \
85   zcash/prf.h \
86   zcash/Proof.hpp \
87   zcash/util.h \
88   zcash/Zcash.h
89
90 .PHONY: FORCE check-symbols check-security
91 # bitcoin core #
92 BITCOIN_CORE_H = \
93   addrman.h \
94   alert.h \
95   amount.h \
96   arith_uint256.h \
97   asyncrpcoperation.h \
98   asyncrpcqueue.h \
99   base58.h \
100   bloom.h \
101   chain.h \
102   chainparams.h \
103   chainparamsbase.h \
104   chainparamsseeds.h \
105   checkpoints.h \
106   checkqueue.h \
107   clientversion.h \
108   coincontrol.h \
109   coins.h \
110   compat.h \
111   compat/byteswap.h \
112   compat/endian.h \
113   compat/sanity.h \
114   compressor.h \
115   consensus/consensus.h \
116   consensus/params.h \
117   consensus/validation.h \
118   core_io.h \
119   eccryptoverify.h \
120   ecwrapper.h \
121   hash.h \
122   init.h \
123   key.h \
124   keystore.h \
125   leveldbwrapper.h \
126   limitedmap.h \
127   main.h \
128   memusage.h \
129   merkleblock.h \
130   metrics.h \
131   miner.h \
132   mruset.h \
133   net.h \
134   netbase.h \
135   noui.h \
136   policy/fees.h \
137   pow.h \
138   primitives/block.h \
139   primitives/transaction.h \
140   protocol.h \
141   pubkey.h \
142   random.h \
143   reverselock.h \
144   rpcclient.h \
145   rpcprotocol.h \
146   rpcserver.h \
147   scheduler.h \
148   script/interpreter.h \
149   script/script.h \
150   script/script_error.h \
151   script/sigcache.h \
152   script/sign.h \
153   script/standard.h \
154   serialize.h \
155   streams.h \
156   support/allocators/secure.h \
157   support/allocators/zeroafterfree.h \
158   support/cleanse.h \
159   support/pagelocker.h \
160   sync.h \
161   threadsafety.h \
162   timedata.h \
163   tinyformat.h \
164   txdb.h \
165   txmempool.h \
166   ui_interface.h \
167   uint256.h \
168   uint252.h \
169   undo.h \
170   util.h \
171   utilmoneystr.h \
172   utilstrencodings.h \
173   utiltime.h \
174   validationinterface.h \
175   version.h \
176   wallet/asyncrpcoperation_sendmany.h \
177   wallet/crypter.h \
178   wallet/db.h \
179   wallet/wallet.h \
180   wallet/wallet_ismine.h \
181   wallet/walletdb.h \
182   zmq/zmqabstractnotifier.h \
183   zmq/zmqconfig.h\
184   zmq/zmqnotificationinterface.h \
185   zmq/zmqpublishnotifier.h
186
187
188 obj/build.h: FORCE
189         @$(MKDIR_P) $(builddir)/obj
190         @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
191           $(abs_top_srcdir)
192 libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
193
194 # server: shared between bitcoind and bitcoin-qt
195 libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
196 libbitcoin_server_a_SOURCES = \
197   sendalert.cpp \
198   addrman.cpp \
199   alert.cpp \
200   alertkeys.h \
201   asyncrpcoperation.cpp \
202   asyncrpcqueue.cpp \
203   bloom.cpp \
204   chain.cpp \
205   checkpoints.cpp \
206   init.cpp \
207   leveldbwrapper.cpp \
208   main.cpp \
209   merkleblock.cpp \
210   metrics.cpp \
211   miner.cpp \
212   net.cpp \
213   noui.cpp \
214   policy/fees.cpp \
215   pow.cpp \
216   rest.cpp \
217   rpcblockchain.cpp \
218   rpcmining.cpp \
219   rpcmisc.cpp \
220   rpcnet.cpp \
221   rpcrawtransaction.cpp \
222   rpcserver.cpp \
223   script/sigcache.cpp \
224   timedata.cpp \
225   txdb.cpp \
226   txmempool.cpp \
227   validationinterface.cpp \
228   $(BITCOIN_CORE_H) \
229   $(LIBZCASH_H)
230
231 if ENABLE_ZMQ
232 LIBBITCOIN_ZMQ=libbitcoin_zmq.a
233
234 libbitcoin_zmq_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(ZMQ_CFLAGS)
235 libbitcoin_zmq_a_SOURCES = \
236   zmq/zmqabstractnotifier.cpp \
237   zmq/zmqnotificationinterface.cpp \
238   zmq/zmqpublishnotifier.cpp
239 endif
240
241
242 # wallet: shared between bitcoind and bitcoin-qt, but only linked
243 # when wallet enabled
244 libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
245 libbitcoin_wallet_a_SOURCES = \
246   utiltest.cpp \
247   utiltest.h \
248   zcbenchmarks.cpp \
249   zcbenchmarks.h \
250   wallet/asyncrpcoperation_sendmany.cpp \
251   wallet/crypter.cpp \
252   wallet/db.cpp \
253   wallet/rpcdump.cpp \
254   wallet/rpcwallet.cpp \
255   wallet/wallet.cpp \
256   wallet/wallet_ismine.cpp \
257   wallet/walletdb.cpp \
258   $(BITCOIN_CORE_H) \
259   $(LIBZCASH_H)
260
261 # crypto primitives library
262 crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES)
263 crypto_libbitcoin_crypto_a_SOURCES = \
264   crypto/common.h \
265   crypto/equihash.cpp \
266   crypto/equihash.h \
267   crypto/equihash.tcc \
268   crypto/hmac_sha256.cpp \
269   crypto/hmac_sha256.h \
270   crypto/hmac_sha512.cpp \
271   crypto/hmac_sha512.h \
272   crypto/ripemd160.cpp \
273   crypto/ripemd160.h \
274   crypto/sha1.cpp \
275   crypto/sha1.h \
276   crypto/sha256.cpp \
277   crypto/sha256.h \
278   crypto/sha512.cpp \
279   crypto/sha512.h
280
281 if ENABLE_MINING
282 EQUIHASH_TROMP_SOURCES = \
283   pow/tromp/equi_miner.h \
284   pow/tromp/equi.h \
285   pow/tromp/osx_barrier.h
286
287 crypto_libbitcoin_crypto_a_CPPFLAGS += \
288   -DEQUIHASH_TROMP_ATOMIC
289 crypto_libbitcoin_crypto_a_SOURCES += \
290   ${EQUIHASH_TROMP_SOURCES}
291 endif
292
293 # common: shared between bitcoind, and bitcoin-qt and non-server tools
294 libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
295 libbitcoin_common_a_SOURCES = \
296   amount.cpp \
297   arith_uint256.cpp \
298   base58.cpp \
299   chainparams.cpp \
300   coins.cpp \
301   compressor.cpp \
302   core_read.cpp \
303   core_write.cpp \
304   eccryptoverify.cpp \
305   ecwrapper.cpp \
306   hash.cpp \
307   key.cpp \
308   keystore.cpp \
309   netbase.cpp \
310   primitives/block.cpp \
311   primitives/transaction.cpp \
312   protocol.cpp \
313   pubkey.cpp \
314   scheduler.cpp \
315   script/interpreter.cpp \
316   script/script.cpp \
317   script/script_error.cpp \
318   script/sign.cpp \
319   script/standard.cpp \
320   $(BITCOIN_CORE_H) \
321   $(LIBZCASH_H)
322
323 # util: shared between all executables.
324 # This library *must* be included to make sure that the glibc
325 # backward-compatibility objects and their sanity checks are linked.
326 libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
327 libbitcoin_util_a_SOURCES = \
328   support/pagelocker.cpp \
329   chainparamsbase.cpp \
330   clientversion.cpp \
331   compat/glibc_sanity.cpp \
332   compat/glibcxx_sanity.cpp \
333   compat/strnlen.cpp \
334   random.cpp \
335   rpcprotocol.cpp \
336   support/cleanse.cpp \
337   sync.cpp \
338   uint256.cpp \
339   util.cpp \
340   utilmoneystr.cpp \
341   utilstrencodings.cpp \
342   utiltime.cpp \
343   $(BITCOIN_CORE_H) \
344   $(LIBZCASH_H)
345
346 if GLIBC_BACK_COMPAT
347 libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
348 endif
349
350 # cli: shared between bitcoin-cli and bitcoin-qt
351 libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
352 libbitcoin_cli_a_SOURCES = \
353   rpcclient.cpp \
354   $(BITCOIN_CORE_H) \
355   $(LIBZCASH_H)
356
357 nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
358 #
359
360 # bitcoind binary #
361 zcashd_SOURCES = bitcoind.cpp
362 zcashd_CPPFLAGS = $(BITCOIN_INCLUDES)
363 zcashd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
364
365 if TARGET_WINDOWS
366 zcashd_SOURCES += bitcoind-res.rc
367 endif
368
369 zcashd_LDADD = \
370   $(LIBBITCOIN_SERVER) \
371   $(LIBBITCOIN_COMMON) \
372   $(LIBUNIVALUE) \
373   $(LIBBITCOIN_UTIL) \
374   $(LIBBITCOIN_CRYPTO) \
375   $(LIBZCASH) \
376   $(LIBLEVELDB) \
377   $(LIBMEMENV) \
378   $(LIBSECP256K1)
379
380 if ENABLE_ZMQ
381 zcashd_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
382 endif
383
384 if ENABLE_WALLET
385 zcashd_LDADD += libbitcoin_wallet.a
386 endif
387
388 zcashd_LDADD += \
389   $(BOOST_LIBS) \
390   $(BDB_LIBS) \
391   $(SSL_LIBS) \
392   $(CRYPTO_LIBS) \
393   $(MINIUPNPC_LIBS) \
394   $(LIBZCASH) \
395   $(LIBBITCOIN_CRYPTO) \
396   $(LIBZCASH_LIBS)
397
398 # bitcoin-cli binary #
399 zcash_cli_SOURCES = bitcoin-cli.cpp
400 zcash_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
401 zcash_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
402
403 if TARGET_WINDOWS
404 zcash_cli_SOURCES += bitcoin-cli-res.rc
405 endif
406
407 zcash_cli_LDADD = \
408   $(LIBBITCOIN_CLI) \
409   $(LIBUNIVALUE) \
410   $(LIBBITCOIN_UTIL) \
411   $(BOOST_LIBS) \
412   $(SSL_LIBS) \
413   $(CRYPTO_LIBS) \
414   $(LIBZCASH) \
415   $(LIBBITCOIN_CRYPTO) \
416   $(LIBZCASH_LIBS)
417 #
418
419 # zcash-tx binary #
420 zcash_tx_SOURCES = bitcoin-tx.cpp
421 zcash_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
422 zcash_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
423
424 if TARGET_WINDOWS
425 zcash_tx_SOURCES += bitcoin-tx-res.rc
426 endif
427
428 # FIXME: Is libzcash needed for zcash_tx?
429 zcash_tx_LDADD = \
430   $(LIBUNIVALUE) \
431   $(LIBBITCOIN_COMMON) \
432   $(LIBBITCOIN_UTIL) \
433   $(LIBSECP256K1) \
434   $(LIBZCASH) \
435   $(LIBBITCOIN_CRYPTO) \
436   $(LIBZCASH_LIBS)
437
438 zcash_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
439 #
440
441 # zcash protocol primitives #
442 libzcash_a_SOURCES = \
443   zcash/IncrementalMerkleTree.cpp \
444   zcash/NoteEncryption.cpp \
445   zcash/Address.cpp \
446   zcash/JoinSplit.cpp \
447   zcash/Proof.cpp \
448   zcash/Note.cpp \
449   zcash/prf.cpp \
450   zcash/util.cpp \
451   zcash/circuit/commitment.tcc \
452   zcash/circuit/gadget.tcc \
453   zcash/circuit/merkle.tcc \
454   zcash/circuit/note.tcc \
455   zcash/circuit/prfs.tcc \
456   zcash/circuit/utils.tcc
457
458 libzcash_a_CPPFLAGS = -DMULTICORE -fopenmp -fPIC -DBINARY_OUTPUT -DCURVE_ALT_BN128 -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS $(HARDENED_CPPFLAGS) -pipe -O1 -g -Wstack-protector -fstack-protector-all -fPIE -fvisibility=hidden -DSTATIC $(BITCOIN_INCLUDES)
459
460 libzcash_a_CXXFLAGS = $(HARDENED_CXXFLAGS) -fwrapv -fno-strict-aliasing
461
462 libzcash_a_LDFLAGS = $(HARDENED_LDFLAGS)
463
464 libzcash_a_CPPFLAGS += -DMONTGOMERY_OUTPUT
465
466 # zcashconsensus library #
467 if BUILD_BITCOIN_LIBS
468 include_HEADERS = script/zcashconsensus.h
469 libzcashconsensus_la_SOURCES = \
470   crypto/equihash.cpp \
471   crypto/hmac_sha512.cpp \
472   crypto/ripemd160.cpp \
473   crypto/sha1.cpp \
474   crypto/sha256.cpp \
475   crypto/sha512.cpp \
476   eccryptoverify.cpp \
477   ecwrapper.cpp \
478   hash.cpp \
479   primitives/transaction.cpp \
480   pubkey.cpp \
481   script/zcashconsensus.cpp \
482   script/interpreter.cpp \
483   script/script.cpp \
484   uint256.cpp \
485   utilstrencodings.cpp
486
487 if GLIBC_BACK_COMPAT
488   libzcashconsensus_la_SOURCES += compat/glibc_compat.cpp
489 endif
490
491 libzcashconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)
492 libzcashconsensus_la_LIBADD = $(CRYPTO_LIBS)
493 libzcashconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BITCOIN_INTERNAL
494
495 endif
496 #
497
498 CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno */*.gcno wallet/*/*.gcno
499
500 DISTCLEANFILES = obj/build.h
501
502 EXTRA_DIST = leveldb
503
504 clean-local:
505         -$(MAKE) -C leveldb clean
506         -$(MAKE) -C secp256k1 clean
507         rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
508         -rm -f config.h
509
510 .rc.o:
511         @test -f $(WINDRES)
512         $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
513
514 .mm.o:
515         $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
516           $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS)  -c -o $@ $<
517
518 check-symbols: $(bin_PROGRAMS)
519 if GLIBC_BACK_COMPAT
520         @echo "Checking glibc back compat of [$(bin_PROGRAMS)]..."
521         $(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(top_srcdir)/contrib/devtools/symbol-check.py < $(bin_PROGRAMS)
522 endif
523
524 check-security: $(bin_PROGRAMS)
525 if HARDEN
526         @echo "Checking binary security of [$(bin_PROGRAMS)]..."
527         $(AM_V_at) READELF=$(READELF) OBJDUMP=$(OBJDUMP) $(top_srcdir)/contrib/devtools/security-check.py < $(bin_PROGRAMS)
528 endif
529
530 %.pb.cc %.pb.h: %.proto
531         @test -f $(PROTOC)
532         $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
533
534 if ENABLE_TESTS
535 include Makefile.test.include
536 include Makefile.gtest.include
537 endif
538
539 if ENABLE_QT
540 include Makefile.qt.include
541 endif
542
543 if ENABLE_QT_TESTS
544 include Makefile.qttest.include
545 endif
546
547 include Makefile.zcash.include
This page took 0.050597 seconds and 4 git commands to generate.