Merge branch 'rpcssl-help' of github.com:dooglus/bitcoin into dooglus-rpcssl-help
[novacoin.git] / makefile.unix
1 # Copyright (c) 2009-2010 Satoshi Nakamoto
2 # Distributed under the MIT/X11 software license, see the accompanying
3 # file license.txt or http://www.opensource.org/licenses/mit-license.php.
4
5
6 INCLUDEPATHS= \
7  -I"/usr/local/include/wx-2.9" \
8  -I"/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.9"
9
10 # for wxWidgets 2.9.1, add -l Xxf86vm
11 WXLIBS= \
12  -Wl,-Bstatic \
13    -l wx_gtk2ud-2.9 \
14  -Wl,-Bdynamic \
15    -l gtk-x11-2.0 \
16    -l SM
17
18 # for boost 1.37, add -mt to the boost libraries
19 LIBS= \
20  -Wl,-Bstatic \
21    -l boost_system \
22    -l boost_filesystem \
23    -l boost_program_options \
24    -l boost_thread \
25    -l db_cxx \
26    -l ssl \
27    -l crypto \
28  -Wl,-Bdynamic \
29    -l gthread-2.0 \
30    -l z \
31    -l dl
32
33 DEFS=-D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -DUSE_SSL
34 DEBUGFLAGS=-g -D__WXDEBUG__
35 CFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
36 HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
37     script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h
38
39 OBJS= \
40     obj/util.o \
41     obj/script.o \
42     obj/db.o \
43     obj/net.o \
44     obj/irc.o \
45     obj/main.o \
46     obj/rpc.o \
47     obj/init.o \
48     cryptopp/obj/sha.o \
49     cryptopp/obj/cpu.o
50
51
52 all: bitcoin
53
54
55 obj/%.o: %.cpp $(HEADERS)
56         g++ -c $(CFLAGS) -DGUI -o $@ $<
57
58 cryptopp/obj/%.o: cryptopp/%.cpp
59         g++ -c $(CFLAGS) -O3 -o $@ $<
60
61 obj/sha256.o: sha256.cpp
62         g++ -c $(CFLAGS) -msse2 -O3 -march=amdfam10 -o $@ $<
63
64 bitcoin: $(OBJS) obj/ui.o obj/uibase.o obj/sha256.o
65         g++ $(CFLAGS) -o $@ $^ $(WXLIBS) $(LIBS)
66
67
68 obj/nogui/%.o: %.cpp $(HEADERS)
69         g++ -c $(CFLAGS) -o $@ $<
70
71 bitcoind: $(OBJS:obj/%=obj/nogui/%) obj/sha256.o
72         g++ $(CFLAGS) -o $@ $^ $(LIBS)
73
74
75 clean:
76         -rm -f obj/*.o
77         -rm -f obj/nogui/*.o
78         -rm -f cryptopp/obj/*.o
79         -rm -f headers.h.gch