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