]> Git Repo - VerusCoin.git/blob - src/Makefile.am
Merge pull request #5112
[VerusCoin.git] / src / Makefile.am
1 AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
2
3 if USE_LIBSECP256K1
4 secp256k1/libsecp256k1.la: $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
5         @$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
6 endif
7
8 if EMBEDDED_LEVELDB
9 LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include
10 LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv
11 LIBLEVELDB += $(builddir)/leveldb/libleveldb.a
12 LIBMEMENV  += $(builddir)/leveldb/libmemenv.a
13
14 # 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
15 $(LIBLEVELDB): $(LIBMEMENV)
16
17 $(LIBLEVELDB) $(LIBMEMENV):
18         @echo "Building LevelDB ..." && $(MAKE) -C $(@D) $(@F) CXX="$(CXX)" \
19           CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \
20           OPT="$(CXXFLAGS) $(CPPFLAGS)"
21 endif
22
23 BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
24 BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
25
26 if USE_LIBSECP256K1
27 BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
28 endif
29
30 LIBBITCOIN_SERVER=libbitcoin_server.a
31 LIBBITCOIN_WALLET=libbitcoin_wallet.a
32 LIBBITCOIN_COMMON=libbitcoin_common.a
33 LIBBITCOIN_CLI=libbitcoin_cli.a
34 LIBBITCOIN_UTIL=libbitcoin_util.a
35 LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
36 LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a
37 LIBBITCOINQT=qt/libbitcoinqt.a
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 noinst_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 if ENABLE_WALLET
49 BITCOIN_INCLUDES += $(BDB_CPPFLAGS)
50 noinst_LIBRARIES += libbitcoin_wallet.a
51 endif
52
53 bin_PROGRAMS =
54 TESTS =
55
56 if BUILD_BITCOIND
57   bin_PROGRAMS += bitcoind
58 endif
59
60 if BUILD_BITCOIN_UTILS
61   bin_PROGRAMS += bitcoin-cli bitcoin-tx
62 endif
63
64 .PHONY: FORCE
65 # bitcoin core #
66 BITCOIN_CORE_H = \
67   addrman.h \
68   alert.h \
69   allocators.h \
70   amount.h \
71   base58.h \
72   bloom.h \
73   chain.h \
74   chainparams.h \
75   chainparamsbase.h \
76   chainparamsseeds.h \
77   checkpoints.h \
78   checkqueue.h \
79   clientversion.h \
80   coincontrol.h \
81   coins.h \
82   compat.h \
83   core.h \
84   core_io.h \
85   crypter.h \
86   db.h \
87   hash.h \
88   init.h \
89   key.h \
90   keystore.h \
91   leveldbwrapper.h \
92   limitedmap.h \
93   main.h \
94   miner.h \
95   mruset.h \
96   netbase.h \
97   net.h \
98   noui.h \
99   pow.h \
100   protocol.h \
101   random.h \
102   rpcclient.h \
103   rpcprotocol.h \
104   rpcserver.h \
105   script/compressor.h \
106   script/interpreter.h \
107   script/script.h \
108   script/sigcache.h \
109   script/sign.h \
110   script/standard.h \
111   serialize.h \
112   streams.h \
113   sync.h \
114   threadsafety.h \
115   timedata.h \
116   tinyformat.h \
117   txdb.h \
118   txmempool.h \
119   ui_interface.h \
120   uint256.h \
121   util.h \
122   utilstrencodings.h \
123   utilmoneystr.h \
124   utiltime.h \
125   version.h \
126   wallet.h \
127   wallet_ismine.h \
128   walletdb.h \
129   compat/sanity.h
130
131 JSON_H = \
132   json/json_spirit.h \
133   json/json_spirit_error_position.h \
134   json/json_spirit_reader.h \
135   json/json_spirit_reader_template.h \
136   json/json_spirit_stream_reader.h \
137   json/json_spirit_utils.h \
138   json/json_spirit_value.h \
139   json/json_spirit_writer.h \
140   json/json_spirit_writer_template.h
141
142 obj/build.h: FORCE
143         @$(MKDIR_P) $(builddir)/obj
144         @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
145           $(abs_top_srcdir)
146 libbitcoin_util_a-version.$(OBJEXT): obj/build.h
147
148 # server: shared between bitcoind and bitcoin-qt
149 libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
150 libbitcoin_server_a_SOURCES = \
151   addrman.cpp \
152   alert.cpp \
153   bloom.cpp \
154   chain.cpp \
155   checkpoints.cpp \
156   init.cpp \
157   leveldbwrapper.cpp \
158   main.cpp \
159   miner.cpp \
160   net.cpp \
161   noui.cpp \
162   pow.cpp \
163   rpcblockchain.cpp \
164   rpcmining.cpp \
165   rpcmisc.cpp \
166   rpcnet.cpp \
167   rpcrawtransaction.cpp \
168   rpcserver.cpp \
169   timedata.cpp \
170   txdb.cpp \
171   txmempool.cpp \
172   $(JSON_H) \
173   $(BITCOIN_CORE_H)
174
175 # wallet: shared between bitcoind and bitcoin-qt, but only linked
176 # when wallet enabled
177 libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
178 libbitcoin_wallet_a_SOURCES = \
179   db.cpp \
180   crypter.cpp \
181   rpcdump.cpp \
182   rpcwallet.cpp \
183   wallet.cpp \
184   wallet_ismine.cpp \
185   walletdb.cpp \
186   $(BITCOIN_CORE_H)
187
188 # crypto primitives library
189 crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES)
190 crypto_libbitcoin_crypto_a_SOURCES = \
191   crypto/sha1.cpp \
192   crypto/sha2.cpp \
193   crypto/ripemd160.cpp \
194   crypto/common.h \
195   crypto/sha2.h \
196   crypto/sha1.h \
197   crypto/ripemd160.h
198
199 # univalue JSON library
200 univalue_libbitcoin_univalue_a_SOURCES = \
201   univalue/univalue.cpp \
202   univalue/univalue_read.cpp \
203   univalue/univalue_write.cpp \
204   univalue/univalue_escapes.h \
205   univalue/univalue.h
206
207 # common: shared between bitcoind, and bitcoin-qt and non-server tools
208 libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
209 libbitcoin_common_a_SOURCES = \
210   allocators.cpp \
211   base58.cpp \
212   chainparams.cpp \
213   coins.cpp \
214   core.cpp \
215   core_read.cpp \
216   core_write.cpp \
217   hash.cpp \
218   key.cpp \
219   keystore.cpp \
220   netbase.cpp \
221   protocol.cpp \
222   script/compressor.cpp \
223   script/interpreter.cpp \
224   script/script.cpp \
225   script/sigcache.cpp \
226   script/sign.cpp \
227   script/standard.cpp \
228   $(BITCOIN_CORE_H)
229
230 # util: shared between all executables.
231 # This library *must* be included to make sure that the glibc
232 # backward-compatibility objects and their sanity checks are linked.
233 libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
234 libbitcoin_util_a_SOURCES = \
235   compat/glibc_sanity.cpp \
236   compat/glibcxx_sanity.cpp \
237   chainparamsbase.cpp \
238   random.cpp \
239   rpcprotocol.cpp \
240   sync.cpp \
241   uint256.cpp \
242   util.cpp \
243   utilstrencodings.cpp \
244   utilmoneystr.cpp \
245   utiltime.cpp \
246   version.cpp \
247   $(BITCOIN_CORE_H)
248
249 if GLIBC_BACK_COMPAT
250 libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
251 libbitcoin_util_a_SOURCES += compat/glibcxx_compat.cpp
252 endif
253
254 # cli: shared between bitcoin-cli and bitcoin-qt
255 libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
256 libbitcoin_cli_a_SOURCES = \
257   rpcclient.cpp \
258   $(BITCOIN_CORE_H)
259
260 nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
261 #
262
263 # bitcoind binary #
264 bitcoind_LDADD = \
265   $(LIBBITCOIN_SERVER) \
266   $(LIBBITCOIN_COMMON) \
267   $(LIBBITCOIN_UNIVALUE) \
268   $(LIBBITCOIN_UTIL) \
269   $(LIBBITCOIN_CRYPTO) \
270   $(LIBLEVELDB) \
271   $(LIBMEMENV)
272
273 if USE_LIBSECP256K1
274   bitcoind_LDADD += secp256k1/libsecp256k1.la
275 endif
276
277 if ENABLE_WALLET
278 bitcoind_LDADD += libbitcoin_wallet.a
279 endif
280 bitcoind_SOURCES = bitcoind.cpp
281 #
282
283 if TARGET_WINDOWS
284 bitcoind_SOURCES += bitcoind-res.rc
285 endif
286
287 bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
288 bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES)
289 bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS)
290
291 # bitcoin-cli binary #
292 bitcoin_cli_LDADD = \
293   $(LIBBITCOIN_CLI) \
294   $(LIBBITCOIN_COMMON) \
295   $(LIBBITCOIN_UTIL) \
296   $(LIBBITCOIN_CRYPTO) \
297   $(BOOST_LIBS) \
298   $(SSL_LIBS) \
299   $(CRYPTO_LIBS) \
300   $(MINIUPNPC_LIBS)
301
302 bitcoin_cli_SOURCES = \
303   bitcoin-cli.cpp
304
305 if USE_LIBSECP256K1
306   bitcoin_cli_LDADD += secp256k1/libsecp256k1.la
307 endif
308 bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
309 #
310
311 # bitcoin-tx binary #
312 bitcoin_tx_LDADD = \
313   $(LIBBITCOIN_UNIVALUE) \
314   $(LIBBITCOIN_COMMON) \
315   $(LIBBITCOIN_UTIL) \
316   $(LIBBITCOIN_CRYPTO)
317
318 if USE_LIBSECP256K1
319   bitcoin_tx_LDADD += secp256k1/libsecp256k1.la
320 endif
321
322   bitcoin_tx_LDADD += $(BOOST_LIBS) \
323   $(SSL_LIBS) \
324   $(CRYPTO_LIBS) \
325   $(MINIUPNPC_LIBS)
326
327 bitcoin_tx_SOURCES = bitcoin-tx.cpp
328 bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
329 #
330 bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS)
331
332 if TARGET_WINDOWS
333 bitcoin_cli_SOURCES += bitcoin-cli-res.rc
334 endif
335 bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS)
336
337 CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno
338
339 DISTCLEANFILES = obj/build.h
340
341 EXTRA_DIST = leveldb secp256k1
342
343 clean-local:
344         -$(MAKE) -C leveldb clean
345         -$(MAKE) -C secp256k1 clean 2>/dev/null
346         rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
347         -rm -f config.h
348
349 .rc.o:
350         @test -f $(WINDRES)
351         $(AM_V_GEN) $(WINDRES) -i $< -o $@
352
353 .mm.o:
354         $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
355           $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS)  -c -o $@ $<
356
357 %.pb.cc %.pb.h: %.proto
358         @test -f $(PROTOC)
359         $(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
360
361 if ENABLE_TESTS
362 include Makefile.test.include
363 endif
364
365 if ENABLE_QT
366 include Makefile.qt.include
367 endif
368
369 if ENABLE_QT_TESTS
370 include Makefile.qttest.include
371 endif
This page took 0.04453 seconds and 4 git commands to generate.