cae82f8cff6fec577fc8624e0c96a419ac1a4307
[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_47_0" \
11  -I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
12  -I"$(DEPSDIR)/openssl-1.0.0d/include" \
13  -I"$(DEPSDIR)/wxWidgets-2.9.2/lib/gcc_lib/mswud" \
14  -I"$(DEPSDIR)/wxWidgets-2.9.2/include" \
15  -I"$(DEPSDIR)/wxWidgets-2.9.2/lib/wx/include/i586-mingw32msvc-msw-unicode-static-2.9/" \
16  -I"$(DEPSDIR)"
17
18 LIBPATHS= \
19  -L"$(DEPSDIR)/boost_1_47_0/stage/lib" \
20  -L"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
21  -L"$(DEPSDIR)/openssl-1.0.0d" \
22  -L"$(DEPSDIR)/wxWidgets-2.9.2/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 -DBOOST_THREAD_USE_LIB
36 DEBUGFLAGS=-g -D__WXDEBUG__
37 CFLAGS=-O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
38 HEADERS = \
39     base58.h \
40     bignum.h \
41     crypter.h \
42     db.h \
43     headers.h \
44     init.h \
45     irc.h \
46     key.h \
47     keystore.h \
48     main.h \
49     net.h \
50     noui.h \
51     protocol.h \
52     bitcoinrpc.h \
53     script.h \
54     serialize.h \
55     strlcpy.h \
56     ui.h \
57     uibase.h \
58     uint256.h \
59     util.h \
60     wallet.h
61
62 ifdef USE_UPNP
63         LIBPATHS += -L"$(DEPSDIR)/miniupnpc"
64         LIBS += -l miniupnpc -l iphlpapi
65         DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
66 endif
67
68 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
69
70 OBJS= \
71     obj/crypter.o \
72     obj/db.o \
73     obj/init.o \
74     obj/irc.o \
75     obj/keystore.o \
76     obj/main.o \
77     obj/net.o \
78     obj/protocol.o \
79     obj/bitcoinrpc.o \
80     obj/script.o \
81     obj/util.o \
82     obj/wallet.o \
83     cryptopp/obj/sha.o \
84     cryptopp/obj/cpu.o
85
86
87 all: bitcoin.exe
88
89
90 obj/%.o: %.cpp $(HEADERS)
91         i586-mingw32msvc-g++ -c $(CFLAGS) -DGUI -o $@ $<
92
93 cryptopp/obj/%.o: cryptopp/%.cpp
94         i586-mingw32msvc-g++ -c $(CFLAGS) -O3 -DCRYPTOPP_DISABLE_ASM -o $@ $<
95
96 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
97         i586-mingw32msvc-windres $(DEFS) $(INCLUDEPATHS) -o $@ -i $<
98
99 bitcoin.exe: $(OBJS) obj/ui.o obj/uibase.o obj/ui_res.o
100         i586-mingw32msvc-g++ $(CFLAGS) -mwindows -Wl,--subsystem,windows -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
101
102
103 obj/nogui/%.o: %.cpp $(HEADERS)
104         i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
105
106 bitcoind.exe: $(OBJS:obj/%=obj/nogui/%) obj/ui_res.o
107         i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
108
109
110 obj/test/%.o: obj/test/%.cpp $(HEADERS)
111         i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
112
113 test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
114         i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework-mt-s
115
116
117 clean:
118         -rm -f obj/*.o
119         -rm -f obj/nogui/*.o
120         -rm -f obj/test/*.o
121         -rm -f cryptopp/obj/*.o
122         -rm -f test/*.o
123         -rm -f headers.h.gch
124         -rm -f bitcoin.exe
125         -rm -f bitcoind.exe
126         -rm -f test_bitcoin.exe