]>
Commit | Line | Data |
---|---|---|
fa105b1d MC |
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 | ||
0ca8324f MC |
7 | USE_UPNP:=0 |
8 | ||
fa105b1d | 9 | INCLUDEPATHS= \ |
b4ada906 MC |
10 | -I"$(DEPSDIR)/boost_1_47_0" \ |
11 | -I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \ | |
0acbe31c | 12 | -I"$(DEPSDIR)/openssl-1.0.1b/include" \ |
45771671 PW |
13 | -I"$(DEPSDIR)" \ |
14 | -I"$(CURDIR)"/obj \ | |
fa105b1d MC |
15 | |
16 | LIBPATHS= \ | |
b4ada906 MC |
17 | -L"$(DEPSDIR)/boost_1_47_0/stage/lib" \ |
18 | -L"$(DEPSDIR)/db-4.8.30.NC/build_unix" \ | |
0acbe31c | 19 | -L"$(DEPSDIR)/openssl-1.0.1b" |
fa105b1d MC |
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 | ||
23aa78c4 | 30 | DEFS=-D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DUSE_IPV6 |
565c4771 | 31 | DEBUGFLAGS=-g |
f621326c | 32 | CFLAGS=-O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) |
0ca8324f | 33 | |
9e71a5cd | 34 | TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data) |
6ccff2cb | 35 | |
0ca8324f | 36 | ifdef USE_UPNP |
b4ada906 | 37 | LIBPATHS += -L"$(DEPSDIR)/miniupnpc" |
0ca8324f MC |
38 | LIBS += -l miniupnpc -l iphlpapi |
39 | DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP) | |
40 | endif | |
fa105b1d MC |
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 | ||
025d4954 GA |
44 | # TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are |
45 | HEADERS = $(wildcard *.h) | |
46 | ||
fa105b1d | 47 | OBJS= \ |
a20c0d0f | 48 | obj/version.o \ |
eb5fff9e | 49 | obj/checkpoints.o \ |
67a42f92 | 50 | obj/netbase.o \ |
5fee401f | 51 | obj/addrman.o \ |
e49b83bb | 52 | obj/crypter.o \ |
3ae65166 | 53 | obj/key.o \ |
fa105b1d | 54 | obj/db.o \ |
e49b83bb | 55 | obj/init.o \ |
fa105b1d MC |
56 | obj/irc.o \ |
57 | obj/keystore.o \ | |
58 | obj/main.o \ | |
e49b83bb | 59 | obj/net.o \ |
507fd9d1 | 60 | obj/protocol.o \ |
e122e423 | 61 | obj/bitcoinrpc.o \ |
3ae65166 | 62 | obj/rpcdump.o \ |
e49b83bb | 63 | obj/script.o \ |
7f3ccb59 | 64 | obj/sync.o \ |
e49b83bb | 65 | obj/util.o \ |
5cccb13d | 66 | obj/wallet.o \ |
9eace6b1 | 67 | obj/walletdb.o \ |
5cccb13d | 68 | obj/noui.o |
fa105b1d | 69 | |
565c4771 | 70 | all: bitcoind.exe |
fa105b1d | 71 | |
45771671 | 72 | obj/build.h: FORCE |
8c35bfba | 73 | /bin/sh ../share/genbuild.sh obj/build.h |
45771671 | 74 | version.cpp: obj/build.h |
a20c0d0f PW |
75 | DEFS += -DHAVE_BUILD_INFO |
76 | ||
a1de57a0 | 77 | obj/%.o: %.cpp $(HEADERS) |
fa105b1d MC |
78 | i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $< |
79 | ||
45771671 | 80 | bitcoind.exe: $(OBJS:obj/%=obj/%) |
fa105b1d MC |
81 | i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) |
82 | ||
9e71a5cd | 83 | TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) |
fa105b1d | 84 | |
9e71a5cd GA |
85 | obj-test/%.o: test/%.cpp $(HEADERS) |
86 | i586-mingw32msvc-g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $< | |
fa105b1d | 87 | |
9e71a5cd GA |
88 | test_bitcoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) |
89 | i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework $(LIBS) | |
fa105b1d MC |
90 | |
91 | ||
92 | clean: | |
93 | -rm -f obj/*.o | |
fa105b1d | 94 | -rm -f bitcoind.exe |
9e71a5cd | 95 | -rm -f obj-test/*.o |
fa105b1d | 96 | -rm -f test_bitcoin.exe |
a20c0d0f PW |
97 | -rm -f src/build.h |
98 | ||
99 | FORCE: |