Fix testing setup
[novacoin.git] / src / makefile.linux-mingw
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 DEPSDIR:=/usr/i586-mingw32msvc
6
7 USE_UPNP:=0
8
9 INCLUDEPATHS= \
10  -I"$(DEPSDIR)/boost_1_43_0" \
11  -I"$(DEPSDIR)/db-4.7.25.NC/build_unix" \
12  -I"$(DEPSDIR)/openssl-1.0.0d/include" \
13  -I"$(DEPSDIR)/wxWidgets-2.9.1/lib/gcc_lib/mswud" \
14  -I"$(DEPSDIR)/wxWidgets-2.9.1/include" \
15  -I"$(DEPSDIR)/wxWidgets-2.9.1/lib/wx/include/i586-mingw32msvc-msw-unicode-static-2.9/" \
16  -I"$(DEPSDIR)"
17
18 LIBPATHS= \
19  -L"$(DEPSDIR)/boost_1_43_0/stage/lib" \
20  -L"$(DEPSDIR)/db-4.7.25.NC/build_unix" \
21  -L"$(DEPSDIR)/openssl-1.0.0d" \
22  -L"$(DEPSDIR)/wxWidgets-2.9.1/lib"
23
24 WXLIBS= -l wx_mswu-2.9-i586-mingw32msvc
25
26 LIBS= \
27  -l boost_system-mt-s \
28  -l boost_filesystem-mt-s \
29  -l boost_program_options-mt-s \
30  -l boost_thread_win32-mt-s \
31  -l db_cxx \
32  -l ssl \
33  -l crypto
34
35 DEFS=-D_MT -DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DUSE_SSL
36 DEBUGFLAGS=-g -D__WXDEBUG__
37 CFLAGS=-O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
38 HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
39     script.h db.h net.h irc.h keystore.h main.h wallet.h rpc.h uibase.h ui.h noui.h \
40     crypter.h init.h
41
42 ifdef USE_UPNP
43         INCLUDEPATHS += -I"$(DEPSDIR)/upnpc-exe-win32-20110215"
44         LIBPATHS += -L"$(DEPSDIR)/upnpc-exe-win32-20110215"
45         LIBS += -l miniupnpc -l iphlpapi
46         DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
47 endif
48
49 LIBS += -l mingwthrd -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l shlwapi
50
51 OBJS= \
52     obj/util.o \
53     obj/script.o \
54     obj/db.o \
55     obj/net.o \
56     obj/irc.o \
57     obj/keystore.o \
58     obj/main.o \
59     obj/wallet.o \
60     obj/rpc.o \
61     obj/init.o \
62     obj/crypter.o \
63     cryptopp/obj/sha.o \
64     cryptopp/obj/cpu.o
65
66
67 all: bitcoin.exe
68
69
70 obj/%.o: %.cpp $(HEADERS)
71         i586-mingw32msvc-g++ -c $(CFLAGS) -DGUI -o $@ $<
72
73 cryptopp/obj/%.o: cryptopp/%.cpp
74         i586-mingw32msvc-g++ -c $(CFLAGS) -O3 -DCRYPTOPP_DISABLE_ASM -o $@ $<
75
76 obj/ui_res.o: ../share/ui.rc  ../share/pixmaps/bitcoin.ico ../share/pixmaps/check.ico ../share/pixmaps/send16.bmp ../share/pixmaps/send16mask.bmp ../share/pixmaps/send16masknoshadow.bmp ../share/pixmaps/send20.bmp ../share/pixmaps/send20mask.bmp ../share/pixmaps/addressbook16.bmp ../share/pixmaps/addressbook16mask.bmp ../share/pixmaps/addressbook20.bmp ../share/pixmaps/addressbook20mask.bmp
77         i586-mingw32msvc-windres $(DEFS) $(INCLUDEPATHS) -o $@ -i $<
78
79 bitcoin.exe: $(OBJS) obj/ui.o obj/uibase.o obj/ui_res.o
80         i586-mingw32msvc-g++ $(CFLAGS) -mwindows -Wl,--subsystem,windows -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
81
82
83 obj/nogui/%.o: %.cpp $(HEADERS)
84         i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
85
86 bitcoind.exe: $(OBJS:obj/%=obj/nogui/%) obj/ui_res.o
87         i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
88
89
90 obj/test/%.o: obj/test/%.cpp $(HEADERS)
91         i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
92
93 test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
94         i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework-mt-s
95
96
97 clean:
98         -rm -f obj/*.o
99         -rm -f obj/nogui/*.o
100         -rm -f obj/test/*.o
101         -rm -f cryptopp/obj/*.o
102         -rm -f test/*.o
103         -rm -f headers.h.gch
104         -rm -f bitcoin.exe
105         -rm -f bitcoind.exe
106         -rm -f test_bitcoin.exe