1 # Copyright (c) 2009-2010 Satoshi Nakamoto
2 # Distributed under the MIT/X11 software license, see the accompanying
3 # file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 DEPSDIR:=/usr/i586-mingw32msvc
13 -I"$(DEPSDIR)/boost_1_50_0" \
14 -I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
15 -I"$(DEPSDIR)/openssl-1.0.1c/include" \
19 -L"$(DEPSDIR)/boost_1_50_0/stage/lib" \
20 -L"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
21 -L"$(DEPSDIR)/openssl-1.0.1c"
24 -l boost_system-mt-s \
25 -l boost_filesystem-mt-s \
26 -l boost_program_options-mt-s \
27 -l boost_thread_win32-mt-s \
28 -l boost_chrono-mt-s \
33 DEFS=-D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE
35 CFLAGS=-O2 -msse2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
36 LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat
38 TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data)
43 ifneq (${USE_UPNP}, -)
44 LIBPATHS += -L"$(DEPSDIR)/miniupnpc"
45 LIBS += -l miniupnpc -l iphlpapi
46 DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
49 ifneq (${USE_IPV6}, -)
50 DEFS += -DUSE_IPV6=$(USE_IPV6)
53 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 mswsock -l shlwapi
55 # TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are
56 HEADERS = $(wildcard *.h)
79 obj/rpcrawtransaction.o \
95 /bin/sh ../share/genbuild.sh obj/build.h
96 version.cpp: obj/build.h
97 DEFS += -DHAVE_BUILD_INFO
99 obj/%.o: %.cpp $(HEADERS)
100 i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
102 bitcoind.exe: $(OBJS:obj/%=obj/%)
103 i586-mingw32msvc-g++ $(CFLAGS) $(LDFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
105 TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
107 obj-test/%.o: test/%.cpp $(HEADERS)
108 i586-mingw32msvc-g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $<
110 test_novacoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
111 i586-mingw32msvc-g++ $(CFLAGS) $(LDFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework-mt-s $(LIBS)
113 obj/scrypt-x86.o: scrypt-x86.S
114 i586-mingw32msvc-g++ -c $(CFLAGS) -MMD -o $@ $<
116 obj/scrypt-x86_64.o: scrypt-x86_64.S
117 i586-mingw32msvc-g++ -c $(CFLAGS) -MMD -o $@ $<
123 -rm -f test_novacoin.exe