]> Git Repo - VerusCoin.git/blob - src/Makefile.am
Auto merge of #2265 - daira:2263.fix-rpc-error-reporting, r=daira
[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   eccryptoverify.h \
128   ecwrapper.h \
129   hash.h \
130   httprpc.h \
131   httpserver.h \
132   init.h \
133   key.h \
134   keystore.h \
135   leveldbwrapper.h \
136   limitedmap.h \
137   main.h \
138   memusage.h \
139   merkleblock.h \
140   metrics.h \
141   miner.h \
142   mruset.h \
143   net.h \
144   netbase.h \
145   noui.h \
146   policy/fees.h \
147   pow.h \
148   primitives/block.h \
149   primitives/transaction.h \
150   protocol.h \
151   pubkey.h \
152   random.h \
153   reverselock.h \
154   rpcclient.h \
155   rpcprotocol.h \
156   rpcserver.h \
157   scheduler.h \
158   script/interpreter.h \
159   script/script.h \
160   script/script_error.h \
161   script/sigcache.h \
162   script/sign.h \
163   script/standard.h \
164   serialize.h \
165   streams.h \
166   support/allocators/secure.h \
167   support/allocators/zeroafterfree.h \
168   support/cleanse.h \
169   support/events.h \
170   support/pagelocker.h \
171   sync.h \
172   threadsafety.h \
173   timedata.h \
174   tinyformat.h \
175   torcontrol.h \
176   txdb.h \
177   txmempool.h \
178   ui_interface.h \
179   uint256.h \
180   uint252.h \
181   undo.h \
182   util.h \
183   utilmoneystr.h \
184   utilstrencodings.h \
185   utiltime.h \
186   validationinterface.h \
187   version.h \
188   wallet/asyncrpcoperation_sendmany.h \
189   wallet/crypter.h \
190   wallet/db.h \
191   wallet/wallet.h \
192   wallet/wallet_ismine.h \
193   wallet/walletdb.h \
194   zmq/zmqabstractnotifier.h \
195   zmq/zmqconfig.h\
196   zmq/zmqnotificationinterface.h \
197   zmq/zmqpublishnotifier.h
198
199
200 obj/build.h: FORCE
201         @$(MKDIR_P) $(builddir)/obj
202         @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
203           $(abs_top_srcdir)
204 libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
205
206 # server: zcashd
207 libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS)
208 libbitcoin_server_a_SOURCES = \
209   sendalert.cpp \
210   addrman.cpp \
211   alert.cpp \
212   alertkeys.h \
213   asyncrpcoperation.cpp \
214   asyncrpcqueue.cpp \
215   bloom.cpp \
216   chain.cpp \
217   checkpoints.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   eccryptoverify.cpp \
328   ecwrapper.cpp \
329   hash.cpp \
330   key.cpp \
331   keystore.cpp \
332   netbase.cpp \
333   primitives/block.cpp \
334   primitives/transaction.cpp \
335   protocol.cpp \
336   pubkey.cpp \
337   scheduler.cpp \
338   script/interpreter.cpp \
339   script/script.cpp \
340   script/script_error.cpp \
341   script/sign.cpp \
342   script/standard.cpp \
343   $(BITCOIN_CORE_H) \
344   $(LIBZCASH_H)
345
346 # util: shared between all executables.
347 # This library *must* be included to make sure that the glibc
348 # backward-compatibility objects and their sanity checks are linked.
349 libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
350 libbitcoin_util_a_SOURCES = \
351   support/pagelocker.cpp \
352   chainparamsbase.cpp \
353   clientversion.cpp \
354   compat/glibc_sanity.cpp \
355   compat/glibcxx_sanity.cpp \
356   compat/strnlen.cpp \
357   random.cpp \
358   rpcprotocol.cpp \
359   support/cleanse.cpp \
360   sync.cpp \
361   uint256.cpp \
362   util.cpp \
363   utilmoneystr.cpp \
364   utilstrencodings.cpp \
365   utiltime.cpp \
366   $(BITCOIN_CORE_H) \
367   $(LIBZCASH_H)
368
369 if GLIBC_BACK_COMPAT
370 libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
371 endif
372
373 # cli: zcash-cli
374 libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
375 libbitcoin_cli_a_SOURCES = \
376   rpcclient.cpp \
377   $(BITCOIN_CORE_H) \
378   $(LIBZCASH_H)
379
380 nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
381 #
382
383 # bitcoind binary #
384 zcashd_SOURCES = bitcoind.cpp
385 zcashd_CPPFLAGS = $(BITCOIN_INCLUDES)
386 zcashd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
387
388 if TARGET_WINDOWS
389 zcashd_SOURCES += bitcoind-res.rc
390 endif
391
392 zcashd_LDADD = \
393   $(LIBBITCOIN_SERVER) \
394   $(LIBBITCOIN_COMMON) \
395   $(LIBUNIVALUE) \
396   $(LIBBITCOIN_UTIL) \
397   $(LIBBITCOIN_CRYPTO) \
398   $(LIBZCASH) \
399   $(LIBLEVELDB) \
400   $(LIBMEMENV) \
401   $(LIBSECP256K1)
402
403 if ENABLE_ZMQ
404 zcashd_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
405 endif
406
407 if ENABLE_WALLET
408 zcashd_LDADD += libbitcoin_wallet.a
409 endif
410
411 zcashd_LDADD += \
412   $(BOOST_LIBS) \
413   $(BDB_LIBS) \
414   $(SSL_LIBS) \
415   $(CRYPTO_LIBS) \
416   $(MINIUPNPC_LIBS) \
417   $(EVENT_PTHREADS_LIBS) \
418   $(EVENT_LIBS) \
419   $(LIBZCASH) \
420   $(LIBBITCOIN_CRYPTO) \
421   $(LIBZCASH_LIBS)
422
423 if ENABLE_PROTON
424 zcashd_LDADD += $(LIBBITCOIN_PROTON) $(PROTON_LIBS)
425 endif
426
427 # bitcoin-cli binary #
428 zcash_cli_SOURCES = bitcoin-cli.cpp
429 zcash_cli_CPPFLAGS = $(BITCOIN_INCLUDES) $(EVENT_CFLAGS)
430 zcash_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
431
432 if TARGET_WINDOWS
433 zcash_cli_SOURCES += bitcoin-cli-res.rc
434 endif
435
436 zcash_cli_LDADD = \
437   $(LIBBITCOIN_CLI) \
438   $(LIBUNIVALUE) \
439   $(LIBBITCOIN_UTIL) \
440   $(BOOST_LIBS) \
441   $(SSL_LIBS) \
442   $(CRYPTO_LIBS) \
443   $(EVENT_LIBS) \
444   $(LIBZCASH) \
445   $(LIBBITCOIN_CRYPTO) \
446   $(LIBZCASH_LIBS)
447 #
448
449 # zcash-tx binary #
450 zcash_tx_SOURCES = bitcoin-tx.cpp
451 zcash_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
452 zcash_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
453
454 if TARGET_WINDOWS
455 zcash_tx_SOURCES += bitcoin-tx-res.rc
456 endif
457
458 # FIXME: Is libzcash needed for zcash_tx?
459 zcash_tx_LDADD = \
460   $(LIBUNIVALUE) \
461   $(LIBBITCOIN_COMMON) \
462   $(LIBBITCOIN_UTIL) \
463   $(LIBSECP256K1) \
464   $(LIBZCASH) \
465   $(LIBBITCOIN_CRYPTO) \
466   $(LIBZCASH_LIBS)
467
468 zcash_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
469 #
470
471 # zcash protocol primitives #
472 libzcash_a_SOURCES = \
473   zcash/IncrementalMerkleTree.cpp \
474   zcash/NoteEncryption.cpp \
475   zcash/Address.cpp \
476   zcash/JoinSplit.cpp \
477   zcash/Proof.cpp \
478   zcash/Note.cpp \
479   zcash/prf.cpp \
480   zcash/util.cpp \
481   zcash/circuit/commitment.tcc \
482   zcash/circuit/gadget.tcc \
483   zcash/circuit/merkle.tcc \
484   zcash/circuit/note.tcc \
485   zcash/circuit/prfs.tcc \
486   zcash/circuit/utils.tcc
487
488 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)
489
490 libzcash_a_CXXFLAGS = $(HARDENED_CXXFLAGS) -fwrapv -fno-strict-aliasing
491
492 libzcash_a_LDFLAGS = $(HARDENED_LDFLAGS)
493
494 libzcash_a_CPPFLAGS += -DMONTGOMERY_OUTPUT
495
496 # zcashconsensus library #
497 if BUILD_BITCOIN_LIBS
498 include_HEADERS = script/zcashconsensus.h
499 libzcashconsensus_la_SOURCES = \
500   crypto/equihash.cpp \
501   crypto/hmac_sha512.cpp \
502   crypto/ripemd160.cpp \
503   crypto/sha1.cpp \
504   crypto/sha256.cpp \
505   crypto/sha512.cpp \
506   eccryptoverify.cpp \
507   ecwrapper.cpp \
508   hash.cpp \
509   primitives/transaction.cpp \
510   pubkey.cpp \
511   script/zcashconsensus.cpp \
512   script/interpreter.cpp \
513   script/script.cpp \
514   uint256.cpp \
515   utilstrencodings.cpp
516
517 if GLIBC_BACK_COMPAT
518   libzcashconsensus_la_SOURCES += compat/glibc_compat.cpp
519 endif
520
521 libzcashconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)
522 libzcashconsensus_la_LIBADD = $(CRYPTO_LIBS)
523 libzcashconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BITCOIN_INTERNAL
524
525 endif
526 #
527
528 CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno */*.gcno wallet/*/*.gcno
529
530 DISTCLEANFILES = obj/build.h
531
532 EXTRA_DIST = leveldb
533
534 clean-local:
535         -$(MAKE) -C leveldb clean
536         -$(MAKE) -C secp256k1 clean
537         rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
538         -rm -f config.h
539
540 .rc.o:
541         @test -f $(WINDRES)
542         $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
543
544 .mm.o:
545         $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
546           $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)  -c -o $@ $<
547
548 check-symbols: $(bin_PROGRAMS)
549 if GLIBC_BACK_COMPAT
550         @echo "Checking glibc back compat of [$(bin_PROGRAMS)]..."
551         $(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(top_srcdir)/contrib/devtools/symbol-check.py < $(bin_PROGRAMS)
552 endif
553
554 check-security: $(bin_PROGRAMS)
555 if HARDEN
556         @echo "Checking binary security of [$(bin_PROGRAMS)]..."
557         $(AM_V_at) READELF=$(READELF) OBJDUMP=$(OBJDUMP) $(top_srcdir)/contrib/devtools/security-check.py < $(bin_PROGRAMS)
558 endif
559
560 %.pb.cc %.pb.h: %.proto
561         @test -f $(PROTOC)
562         $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
563
564 if ENABLE_TESTS
565 include Makefile.test.include
566 include Makefile.gtest.include
567 endif
568
569 include Makefile.zcash.include
This page took 0.054753 seconds and 4 git commands to generate.