Merge branch '0.6.x' of git://gitorious.org/+bitcoin-stable-developers/bitcoin/bitcoi...
[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)" \
14  -I"$(CURDIR)"/obj \
15
16 LIBPATHS= \
17  -L"$(DEPSDIR)/boost_1_47_0/stage/lib" \
18  -L"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
19  -L"$(DEPSDIR)/openssl-1.0.1b"
20
21 LIBS= \
22  -l boost_system-mt-s \
23  -l boost_filesystem-mt-s \
24  -l boost_program_options-mt-s \
25  -l boost_thread_win32-mt-s \
26  -l db_cxx \
27  -l ssl \
28  -l crypto
29
30 DEFS=-D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE
31 DEBUGFLAGS=-g
32 CFLAGS=-O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
33
34 TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data)
35
36 ifdef USE_UPNP
37         LIBPATHS += -L"$(DEPSDIR)/miniupnpc"
38         LIBS += -l miniupnpc -l iphlpapi
39         DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
40 endif
41
42 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
43
44 # TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are
45 HEADERS = $(wildcard *.h)
46
47 OBJS= \
48     obj/version.o \
49     obj/checkpoints.o \
50     obj/netbase.o \
51     obj/addrman.o \
52     obj/crypter.o \
53     obj/key.o \
54     obj/db.o \
55     obj/init.o \
56     obj/irc.o \
57     obj/keystore.o \
58     obj/main.o \
59     obj/net.o \
60     obj/protocol.o \
61     obj/bitcoinrpc.o \
62     obj/rpcdump.o \
63     obj/script.o \
64     obj/util.o \
65     obj/wallet.o \
66     obj/walletdb.o \
67     obj/noui.o
68
69 all: bitcoind.exe
70
71 obj/build.h: FORCE
72         /bin/sh ../share/genbuild.sh obj/build.h
73 version.cpp: obj/build.h
74 DEFS += -DHAVE_BUILD_INFO
75
76 obj/%.o: %.cpp $(HEADERS)
77         i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
78
79 bitcoind.exe: $(OBJS:obj/%=obj/%)
80         i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
81
82 TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
83
84 obj-test/%.o: test/%.cpp $(HEADERS)
85         i586-mingw32msvc-g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $<
86
87 test_bitcoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
88         i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework $(LIBS)
89
90
91 clean:
92         -rm -f obj/*.o
93         -rm -f bitcoind.exe
94         -rm -f obj-test/*.o
95         -rm -f test_bitcoin.exe
96         -rm -f src/build.h
97
98 FORCE: