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