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