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