simplified makefile.unix, updated build-unix.txt instructions to include boost 1.37
[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 WXLIBS= \
11  -Wl,-Bstatic \
12    -l wx_gtk2ud-2.9 \
13  -Wl,-Bdynamic \
14    -l gtk-x11-2.0 -l SM
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 crypto \
25  -Wl,-Bdynamic \
26    -l gthread-2.0
27
28 DEFS=-D__WXGTK__ -DNOPCH
29 DEBUGFLAGS=-g -D__WXDEBUG__
30 CFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
31 HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
32     script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h
33
34 OBJS= \
35     obj/util.o \
36     obj/script.o \
37     obj/db.o \
38     obj/net.o \
39     obj/irc.o \
40     obj/main.o \
41     obj/rpc.o \
42     obj/init.o \
43     cryptopp/obj/sha.o \
44     cryptopp/obj/cpu.o
45
46
47 all: bitcoin
48
49
50 obj/%.o: %.cpp $(HEADERS)
51         g++ -c $(CFLAGS) -DGUI -o $@ $<
52
53 cryptopp/obj/%.o: cryptopp/%.cpp
54         g++ -c $(CFLAGS) -O3 -DCRYPTOPP_DISABLE_SSE2 -o $@ $<
55
56 bitcoin: $(OBJS) obj/ui.o obj/uibase.o
57         g++ $(CFLAGS) -o $@ $^ $(WXLIBS) $(LIBS)
58
59
60 obj/nogui/%.o: %.cpp $(HEADERS)
61         g++ -c $(CFLAGS) -o $@ $<
62
63 bitcoind: $(OBJS:obj/%=obj/nogui/%)
64         g++ $(CFLAGS) -o $@ $^ $(LIBS)
65
66
67 clean:
68         -rm -f obj/*.o
69         -rm -f obj/nogui/*.o
70         -rm -f cryptopp/obj/*.o
71         -rm -f headers.h.gch