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