Mercurial > hg > bitcoin
annotate src/makefile.unix @ 1749:a16663dadac9 draft
Compile with extra warnings turned on. And more makefile/code tidying up.
This turns on most gcc warnings, and removes some unused variables and other code that triggers warnings.
Exceptions are:
-Wno-sign-compare : triggered by lots of comparisons of signed integer to foo.size(), which is unsigned.
-Wno-char-subscripts : triggered by the convert-to-hex functions (I may fix this in a future commit).
author | Gavin Andresen <gavinandresen@gmail.com> |
---|---|
date | Thu, 12 Jan 2012 20:02:47 -0500 |
parents | 7cd2a3969d75 |
children | 8d8818ba9501 |
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)) |
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
|
10 LIBS += $(addprefix -l,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH)) |
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 |
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
|
19 endif |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
20 |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
21 # for boost 1.37, add -mt to the boost libraries |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
22 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
|
23 -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
|
24 -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
|
25 -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
|
26 -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
|
27 -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
|
28 -l db_cxx$(BDB_LIB_SUFFIX) \ |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
29 -l ssl \ |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
30 -l crypto |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
31 |
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
|
32 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
|
33 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
|
34 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
|
35 ifneq (${USE_UPNP}, -) |
744
e98b41d99e48
Revert "Make UPnP default on Bitcoin but not on Bitcoind."
Matt Corallo <matt@bluematt.me>
parents:
726
diff
changeset
|
36 LIBS += -l miniupnpc |
e98b41d99e48
Revert "Make UPnP default on Bitcoin but not on Bitcoind."
Matt Corallo <matt@bluematt.me>
parents:
726
diff
changeset
|
37 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
|
38 endif |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
39 |
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
|
40 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
|
41 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
|
42 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
|
43 |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
44 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
|
45 -Wl,-B$(LMODE2) \ |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
46 -l z \ |
576
8ec6d5e778e5
Manual merge of jaromil's source tree reorg commit.
Jeff Garzik <jeff@garzik.org>
parents:
575
diff
changeset
|
47 -l dl \ |
8ec6d5e778e5
Manual merge of jaromil's source tree reorg commit.
Jeff Garzik <jeff@garzik.org>
parents:
575
diff
changeset
|
48 -l pthread |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
49 |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
50 |
950
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
51 # Hardening |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
52 # 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
|
53 # |
1421
a56a8bf3076e
Added a workaround for an Ubuntu bug which causes -fstack-protector-all to be disregarded.
cjdelisle <calebdelisle@lavabit.com>
parents:
1418
diff
changeset
|
54 # This is a workaround for Ubuntu bug #691722, the default -fstack-protector causes |
a56a8bf3076e
Added a workaround for an Ubuntu bug which causes -fstack-protector-all to be disregarded.
cjdelisle <calebdelisle@lavabit.com>
parents:
1418
diff
changeset
|
55 # -fstack-protector-all to be ignored unless -fno-stack-protector is used first. |
a56a8bf3076e
Added a workaround for an Ubuntu bug which causes -fstack-protector-all to be disregarded.
cjdelisle <calebdelisle@lavabit.com>
parents:
1418
diff
changeset
|
56 # see: https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/691722 |
a56a8bf3076e
Added a workaround for an Ubuntu bug which causes -fstack-protector-all to be disregarded.
cjdelisle <calebdelisle@lavabit.com>
parents:
1418
diff
changeset
|
57 HARDENING=-fno-stack-protector |
a56a8bf3076e
Added a workaround for an Ubuntu bug which causes -fstack-protector-all to be disregarded.
cjdelisle <calebdelisle@lavabit.com>
parents:
1418
diff
changeset
|
58 |
950
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
59 # Stack Canaries |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
60 # 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
|
61 # 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
|
62 # 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
|
63 # a "Stack smashing detected" error instead of being exploited. |
1421
a56a8bf3076e
Added a workaround for an Ubuntu bug which causes -fstack-protector-all to be disregarded.
cjdelisle <calebdelisle@lavabit.com>
parents:
1418
diff
changeset
|
64 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
|
65 |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
66 # 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
|
67 # 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
|
68 # which would later be jumped to. |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
69 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
|
70 |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
71 # 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
|
72 # offered by some kernels. |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
73 # 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
|
74 ifdef PIE |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
75 HARDENING+=-fPIE -pie |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
76 endif |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
77 |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
78 # -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
|
79 # 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
|
80 HARDENING+=-D_FORTIFY_SOURCE=2 |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
81 # |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
82 |
e5d23800c530
Add some hardening to protect against unknown/future exploits.
cjdelisle <calebdelisle@lavabit.com>
parents:
901
diff
changeset
|
83 |
1320 | 84 DEBUGFLAGS=-g |
1416
44496613cb1a
Allow users to customize CXX, CXXFLAGS, and LDFLAGS normally
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1409
diff
changeset
|
85 CXXFLAGS=-O2 |
1749
a16663dadac9
Compile with extra warnings turned on. And more makefile/code tidying up.
Gavin Andresen <gavinandresen@gmail.com>
parents:
1744
diff
changeset
|
86 xCXXFLAGS=-pthread -Wextra -Wno-sign-compare -Wno-char-subscripts -Wno-invalid-offsetof -Wformat-security \ |
a16663dadac9
Compile with extra warnings turned on. And more makefile/code tidying up.
Gavin Andresen <gavinandresen@gmail.com>
parents:
1744
diff
changeset
|
87 $(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS) |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
88 |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
89 OBJS= \ |
1539
6a0bd31000b1
Moved checkpoints out of main, to prep for using them to help prevent DoS attacks
Gavin Andresen <gavinandresen@gmail.com>
parents:
1421
diff
changeset
|
90 obj/checkpoints.o \ |
1731
4a2d4c136998
Network stack refactor
Pieter Wuille <pieter.wuille@gmail.com>
parents:
1597
diff
changeset
|
91 obj/netbase.o \ |
874
2e1afcc5958d
Cleanup makefiles such that diffs to them are smaller
Giel van Schijndel <me@mortis.eu>
parents:
869
diff
changeset
|
92 obj/crypter.o \ |
1580
d7f244465cd6
Add GetSecret() and GetKeys() to CKeyStore
Pieter Wuille <pieter.wuille@gmail.com>
parents:
1539
diff
changeset
|
93 obj/key.o \ |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
94 obj/db.o \ |
874
2e1afcc5958d
Cleanup makefiles such that diffs to them are smaller
Giel van Schijndel <me@mortis.eu>
parents:
869
diff
changeset
|
95 obj/init.o \ |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
96 obj/irc.o \ |
689
9df222fa1ef1
move wallet code to separate file
Pieter Wuille <pieter.wuille@gmail.com>
parents:
576
diff
changeset
|
97 obj/keystore.o \ |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
98 obj/main.o \ |
874
2e1afcc5958d
Cleanup makefiles such that diffs to them are smaller
Giel van Schijndel <me@mortis.eu>
parents:
869
diff
changeset
|
99 obj/net.o \ |
876
b5abe85df1e7
Start moving protocol-specific code to protocol.[ch]pp
Giel van Schijndel <me@mortis.eu>
parents:
874
diff
changeset
|
100 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
|
101 obj/bitcoinrpc.o \ |
1583
df45e8721f53
Key import and export
Pieter Wuille <pieter.wuille@gmail.com>
parents:
1580
diff
changeset
|
102 obj/rpcdump.o \ |
874
2e1afcc5958d
Cleanup makefiles such that diffs to them are smaller
Giel van Schijndel <me@mortis.eu>
parents:
869
diff
changeset
|
103 obj/script.o \ |
2e1afcc5958d
Cleanup makefiles such that diffs to them are smaller
Giel van Schijndel <me@mortis.eu>
parents:
869
diff
changeset
|
104 obj/util.o \ |
1359
08006bbf6cf3
remove cryptopp dependency, add simple unittest for SHA256Transform()
Nils Schneider <nils.schneider@gmail.com>
parents:
1321
diff
changeset
|
105 obj/wallet.o |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
106 |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
107 |
1320 | 108 all: bitcoind |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
109 |
1381
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
110 # 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
|
111 -include obj/*.P |
1381
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
112 -include obj/test/*.P |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
113 |
1749
a16663dadac9
Compile with extra warnings turned on. And more makefile/code tidying up.
Gavin Andresen <gavinandresen@gmail.com>
parents:
1744
diff
changeset
|
114 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
|
115 $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $< |
1381
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
116 @cp $(@:%.o=%.d) $(@:%.o=%.P); \ |
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
117 sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ |
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
118 -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \ |
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
119 rm -f $(@:%.o=%.d) |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
120 |
1749
a16663dadac9
Compile with extra warnings turned on. And more makefile/code tidying up.
Gavin Andresen <gavinandresen@gmail.com>
parents:
1744
diff
changeset
|
121 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
|
122 $(CXX) $(xCXXFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
123 |
1597
12cf0a8687a4
Rework unit tests so test_bitcoin.cpp does not #include them all
Gavin Andresen <gavinandresen@gmail.com>
parents:
1583
diff
changeset
|
124 TESTOBJS := $(patsubst test/%.cpp,obj/test/%.o,$(wildcard test/*.cpp)) |
12cf0a8687a4
Rework unit tests so test_bitcoin.cpp does not #include them all
Gavin Andresen <gavinandresen@gmail.com>
parents:
1583
diff
changeset
|
125 |
1381
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
126 obj/test/%.o: test/%.cpp |
1416
44496613cb1a
Allow users to customize CXX, CXXFLAGS, and LDFLAGS normally
Luke Dashjr <luke-jr+git@utopios.org>
parents:
1409
diff
changeset
|
127 $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $< |
1381
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
128 @cp $(@:%.o=%.d) $(@:%.o=%.P); \ |
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
129 sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ |
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
130 -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \ |
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
131 rm -f $(@:%.o=%.d) |
708
06d213590314
Boost unit-testing framework.
Gavin Andresen <gavinandresen@gmail.com>
parents:
689
diff
changeset
|
132 |
1749
a16663dadac9
Compile with extra warnings turned on. And more makefile/code tidying up.
Gavin Andresen <gavinandresen@gmail.com>
parents:
1744
diff
changeset
|
133 test_bitcoin: $(TESTOBJS) $(filter-out obj/init.o,$(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
|
134 $(CXX) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-Bstatic -lboost_unit_test_framework $(LDFLAGS) $(LIBS) |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
135 |
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
136 clean: |
1320 | 137 -rm -f bitcoind test_bitcoin |
575
1a0476fe825f
directory re-organization (keeps the old build system)
Jaromil <jaromil@dyne.org>
parents:
diff
changeset
|
138 -rm -f obj/*.o |
708
06d213590314
Boost unit-testing framework.
Gavin Andresen <gavinandresen@gmail.com>
parents:
689
diff
changeset
|
139 -rm -f obj/test/*.o |
1381
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
140 -rm -f obj/*.P |
217a0a58ec81
Auto-build dependencies
Gavin Andresen <gavinandresen@gmail.com>
parents:
1359
diff
changeset
|
141 -rm -f obj/test/*.P |