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