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