Windows build: compile against openssl 1.0.1b
[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.1b/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.1b" \
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     checkpoints.h \
42     crypter.h \
43     db.h \
44     headers.h \
45     init.h \
46     irc.h \
47     key.h \
48     keystore.h \
49     main.h \
50     net.h \
51     noui.h \
52     protocol.h \
53     rpc.h \
54     script.h \
55     serialize.h \
56     strlcpy.h \
57     ui.h \
58     uibase.h \
59     uint256.h \
60     util.h \
61     wallet.h
62
63 ifdef USE_UPNP
64         LIBPATHS += -L"$(DEPSDIR)/miniupnpc"
65         LIBS += -l miniupnpc -l iphlpapi
66         DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
67 endif
68
69 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
70
71 OBJS= \
72     obj/checkpoints.o \
73     obj/crypter.o \
74     obj/db.o \
75     obj/init.o \
76     obj/irc.o \
77     obj/keystore.o \
78     obj/main.o \
79     obj/net.o \
80     obj/protocol.o \
81     obj/rpc.o \
82     obj/script.o \
83     obj/util.o \
84     obj/wallet.o \
85     cryptopp/obj/sha.o \
86     cryptopp/obj/cpu.o
87
88
89 all: bitcoin.exe
90
91
92 obj/%.o: %.cpp $(HEADERS)
93         i586-mingw32msvc-g++ -c $(CFLAGS) -DGUI -o $@ $<
94
95 cryptopp/obj/%.o: cryptopp/%.cpp
96         i586-mingw32msvc-g++ -c $(CFLAGS) -O3 -DCRYPTOPP_DISABLE_ASM -o $@ $<
97
98 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
99         i586-mingw32msvc-windres $(DEFS) $(INCLUDEPATHS) -o $@ -i $<
100
101 bitcoin.exe: $(OBJS) obj/ui.o obj/uibase.o obj/ui_res.o
102         i586-mingw32msvc-g++ $(CFLAGS) -mwindows -Wl,--subsystem,windows -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
103
104
105 obj/nogui/%.o: %.cpp $(HEADERS)
106         i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
107
108 bitcoind.exe: $(OBJS:obj/%=obj/nogui/%) obj/ui_res.o
109         i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
110
111
112 obj/test/%.o: obj/test/%.cpp $(HEADERS)
113         i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
114
115 test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
116         i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework-mt-s
117
118
119 clean:
120         -rm -f obj/*.o
121         -rm -f obj/nogui/*.o
122         -rm -f obj/test/*.o
123         -rm -f cryptopp/obj/*.o
124         -rm -f test/*.o
125         -rm -f headers.h.gch
126         -rm -f bitcoin.exe
127         -rm -f bitcoind.exe
128         -rm -f test_bitcoin.exe