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