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
45 # - Build Miniupnp library version: 1.6
46 # download from http://miniupnp.free.fr/files/
47 # file name is miniupnpc-1.6.20120509.tar.gz
48 # Extract to c:\miniupnpc-1.6-mgw
49 # In MinGW MSYS shell:
50 # cd /c/miniupnpc-1.6-mgw
51 # make -f Makefile.mingw
55 # - Build novacoind.exe
58 # make novacoind.exe -f makefile.mingw USE_UPNP=1
65 -I"C:\boost-1.47.0-mgw" \
66 -I"C:\db-4.8.30.NC-mgw\build_unix" \
67 -I"C:\openssl-1.0.1b-mgw\include"
70 -L"C:\boost-1.47.0-mgw\stage\lib" \
71 -L"C:\db-4.8.30.NC-mgw\build_unix" \
72 -L"C:\openssl-1.0.1b-mgw"
75 -l boost_system-mgw46-mt-s-1_47 \
76 -l boost_filesystem-mgw46-mt-s-1_47 \
77 -l boost_program_options-mgw46-mt-s-1_47 \
78 -l boost_thread-mgw46-mt-s-1_47 \
83 DEFS=-DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE
85 CFLAGS=-mthreads -msse2 -O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
87 TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data)
90 INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw"
91 LIBPATHS += -L"C:\miniupnpc-1.6-mgw"
92 LIBS += -l miniupnpc -l iphlpapi
93 DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
96 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
98 # TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are
99 HEADERS = $(wildcard *.h)
131 obj/%.o: %.cpp $(HEADERS)
132 g++ -c $(CFLAGS) -o $@ $<
134 obj/scrypt-x86.o: scrypt-x86.S
135 $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
137 obj/scrypt-x86_64.o: scrypt-x86_64.S
138 $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
140 novacoind.exe: $(OBJS:obj/%=obj/%)
141 g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
143 TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
145 obj-test/%.o: test/%.cpp $(HEADERS)
146 g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $<
148 test_novacoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
149 g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework $(LIBS)
152 -del /Q novacoind test_novacoin