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.0d-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.0d-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 -DNOPCH -DUSE_SSL -DBOOST_THREAD_USE_LIB
75 CFLAGS=-mthreads -O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
100 INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw"
101 LIBPATHS += -L"C:\miniupnpc-1.6-mgw"
102 LIBS += -l miniupnpc -l iphlpapi
103 DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
106 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
126 obj/nogui/%.o: %.cpp $(HEADERS)
127 g++ -c $(CFLAGS) -o $@ $<
129 ppcoind.exe: $(OBJS:obj/%=obj/nogui/%)
130 g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
132 obj/test/test_bitcoin.o: $(wildcard test/*.cpp) $(HEADERS)
133 g++ -c $(CFLAGS) -o $@ test/test_bitcoin.cpp
135 test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
136 g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
139 -del /Q ppcoind test_bitcoin
144 -del /Q headers.h.gch