Mercurial > hg > bitcoin
annotate src/makefile.unix @ 2968:04987f8907d6 draft
Merge branch '0.5.x' into 0.6.0.x
Conflicts:
src/main.cpp
author | Luke Dashjr <luke-jr+git@utopios.org> |
---|---|
date | Fri, 04 May 2012 19:55:54 +0000 |
parents | c68e3fa36257 |
children | 6d9afd854c97 |
rev | line source |
---|---|
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
1 # Copyright (c) 2009-2010 Satoshi Nakamoto |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
2 # Distributed under the MIT/X11 software license, see the accompanying |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
3 # file license.txt or http://www.opensource.org/licenses/mit-license.php. |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
4 |
744
e98b41d99e48
Revert "Make UPnP default on Bitcoin but not on Bitcoind."
Matt Corallo <matt@bluematt.me>
parents:
726
diff
changeset
|
5 USE_UPNP:=0 |
e98b41d99e48
Revert "Make UPnP default on Bitcoin but not on Bitcoind."
Matt Corallo <matt@bluematt.me>
parents:
726
diff
changeset
|
6 |
1409
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
7 DEFS=-DNOPCH |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
8 |
1597
12cf0a8687a4
Rework unit tests so test_bitcoin.cpp does not #include them all
Gavin Andresen <gavinandresen@gmail.com>
parents:
1583
diff
changeset
|
9 DEFS += $(addprefix -I,$(CURDIR) $(BOOST_INCLUDE_PATH) $(BDB_INCLUDE_PATH) $(OPENSSL_INCLUDE_PATH)) |
1996
162b131b7200
Properly include $*_LIB_PATH in makefile.unix
Matt Corallo <matt@bluematt.me>
parents:
1968
diff
changeset
|
10 LIBS = $(addprefix -L,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH)) |
1409
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
11 |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
12 LMODE = dynamic |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
13 LMODE2 = dynamic |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
14 ifdef STATIC |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
15 LMODE = static |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
16 ifeq (${STATIC}, all) |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
17 LMODE2 = static |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
18 endif |
1967
739785b450e6
Bugfix: Support building test_bitcoin with shared-object boost test framework
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1691
diff
changeset
|
19 else |
739785b450e6
Bugfix: Support building test_bitcoin with shared-object boost test framework
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1691
diff
changeset
|
20 TESTDEFS += -DBOOST_TEST_DYN_LINK |
1409
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
21 endif |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
22 |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
23 # for boost 1.37, add -mt to the boost libraries |
1996
162b131b7200
Properly include $*_LIB_PATH in makefile.unix
Matt Corallo <matt@bluematt.me>
parents:
1968
diff
changeset
|
24 LIBS += \ |
1409
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
25 -Wl,-B$(LMODE) \ |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
26 -l boost_system$(BOOST_LIB_SUFFIX) \ |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
27 -l boost_filesystem$(BOOST_LIB_SUFFIX) \ |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
28 -l boost_program_options$(BOOST_LIB_SUFFIX) \ |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
29 -l boost_thread$(BOOST_LIB_SUFFIX) \ |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
30 -l db_cxx$(BDB_LIB_SUFFIX) \ |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
31 -l ssl \ |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
32 -l crypto |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
33 |
1409
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
34 ifndef USE_UPNP |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
35 override USE_UPNP = - |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
36 endif |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
37 ifneq (${USE_UPNP}, -) |
744
e98b41d99e48
Revert "Make UPnP default on Bitcoin but not on Bitcoind."
Matt Corallo <matt@bluematt.me>
parents:
726
diff
changeset
|
38 LIBS += -l miniupnpc |
e98b41d99e48
Revert "Make UPnP default on Bitcoin but not on Bitcoind."
Matt Corallo <matt@bluematt.me>
parents:
726
diff
changeset
|
39 DEFS += -DUSE_UPNP=$(USE_UPNP) |
e98b41d99e48
Revert "Make UPnP default on Bitcoin but not on Bitcoind."
Matt Corallo <matt@bluematt.me>
parents:
726
diff
changeset
|
40 endif |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
41 |
1409
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
42 ifneq (${USE_SSL}, 0) |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
43 DEFS += -DUSE_SSL |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
44 endif |
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
45 |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
46 LIBS+= \ |
1409
2526d1bab1db
Add support to makefile.unix for the same parameters used by bitcoin-qt.pro, dynamic linking unless STATIC=1 is passed
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1381
diff
changeset
|
47 -Wl,-B$(LMODE2) \ |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
48 -l z \ |
576
8ec6d5e778e5
Manual merge of jaromil's source tree reorg commit.
Jeff Garzik <jeff@garzik.org>
parents:
575
diff
changeset
|
49 -l dl \ |
8ec6d5e778e5
Manual merge of jaromil's source tree reorg commit.
Jeff Garzik <jeff@garzik.org>
parents:
575
diff
changeset
|
50 -l pthread |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
51 |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
52 |
950
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
53 # Hardening |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
54 # Make some classes of vulnerabilities unexploitable in case one is discovered. |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
55 # |
1665
dd922923468f
Added a workaround for an Ubuntu bug which causes -fstack-protector-all to be disregarded.
cjdelisle <calebdelisle@lavabit.com>
parents:
1664
diff
changeset
|
56 # This is a workaround for Ubuntu bug #691722, the default -fstack-protector causes |
dd922923468f
Added a workaround for an Ubuntu bug which causes -fstack-protector-all to be disregarded.
cjdelisle <calebdelisle@lavabit.com>
parents:
1664
diff
changeset
|
57 # -fstack-protector-all to be ignored unless -fno-stack-protector is used first. |
dd922923468f
Added a workaround for an Ubuntu bug which causes -fstack-protector-all to be disregarded.
cjdelisle <calebdelisle@lavabit.com>
parents:
1664
diff
changeset
|
58 # see: https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/691722 |
dd922923468f
Added a workaround for an Ubuntu bug which causes -fstack-protector-all to be disregarded.
cjdelisle <calebdelisle@lavabit.com>
parents:
1664
diff
changeset
|
59 HARDENING=-fno-stack-protector |
dd922923468f
Added a workaround for an Ubuntu bug which causes -fstack-protector-all to be disregarded.
cjdelisle <calebdelisle@lavabit.com>
parents:
1664
diff
changeset
|
60 |
950
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
61 # Stack Canaries |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
62 # Put numbers at the beginning of each stack frame and check that they are the same. |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
63 # If a stack buffer if overflowed, it writes over the canary number and then on return |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
64 # when that number is checked, it won't be the same and the program will exit with |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
65 # a "Stack smashing detected" error instead of being exploited. |
1665
dd922923468f
Added a workaround for an Ubuntu bug which causes -fstack-protector-all to be disregarded.
cjdelisle <calebdelisle@lavabit.com>
parents:
1664
diff
changeset
|
66 HARDENING+=-fstack-protector-all -Wstack-protector |
950
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
67 |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
68 # Make some important things such as the global offset table read only as soon as |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
69 # the dynamic linker is finished building it. This will prevent overwriting of addresses |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
70 # which would later be jumped to. |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
71 HARDENING+=-Wl,-z,relro -Wl,-z,now |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
72 |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
73 # Build position independent code to take advantage of Address Space Layout Randomization |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
74 # offered by some kernels. |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
75 # see doc/build-unix.txt for more information. |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
76 ifdef PIE |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
77 HARDENING+=-fPIE -pie |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
78 endif |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
79 |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
80 # -D_FORTIFY_SOURCE=2 does some checking for potentially exploitable code patterns in |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
81 # the source such overflowing a statically defined buffer. |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
82 HARDENING+=-D_FORTIFY_SOURCE=2 |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
83 # |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
84 |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
85 |
1320 | 86 DEBUGFLAGS=-g |
1416
44496613cb1a
Allow users to customize CXX, CXXFLAGS, and LDFLAGS normally
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1409
diff
changeset
|
87 CXXFLAGS=-O2 |
2061
7a72b37941e6
Avoid some pointless warnings while compiling
Pierre Pronchery <khorben@defora.org>
parents:
1848
diff
changeset
|
88 xCXXFLAGS=-pthread -Wextra -Wno-sign-compare -Wno-char-subscripts -Wno-invalid-offsetof -Wformat -Wformat-security \ |
1749
a16663dadac9
Compile with extra warnings turned on. And more makefile/code tidying up.
Gavin Andresen <gavinandresen@gmail.com>
parents:
1744
diff
changeset
|
89 $(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS) |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
90 |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
91 OBJS= \ |
1689
e0b7a89bcaad
Moved checkpoints out of main, to prep for using them to help prevent DoS attacks
Gavin Andresen <gavinandresen@gmail.com>
parents:
1665
diff
changeset
|
92 obj/checkpoints.o \ |
1731
4a2d4c136998
Network stack refactor
Pieter Wuille <pieter.wuille@gmail.com>
parents:
1597
diff
changeset
|
93 obj/netbase.o \ |
1911
a9190d020909
CAddrMan: stochastic address manager
Pieter Wuille <pieter.wuille@gmail.com>
parents:
1848
diff
changeset
|
94 obj/addrman.o \ |
874
2e1afcc5958d
Cleanup makefiles such that diffs to them are smaller
Giel van Schijndel <me@mortis.eu>
parents:
869
diff
changeset
|
95 obj/crypter.o \ |
1580
d7f244465cd6
Add GetSecret() and GetKeys() to CKeyStore
Pieter Wuille <pieter.wuille@gmail.com>
parents:
1539
diff
changeset
|
96 obj/key.o \ |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
97 obj/db.o \ |
874
2e1afcc5958d
Cleanup makefiles such that diffs to them are smaller
Giel van Schijndel <me@mortis.eu>
parents:
869
diff
changeset
|
98 obj/init.o \ |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
99 obj/irc.o \ |
689
9df222fa1ef1
move wallet code to separate file
Pieter Wuille <pieter.wuille@gmail.com>
parents:
576
diff
changeset
|
100 obj/keystore.o \ |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
101 obj/main.o \ |
874
2e1afcc5958d
Cleanup makefiles such that diffs to them are smaller
Giel van Schijndel <me@mortis.eu>
parents:
869
diff
changeset
|
102 obj/net.o \ |
876
b5abe85df1e7
Start moving protocol-specific code to protocol.[ch]pp
Giel van Schijndel <me@mortis.eu>
parents:
874
diff
changeset
|
103 obj/protocol.o \ |
1294
8c70236c9f87
assure that base bitcoind and bitcoin still build
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
901
diff
changeset
|
104 obj/bitcoinrpc.o \ |
1583
df45e8721f53
Key import and export
Pieter Wuille <pieter.wuille@gmail.com>
parents:
1580
diff
changeset
|
105 obj/rpcdump.o \ |
874
2e1afcc5958d
Cleanup makefiles such that diffs to them are smaller
Giel van Schijndel <me@mortis.eu>
parents:
869
diff
changeset
|
106 obj/script.o \ |
2e1afcc5958d
Cleanup makefiles such that diffs to them are smaller
Giel van Schijndel <me@mortis.eu>
parents:
869
diff
changeset
|
107 obj/util.o \ |
1359
08006bbf6cf3
remove cryptopp dependency, add simple unittest for SHA256Transform()
Nils Schneider <nils.schneider@gmail.com>
parents:
1321
diff
changeset
|
108 obj/wallet.o |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
109 |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
110 |
1320 | 111 all: bitcoind |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
112 |
1381
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
113 # auto-generated dependencies: |
1749
a16663dadac9
Compile with extra warnings turned on. And more makefile/code tidying up.
Gavin Andresen <gavinandresen@gmail.com>
parents:
1744
diff
changeset
|
114 -include obj/*.P |
1968
4d0d49b1343f
Rename src/obj/test to src/obj-test to workaround bug in older GNU Make
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1967
diff
changeset
|
115 -include obj-test/*.P |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
116 |
1749
a16663dadac9
Compile with extra warnings turned on. And more makefile/code tidying up.
Gavin Andresen <gavinandresen@gmail.com>
parents:
1744
diff
changeset
|
117 obj/%.o: %.cpp |
1416
44496613cb1a
Allow users to customize CXX, CXXFLAGS, and LDFLAGS normally
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1409
diff
changeset
|
118 $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $< |
1381
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
119 @cp $(@:%.o=%.d) $(@:%.o=%.P); \ |
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
120 sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ |
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
121 -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \ |
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
122 rm -f $(@:%.o=%.d) |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
123 |
1749
a16663dadac9
Compile with extra warnings turned on. And more makefile/code tidying up.
Gavin Andresen <gavinandresen@gmail.com>
parents:
1744
diff
changeset
|
124 bitcoind: $(OBJS:obj/%=obj/%) |
1416
44496613cb1a
Allow users to customize CXX, CXXFLAGS, and LDFLAGS normally
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1409
diff
changeset
|
125 $(CXX) $(xCXXFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
126 |
1780
e2560d4a0650
Rename src/obj/test to src/obj-test to workaround bug in older GNU Make
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1779
diff
changeset
|
127 TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) |
1597
12cf0a8687a4
Rework unit tests so test_bitcoin.cpp does not #include them all
Gavin Andresen <gavinandresen@gmail.com>
parents:
1583
diff
changeset
|
128 |
1968
4d0d49b1343f
Rename src/obj/test to src/obj-test to workaround bug in older GNU Make
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1967
diff
changeset
|
129 obj-test/%.o: test/%.cpp |
1967
739785b450e6
Bugfix: Support building test_bitcoin with shared-object boost test framework
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1691
diff
changeset
|
130 $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -o $@ $< |
1381
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
131 @cp $(@:%.o=%.d) $(@:%.o=%.P); \ |
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
132 sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ |
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
133 -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \ |
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
134 rm -f $(@:%.o=%.d) |
708
06d213590314
Boost unit-testing framework.
Gavin Andresen <gavinandresen@gmail.com>
parents:
689
diff
changeset
|
135 |
1749
a16663dadac9
Compile with extra warnings turned on. And more makefile/code tidying up.
Gavin Andresen <gavinandresen@gmail.com>
parents:
1744
diff
changeset
|
136 test_bitcoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) |
1967
739785b450e6
Bugfix: Support building test_bitcoin with shared-object boost test framework
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1691
diff
changeset
|
137 $(CXX) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-B$(LMODE) -lboost_unit_test_framework $(LDFLAGS) $(LIBS) |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
138 |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
139 clean: |
1320 | 140 -rm -f bitcoind test_bitcoin |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
141 -rm -f obj/*.o |
1968
4d0d49b1343f
Rename src/obj/test to src/obj-test to workaround bug in older GNU Make
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1967
diff
changeset
|
142 -rm -f obj-test/*.o |
1381
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
143 -rm -f obj/*.P |
1968
4d0d49b1343f
Rename src/obj/test to src/obj-test to workaround bug in older GNU Make
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1967
diff
changeset
|
144 -rm -f obj-test/*.P |