]> Git Repo - VerusCoin.git/blob - src/Makefile.am
Update libsecp256k1.
[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)"
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
35 $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
36         $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
37
38 # Make is not made aware of per-object dependencies to avoid limiting building parallelization
39 # But to build the less dependent modules first, we manually select their order here:
40 EXTRA_LIBRARIES = \
41   crypto/libbitcoin_crypto.a \
42   libbitcoin_util.a \
43   libbitcoin_common.a \
44   univalue/libbitcoin_univalue.a \
45   libbitcoin_server.a \
46   libbitcoin_cli.a
47 if ENABLE_WALLET
48 BITCOIN_INCLUDES += $(BDB_CPPFLAGS)
49 EXTRA_LIBRARIES += libbitcoin_wallet.a
50 endif
51
52 if BUILD_BITCOIN_LIBS
53 lib_LTLIBRARIES = libbitcoinconsensus.la
54 LIBBITCOIN_CONSENSUS=libbitcoinconsensus.la
55 else
56 LIBBITCOIN_CONSENSUS=
57 endif
58
59 bin_PROGRAMS =
60 TESTS =
61
62 if BUILD_BITCOIND
63   bin_PROGRAMS += bitcoind
64 endif
65
66 if BUILD_BITCOIN_UTILS
67   bin_PROGRAMS += bitcoin-cli bitcoin-tx
68 endif
69
70 .PHONY: FORCE
71 # bitcoin core #
72 BITCOIN_CORE_H = \
73   addrman.h \
74   alert.h \
75   amount.h \
76   arith_uint256.h \
77   base58.h \
78   bloom.h \
79   chain.h \
80   chainparamsbase.h \
81   chainparams.h \
82   chainparamsseeds.h \
83   checkpoints.h \
84   checkqueue.h \
85   clientversion.h \
86   coincontrol.h \
87   coins.h \
88   compat.h \
89   compressor.h \
90   consensus/params.h \
91   core_io.h \
92   wallet/db.h \
93   eccryptoverify.h \
94   ecwrapper.h \
95   hash.h \
96   init.h \
97   key.h \
98   keystore.h \
99   leveldbwrapper.h \
100   limitedmap.h \
101   main.h \
102   merkleblock.h \
103   miner.h \
104   mruset.h \
105   netbase.h \
106   net.h \
107   noui.h \
108   pow.h \
109   primitives/block.h \
110   primitives/transaction.h \
111   protocol.h \
112   pubkey.h \
113   random.h \
114   rpcclient.h \
115   rpcprotocol.h \
116   rpcserver.h \
117   script/interpreter.h \
118   script/script_error.h \
119   script/script.h \
120   script/sigcache.h \
121   script/sign.h \
122   script/standard.h \
123   serialize.h \
124   streams.h \
125   support/allocators/secure.h \
126   support/allocators/zeroafterfree.h \
127   support/cleanse.h \
128   support/pagelocker.h \
129   sync.h \
130   threadsafety.h \
131   timedata.h \
132   tinyformat.h \
133   txdb.h \
134   txmempool.h \
135   ui_interface.h \
136   uint256.h \
137   undo.h \
138   util.h \
139   utilmoneystr.h \
140   utilstrencodings.h \
141   utiltime.h \
142   validationinterface.h \
143   version.h \
144   wallet/crypter.h \
145   wallet/walletdb.h \
146   wallet/wallet.h \
147   wallet/wallet_ismine.h \
148   compat/byteswap.h \
149   compat/endian.h \
150   compat/sanity.h
151
152 JSON_H = \
153   json/json_spirit.h \
154   json/json_spirit_error_position.h \
155   json/json_spirit_reader.h \
156   json/json_spirit_reader_template.h \
157   json/json_spirit_stream_reader.h \
158   json/json_spirit_utils.h \
159   json/json_spirit_value.h \
160   json/json_spirit_writer.h \
161   json/json_spirit_writer_template.h
162
163 obj/build.h: FORCE
164         @$(MKDIR_P) $(builddir)/obj
165         @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
166           $(abs_top_srcdir)
167 libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
168
169 # server: shared between bitcoind and bitcoin-qt
170 libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
171 libbitcoin_server_a_SOURCES = \
172   addrman.cpp \
173   alert.cpp \
174   bloom.cpp \
175   chain.cpp \
176   checkpoints.cpp \
177   init.cpp \
178   leveldbwrapper.cpp \
179   main.cpp \
180   merkleblock.cpp \
181   miner.cpp \
182   net.cpp \
183   noui.cpp \
184   pow.cpp \
185   rest.cpp \
186   rpcblockchain.cpp \
187   rpcmining.cpp \
188   rpcmisc.cpp \
189   rpcnet.cpp \
190   rpcrawtransaction.cpp \
191   rpcserver.cpp \
192   script/sigcache.cpp \
193   timedata.cpp \
194   txdb.cpp \
195   txmempool.cpp \
196   validationinterface.cpp \
197   $(JSON_H) \
198   $(BITCOIN_CORE_H)
199
200 # wallet: shared between bitcoind and bitcoin-qt, but only linked
201 # when wallet enabled
202 libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
203 libbitcoin_wallet_a_SOURCES = \
204   wallet/crypter.cpp \
205   wallet/db.cpp \
206   wallet/rpcdump.cpp \
207   wallet/rpcwallet.cpp \
208   wallet/wallet.cpp \
209   wallet/wallet_ismine.cpp \
210   wallet/walletdb.cpp \
211   $(BITCOIN_CORE_H)
212
213 # crypto primitives library
214 crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES)
215 crypto_libbitcoin_crypto_a_SOURCES = \
216   crypto/sha1.cpp \
217   crypto/sha256.cpp \
218   crypto/sha512.cpp \
219   crypto/hmac_sha256.cpp \
220   crypto/hmac_sha512.cpp \
221   crypto/ripemd160.cpp \
222   crypto/common.h \
223   crypto/sha256.h \
224   crypto/sha512.h \
225   crypto/hmac_sha256.h \
226   crypto/hmac_sha512.h \
227   crypto/sha1.h \
228   crypto/ripemd160.h
229
230 # univalue JSON library
231 univalue_libbitcoin_univalue_a_SOURCES = \
232   univalue/univalue.cpp \
233   univalue/univalue_read.cpp \
234   univalue/univalue_write.cpp \
235   univalue/univalue_escapes.h \
236   univalue/univalue.h
237
238 # common: shared between bitcoind, and bitcoin-qt and non-server tools
239 libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
240 libbitcoin_common_a_SOURCES = \
241   arith_uint256.cpp \
242   amount.cpp \
243   base58.cpp \
244   chainparams.cpp \
245   coins.cpp \
246   compressor.cpp \
247   primitives/block.cpp \
248   primitives/transaction.cpp \
249   core_read.cpp \
250   core_write.cpp \
251   eccryptoverify.cpp \
252   ecwrapper.cpp \
253   hash.cpp \
254   key.cpp \
255   keystore.cpp \
256   netbase.cpp \
257   protocol.cpp \
258   pubkey.cpp \
259   script/interpreter.cpp \
260   script/script.cpp \
261   script/sign.cpp \
262   script/standard.cpp \
263   script/script_error.cpp \
264   $(BITCOIN_CORE_H)
265
266 # util: shared between all executables.
267 # This library *must* be included to make sure that the glibc
268 # backward-compatibility objects and their sanity checks are linked.
269 libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
270 libbitcoin_util_a_SOURCES = \
271   support/pagelocker.cpp \
272   chainparamsbase.cpp \
273   clientversion.cpp \
274   compat/glibc_sanity.cpp \
275   compat/glibcxx_sanity.cpp \
276   compat/strnlen.cpp \
277   random.cpp \
278   rpcprotocol.cpp \
279   support/cleanse.cpp \
280   sync.cpp \
281   uint256.cpp \
282   util.cpp \
283   utilmoneystr.cpp \
284   utilstrencodings.cpp \
285   utiltime.cpp \
286   $(BITCOIN_CORE_H)
287
288 if GLIBC_BACK_COMPAT
289 libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
290 endif
291
292 # cli: shared between bitcoin-cli and bitcoin-qt
293 libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
294 libbitcoin_cli_a_SOURCES = \
295   rpcclient.cpp \
296   $(BITCOIN_CORE_H)
297
298 nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
299 #
300
301 # bitcoind binary #
302 bitcoind_SOURCES = bitcoind.cpp
303 bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES)
304 bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
305
306 if TARGET_WINDOWS
307 bitcoind_SOURCES += bitcoind-res.rc
308 endif
309
310 bitcoind_LDADD = \
311   $(LIBBITCOIN_SERVER) \
312   $(LIBBITCOIN_COMMON) \
313   $(LIBBITCOIN_UNIVALUE) \
314   $(LIBBITCOIN_UTIL) \
315   $(LIBBITCOIN_CRYPTO) \
316   $(LIBLEVELDB) \
317   $(LIBMEMENV) \
318   $(LIBSECP256K1)
319
320 if ENABLE_WALLET
321 bitcoind_LDADD += libbitcoin_wallet.a
322 endif
323
324 bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
325 #
326
327 # bitcoin-cli binary #
328 bitcoin_cli_SOURCES = bitcoin-cli.cpp
329 bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
330 bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
331
332 if TARGET_WINDOWS
333 bitcoin_cli_SOURCES += bitcoin-cli-res.rc
334 endif
335
336 bitcoin_cli_LDADD = \
337   $(LIBBITCOIN_CLI) \
338   $(LIBBITCOIN_UTIL) \
339   $(LIBSECP256K1)
340
341 bitcoin_cli_LDADD += $(BOOST_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
342 #
343
344 # bitcoin-tx binary #
345 bitcoin_tx_SOURCES = bitcoin-tx.cpp
346 bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
347 bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
348
349 bitcoin_tx_LDADD = \
350   $(LIBBITCOIN_UNIVALUE) \
351   $(LIBBITCOIN_COMMON) \
352   $(LIBBITCOIN_UTIL) \
353   $(LIBBITCOIN_CRYPTO) \
354   $(LIBSECP256K1)
355
356 bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
357 #
358
359 # bitcoinconsensus library #
360 if BUILD_BITCOIN_LIBS
361 include_HEADERS = script/bitcoinconsensus.h
362 libbitcoinconsensus_la_SOURCES = \
363   crypto/hmac_sha512.cpp \
364   crypto/ripemd160.cpp \
365   crypto/sha1.cpp \
366   crypto/sha256.cpp \
367   crypto/sha512.cpp \
368   eccryptoverify.cpp \
369   ecwrapper.cpp \
370   hash.cpp \
371   primitives/transaction.cpp \
372   pubkey.cpp \
373   script/bitcoinconsensus.cpp \
374   script/interpreter.cpp \
375   script/script.cpp \
376   uint256.cpp \
377   utilstrencodings.cpp
378
379 if GLIBC_BACK_COMPAT
380   libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
381 endif
382
383 libbitcoinconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)
384 libbitcoinconsensus_la_LIBADD = $(CRYPTO_LIBS)
385 libbitcoinconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BITCOIN_INTERNAL
386
387 endif
388 #
389
390 CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno
391
392 DISTCLEANFILES = obj/build.h
393
394 EXTRA_DIST = leveldb
395
396 clean-local:
397         -$(MAKE) -C leveldb clean
398         -$(MAKE) -C secp256k1 clean
399         rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
400         -rm -f config.h
401
402 .rc.o:
403         @test -f $(WINDRES)
404         $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
405
406 .mm.o:
407         $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
408           $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS)  -c -o $@ $<
409
410 %.pb.cc %.pb.h: %.proto
411         @test -f $(PROTOC)
412         $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
413
414 if ENABLE_TESTS
415 include Makefile.test.include
416 endif
417
418 if ENABLE_QT
419 include Makefile.qt.include
420 endif
421
422 if ENABLE_QT_TESTS
423 include Makefile.qttest.include
424 endif
This page took 0.04697 seconds and 4 git commands to generate.