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