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