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