9f005424f6e057948be1134475fdadec710229e3
[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.0e/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.0e"
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 -DNOPCH -DBOOST_THREAD_USE_LIB
31 DEBUGFLAGS=-g
32 CFLAGS=-O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
33
34
35 ifdef USE_UPNP
36         LIBPATHS += -L"$(DEPSDIR)/miniupnpc"
37         LIBS += -l miniupnpc -l iphlpapi
38         DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
39 endif
40
41 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
42
43 # TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are
44 HEADERS = $(wildcard *.h)
45
46 OBJS= \
47     obj/version.o \
48     obj/checkpoints.o \
49     obj/netbase.o \
50     obj/addrman.o \
51     obj/crypter.o \
52     obj/key.o \
53     obj/db.o \
54     obj/init.o \
55     obj/irc.o \
56     obj/keystore.o \
57     obj/main.o \
58     obj/net.o \
59     obj/protocol.o \
60     obj/bitcoinrpc.o \
61     obj/rpcdump.o \
62     obj/script.o \
63     obj/util.o \
64     obj/wallet.o \
65     obj/noui.o
66
67 all: bitcoind.exe
68
69 obj/build.h: FORCE
70         ../share/genbuild.sh obj/build.h
71 version.cpp: obj/build.h
72 DEFS += -DHAVE_BUILD_INFO
73
74 obj/%.o: %.cpp $(HEADERS)
75         i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
76
77 bitcoind.exe: $(OBJS:obj/%=obj/%)
78         i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
79
80
81 obj/test/%.o: obj/test/%.cpp $(HEADERS)
82         i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
83
84 test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
85         i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework-mt-s
86
87
88 clean:
89         -rm -f obj/*.o
90         -rm -f obj/test/*.o
91         -rm -f test/*.o
92         -rm -f headers.h.gch
93         -rm -f bitcoind.exe
94         -rm -f test_bitcoin.exe
95         -rm -f src/build.h
96
97 FORCE: