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