]> Git Repo - VerusCoin.git/blob - src/Makefile.am
test
[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 -lcurl
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 = libbitcoinconsensus.la
56 LIBBITCOIN_CONSENSUS=libbitcoinconsensus.la
57 else
58 LIBBITCOIN_CONSENSUS=
59 endif
60
61 bin_PROGRAMS =
62 TESTS =
63
64 if BUILD_BITCOIND
65   bin_PROGRAMS += komodod
66 endif
67
68 if BUILD_BITCOIN_UTILS
69   bin_PROGRAMS += komodo-cli bitcoin-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 # crypto primitives library
247 crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES)
248 crypto_libbitcoin_crypto_a_SOURCES = \
249   crypto/common.h \
250   crypto/equihash.cpp \
251   crypto/equihash.h \
252   crypto/equihash.tcc \
253   crypto/hmac_sha256.cpp \
254   crypto/hmac_sha256.h \
255   crypto/hmac_sha512.cpp \
256   crypto/hmac_sha512.h \
257   crypto/ripemd160.cpp \
258   crypto/ripemd160.h \
259   crypto/sha1.cpp \
260   crypto/sha1.h \
261   crypto/sha256.cpp \
262   crypto/sha256.h \
263   crypto/sha512.cpp \
264   crypto/sha512.h
265
266 # univalue JSON library
267 univalue_libbitcoin_univalue_a_SOURCES = \
268   univalue/univalue.cpp \
269   univalue/univalue.h \
270   univalue/univalue_escapes.h \
271   univalue/univalue_read.cpp \
272   univalue/univalue_write.cpp
273
274 # common: shared between bitcoind, and bitcoin-qt and non-server tools
275 libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
276 libbitcoin_common_a_SOURCES = \
277   amount.cpp \
278   arith_uint256.cpp \
279   base58.cpp \
280   chainparams.cpp \
281   coins.cpp \
282   compressor.cpp \
283   core_read.cpp \
284   core_write.cpp \
285   eccryptoverify.cpp \
286   ecwrapper.cpp \
287   hash.cpp \
288   key.cpp \
289   keystore.cpp \
290   netbase.cpp \
291   primitives/block.cpp \
292   primitives/transaction.cpp \
293   protocol.cpp \
294   pubkey.cpp \
295   scheduler.cpp \
296   script/interpreter.cpp \
297   script/script.cpp \
298   script/script_error.cpp \
299   script/sign.cpp \
300   script/standard.cpp \
301   $(BITCOIN_CORE_H) \
302   $(LIBZCASH_H)
303
304 # util: shared between all executables.
305 # This library *must* be included to make sure that the glibc
306 # backward-compatibility objects and their sanity checks are linked.
307 libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
308 libbitcoin_util_a_SOURCES = \
309   support/pagelocker.cpp \
310   chainparamsbase.cpp \
311   clientversion.cpp \
312   compat/glibc_sanity.cpp \
313   compat/glibcxx_sanity.cpp \
314   compat/strnlen.cpp \
315   random.cpp \
316   rpcprotocol.cpp \
317   support/cleanse.cpp \
318   sync.cpp \
319   uint256.cpp \
320   util.cpp \
321   utilmoneystr.cpp \
322   utilstrencodings.cpp \
323   utiltime.cpp \
324   $(BITCOIN_CORE_H) \
325   $(LIBZCASH_H)
326
327 if GLIBC_BACK_COMPAT
328 libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
329 endif
330
331 # cli: shared between bitcoin-cli and bitcoin-qt
332 libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
333 libbitcoin_cli_a_SOURCES = \
334   rpcclient.cpp \
335   $(BITCOIN_CORE_H) \
336   $(LIBZCASH_H)
337
338 nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
339 #
340
341 # bitcoind binary #
342 komodod_SOURCES = bitcoind.cpp
343 komodod_CPPFLAGS = $(BITCOIN_INCLUDES)
344 komodod_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
345
346 if TARGET_WINDOWS
347 komodod_SOURCES += bitcoind-res.rc
348 endif
349
350 komodod_LDADD = \
351   $(LIBBITCOIN_SERVER) \
352   $(LIBBITCOIN_COMMON) \
353   $(LIBBITCOIN_UNIVALUE) \
354   $(LIBBITCOIN_UTIL) \
355   $(LIBBITCOIN_CRYPTO) \
356   $(LIBZCASH) \
357   $(LIBLEVELDB) \
358   $(LIBMEMENV) \
359   $(LIBSECP256K1)
360
361 if ENABLE_WALLET
362 komodod_LDADD += libbitcoin_wallet.a
363 endif
364
365 komodod_LDADD += \
366   $(BOOST_LIBS) \
367   $(BDB_LIBS) \
368   $(SSL_LIBS) \
369   $(CRYPTO_LIBS) \
370   $(MINIUPNPC_LIBS) \
371   $(LIBZCASH) \
372   $(LIBBITCOIN_CRYPTO) \
373   $(LIBZCASH_LIBS)
374 #
375
376 # bitcoin-cli binary #
377 komodo_cli_SOURCES = bitcoin-cli.cpp
378 komodo_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
379 komodo_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
380
381 if TARGET_WINDOWS
382 komodo_cli_SOURCES += bitcoin-cli-res.rc
383 endif
384
385 komodo_cli_LDADD = \
386   $(LIBBITCOIN_CLI) \
387   $(LIBBITCOIN_UTIL) \
388   $(BOOST_LIBS) \
389   $(SSL_LIBS) \
390   $(CRYPTO_LIBS) \
391   $(LIBZCASH) \
392   $(LIBBITCOIN_CRYPTO) \
393   $(LIBZCASH_LIBS)
394 #
395
396 # bitcoin-tx binary #
397 bitcoin_tx_SOURCES = bitcoin-tx.cpp
398 bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
399 bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
400
401 if TARGET_WINDOWS
402 bitcoin_tx_SOURCES += bitcoin-tx-res.rc
403 endif
404
405 # FIXME: Is libzcash needed for bitcoin_tx?
406 bitcoin_tx_LDADD = \
407   $(LIBBITCOIN_UNIVALUE) \
408   $(LIBBITCOIN_COMMON) \
409   $(LIBBITCOIN_UTIL) \
410   $(LIBSECP256K1) \
411   $(LIBZCASH) \
412   $(LIBBITCOIN_CRYPTO) \
413   $(LIBZCASH_LIBS)
414
415 bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
416 #
417
418 # zcash protocol primitives #
419 libzcash_a_SOURCES = \
420   zcash/IncrementalMerkleTree.cpp \
421   zcash/NoteEncryption.cpp \
422   zcash/Address.cpp \
423   zcash/JoinSplit.cpp \
424   zcash/Proof.cpp \
425   zcash/Note.cpp \
426   zcash/prf.cpp \
427   zcash/util.cpp \
428   zcash/circuit/commitment.tcc \
429   zcash/circuit/gadget.tcc \
430   zcash/circuit/merkle.tcc \
431   zcash/circuit/note.tcc \
432   zcash/circuit/prfs.tcc \
433   zcash/circuit/utils.tcc
434
435 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)
436
437 libzcash_a_CXXFLAGS = $(HARDENED_CXXFLAGS) -fwrapv -fno-strict-aliasing
438
439 libzcash_a_LDFLAGS = $(HARDENED_LDFLAGS)
440
441 libzcash_a_CPPFLAGS += -DMONTGOMERY_OUTPUT
442
443 # bitcoinconsensus library #
444 if BUILD_BITCOIN_LIBS
445 include_HEADERS = script/bitcoinconsensus.h
446 libbitcoinconsensus_la_SOURCES = \
447   crypto/equihash.cpp \
448   crypto/hmac_sha512.cpp \
449   crypto/ripemd160.cpp \
450   crypto/sha1.cpp \
451   crypto/sha256.cpp \
452   crypto/sha512.cpp \
453   eccryptoverify.cpp \
454   ecwrapper.cpp \
455   hash.cpp \
456   primitives/transaction.cpp \
457   pubkey.cpp \
458   script/bitcoinconsensus.cpp \
459   script/interpreter.cpp \
460   script/script.cpp \
461   uint256.cpp \
462   utilstrencodings.cpp
463
464 if GLIBC_BACK_COMPAT
465   libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
466 endif
467
468 libbitcoinconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)
469 libbitcoinconsensus_la_LIBADD = $(CRYPTO_LIBS)
470 libbitcoinconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BITCOIN_INTERNAL
471
472 endif
473 #
474
475 CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno
476
477 DISTCLEANFILES = obj/build.h
478
479 EXTRA_DIST = leveldb
480
481 clean-local:
482         -$(MAKE) -C leveldb clean
483         -$(MAKE) -C secp256k1 clean
484         rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
485         -rm -f config.h
486
487 .rc.o:
488         @test -f $(WINDRES)
489         $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
490
491 .mm.o:
492         $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
493           $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS)  -c -o $@ $<
494
495 check-symbols: $(bin_PROGRAMS)
496 if GLIBC_BACK_COMPAT
497         @echo "Checking glibc back compat of [$(bin_PROGRAMS)]..."
498         $(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(top_srcdir)/contrib/devtools/symbol-check.py < $(bin_PROGRAMS)
499 endif
500
501 check-security: $(bin_PROGRAMS)
502 if HARDEN
503         @echo "Checking binary security of [$(bin_PROGRAMS)]..."
504         $(AM_V_at) READELF=$(READELF) OBJDUMP=$(OBJDUMP) $(top_srcdir)/contrib/devtools/security-check.py < $(bin_PROGRAMS)
505 endif
506
507 %.pb.cc %.pb.h: %.proto
508         @test -f $(PROTOC)
509         $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
510
511 if ENABLE_TESTS
512 include Makefile.test.include
513 include Makefile.gtest.include
514 endif
515
516 if ENABLE_QT
517 include Makefile.qt.include
518 endif
519
520 if ENABLE_QT_TESTS
521 include Makefile.qttest.include
522 endif
523
524 include Makefile.zcash.include
This page took 0.050889 seconds and 4 git commands to generate.