1 # Copyright (c) 2009-2010 Satoshi Nakamoto
2 # Copyright (c) 2012 The PPCoin developers
3 # Distributed under the MIT/X11 software license, see the accompanying
4 # file license.txt or http://www.opensource.org/licenses/mit-license.php.
6 # Windows commandline build procedure:
7 # - Install MinGW following http://www.mingw.org/wiki/Getting_Started.
8 # Install with the C++ and MSYS options checked
10 # - Add/edit 'MAKE' environment variable with value '/c/MinGW32/bin/mingw32-make.exe'
12 # - Build openssl library version: 1.0.1b
13 # download from http://www.openssl.org/source/
14 # Extract to c:\openssl-1.0.1b-mgw
19 # - Build Berkeley DB library version: 4.8.30.NC
20 # download from http://www.oracle.com/technology/software/products/berkeley-db/index.html
21 # Extract to c:\db-4.8.30.NC-mgw
24 # sh ../dist/configure --disable-replication --enable-mingw --enable-cxx --prefix=/usr/local
25 # Edit db.h@113 in build_unix
27 # typedef pthread_t db_threadid_t;
29 # typedef u_int32_t db_threadid_t;
33 # - Build Boost C++ library version: 1.47.0
34 # download from http://www.boost.org/users/download/
35 # Extract to c:\boost-1.47.0-mgw
36 # Install Boost.Build:
39 # b2 install --prefix=BOOST_BUILD_INSTALL_DIR
40 # Add BOOST_BUILD_INSTALL_DIR to your PATH system environment variable
41 # Build boost library in MSDOS:
42 # cd c:\boost-1.47.0-mgw
43 # bjam toolset=gcc --build-type=complete stage
48 # make ppcoind.exe -f makefile.mingw USE_UPNP=
55 -I"C:\boost-1.47.0-mgw" \
56 -I"C:\db-4.8.30.NC-mgw\build_unix" \
57 -I"C:\openssl-1.0.1b-mgw\include"
60 -L"C:\boost-1.47.0-mgw\stage\lib" \
61 -L"C:\db-4.8.30.NC-mgw\build_unix" \
62 -L"C:\openssl-1.0.1b-mgw"
65 -l boost_system-mgw46-mt-s-1_47 \
66 -l boost_filesystem-mgw46-mt-s-1_47 \
67 -l boost_program_options-mgw46-mt-s-1_47 \
68 -l boost_thread-mgw46-mt-s-1_47 \
73 DEFS=-DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE
75 CFLAGS=-mthreads -O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
77 TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data)
80 INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw"
81 LIBPATHS += -L"C:\miniupnpc-1.6-mgw"
82 LIBS += -l miniupnpc -l iphlpapi
83 DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
86 LIBS += -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
88 # TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are
89 HEADERS = $(wildcard *.h)
116 obj/%.o: %.cpp $(HEADERS)
117 g++ -c $(CFLAGS) -o $@ $<
119 ppcoind.exe: $(OBJS:obj/%=obj/%)
120 g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
122 TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
124 obj-test/%.o: test/%.cpp $(HEADERS)
125 g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $<
127 test_bitcoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
128 g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework $(LIBS)
131 -del /Q ppcoind test_bitcoin