PPCoin: Tool generating genesis block
[novacoin.git] / src / makefile.unix
1 # Copyright (c) 2009-2010 Satoshi Nakamoto
2 # Copyright (c) 2011 The PPCoin developers
3 # Distributed under the MIT/X11 software license, see the accompanying
4 # file license.txt or http://www.opensource.org/licenses/mit-license.php.
5
6 CXX=g++
7
8 WXINCLUDEPATHS=$(shell wx-config --cxxflags)
9
10 WXLIBS=$(shell wx-config --libs)
11
12 USE_UPNP:=0
13
14 DEFS=-DNOPCH -DFOURWAYSSE2 -DUSE_SSL
15
16 # for boost 1.37, add -mt to the boost libraries
17 LIBS= \
18  -Wl,-Bstatic \
19    -l boost_system \
20    -l boost_filesystem \
21    -l boost_program_options \
22    -l boost_thread \
23    -l db_cxx \
24    -l ssl \
25    -l crypto
26
27 ifdef USE_UPNP
28         LIBS += -l miniupnpc
29         DEFS += -DUSE_UPNP=$(USE_UPNP)
30 endif
31
32 ifneq (${PPCOIN_GENESIS}, 0)
33         DEFS += -DPPCOIN_GENESIS
34 endif
35
36 LIBS+= \
37  -Wl,-Bdynamic \
38    -l gthread-2.0 \
39    -l z \
40    -l dl \
41    -l pthread
42
43
44 DEBUGFLAGS=-g -D__WXDEBUG__
45 CXXFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS)
46 HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
47     script.h db.h net.h irc.h keystore.h main.h wallet.h rpc.h uibase.h ui.h noui.h init.h
48
49 OBJS= \
50     obj/util.o \
51     obj/script.o \
52     obj/db.o \
53     obj/net.o \
54     obj/irc.o \
55     obj/keystore.o \
56     obj/main.o \
57     obj/wallet.o \
58     obj/rpc.o \
59     obj/init.o \
60     cryptopp/obj/sha.o \
61     cryptopp/obj/cpu.o
62
63
64 all: bitcoin
65
66
67 obj/%.o: %.cpp $(HEADERS)
68         $(CXX) -c $(CXXFLAGS) $(WXINCLUDEPATHS) -DGUI -o $@ $<
69
70 cryptopp/obj/%.o: cryptopp/%.cpp
71         $(CXX) -c $(CXXFLAGS) -O3 -o $@ $<
72
73 bitcoin: $(OBJS) obj/ui.o obj/uibase.o
74         $(CXX) $(CXXFLAGS) -o $@ $^ $(WXLIBS) $(LIBS)
75
76
77 obj/nogui/%.o: %.cpp $(HEADERS)
78         $(CXX) -c $(CXXFLAGS) -o $@ $<
79
80 bitcoind: $(OBJS:obj/%=obj/nogui/%)
81         $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
82
83 obj/test/%.o: test/%.cpp $(HEADERS)
84         $(CXX) -c $(CFLAGS) -o $@ $<
85
86 test_bitcoin: obj/test/test_bitcoin.o
87         $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework
88
89 clean:
90         -rm -f bitcoin bitcoind test_bitcoin genesis
91         -rm -f obj/*.o
92         -rm -f obj/nogui/*.o
93         -rm -f obj/test/*.o
94         -rm -f cryptopp/obj/*.o
95         -rm -f headers.h.gch
96         -rm -f ppcoin/obj/*.o
97
98 ppcoin/obj/%.o: ppcoin/%.cpp
99         $(CXX) -c $(CXXFLAGS) -o $@ $<
100
101 genesis: ppcoin/obj/genesis.o $(OBJS:obj/%=obj/nogui/%)
102         $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)