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.
5 DEPSDIR:=/usr/i586-mingw32msvc
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" \
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"
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 \
30 DEFS=-D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB
32 CFLAGS=-O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
34 TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data)
37 LIBPATHS += -L"$(DEPSDIR)/miniupnpc"
38 LIBS += -l miniupnpc -l iphlpapi
39 DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
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
44 # TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are
45 HEADERS = $(wildcard *.h)
73 ../share/genbuild.sh obj/build.h
74 version.cpp: obj/build.h
75 DEFS += -DHAVE_BUILD_INFO
77 obj/%.o: %.cpp $(HEADERS)
78 i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
80 bitcoind.exe: $(OBJS:obj/%=obj/%)
81 i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
83 TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
85 obj-test/%.o: test/%.cpp $(HEADERS)
86 i586-mingw32msvc-g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $<
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)
96 -rm -f test_bitcoin.exe