@ -2,25 +2,41 @@
# Distributed under the MIT/X11 software license, see the accompanying
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
USE_UPNP:=0
# Makefile for the MinGW g++ compiler/toolchain
#
# Assumes Berkeley DB, Boost, and OpenSSL have all been compiled and installed
# into /usr/local (/usr/local/include, /usr/local/lib).
#
# If dependencies are somewhere else, run 'make DEPSDIR=/path/'
#
# Boost libraries are given wacky names that include the particular version of
# boost you're using; set BOOST_SUFFIX appropriately.
#
# 'make clean' assumes it is running inside a MSYS shell, and uses 'rm'
# to remove files.
USE_UPNP:=-
USE_IPV6:=1
USE_IPV6:=1
DEPSDIR?=/usr/local
BOOST_SUFFIX?=-mgw46-mt-sd-1_52
INCLUDEPATHS= \
INCLUDEPATHS= \
-I"C:\boost-1.50.0-mgw" \
-I"$(CURDIR)" \
-I"C:\db-4.8.30.NC-mgw\build_unix" \
-I"$(DEPSDIR)/include"
-I"C:\openssl-1.0.1c-mgw\include"
LIBPATHS= \
LIBPATHS= \
-L"C:\boost-1.50.0-mgw\stage\lib" \
-L"$(CURDIR)/leveldb" \
-L"C:\db-4.8.30.NC-mgw\build_unix" \
-L"$(DEPSDIR)/lib"
-L"C:\openssl-1.0.1c-mgw"
LIBS= \
LIBS= \
-l boost_system-mgw45-mt-s-1_50 \
-l leveldb \
-l boost_filesystem-mgw45-mt-s-1_50 \
-l memenv \
-l boost_program_options-mgw45-mt-s-1_50 \
-l boost_system$(BOOST_SUFFIX) \
-l boost_thread-mgw45-mt-s-1_50 \
-l boost_filesystem$(BOOST_SUFFIX) \
-l boost_chrono-mgw45-mt-s-1_50 \
-l boost_program_options$(BOOST_SUFFIX) \
-l boost_thread$(BOOST_SUFFIX) \
-l boost_chrono$(BOOST_SUFFIX) \
-l db_cxx \
-l db_cxx \
-l ssl \
-l ssl \
-l crypto
-l crypto
@ -37,8 +53,6 @@ ifndef USE_UPNP
override USE_UPNP = -
override USE_UPNP = -
endif
endif
ifneq (${USE_UPNP}, -)
ifneq (${USE_UPNP}, -)
INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw"
LIBPATHS += -L"C:\miniupnpc-1.6-mgw"
LIBS += -l miniupnpc -l iphlpapi
LIBS += -l miniupnpc -l iphlpapi
DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
endif
endif
@ -94,12 +108,12 @@ test check: test_bitcoin.exe FORCE
#
#
# LevelDB support
# LevelDB support
#
#
LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
# TODO: If this fails, try adding a ranlib libleveldb.a && ranlib libmemenv.a
leveldb/libleveldb.a:
leveldb/libleveldb.a:
cd leveldb && $(MAKE) libleveldb.a libmemenv.a && cd ..
cd leveldb && $(MAKE) OPT="$(DEBUGFLAGS)" TARGET_OS=NATIVE_WINDOWS libleveldb.a libmemenv.a && cd ..
obj/leveldb.o: leveldb/libleveldb.a
obj/leveldb.o: leveldb/libleveldb.a
obj/%.o: %.cpp $(HEADERS)
obj/%.o: %.cpp $(HEADERS)
@ -114,11 +128,12 @@ obj-test/%.o: test/%.cpp $(HEADERS)
g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $<
g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $<
test_bitcoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
test_bitcoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
g++ $(CFLAGS) $(LDFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework $(LIBS)
g++ $(CFLAGS) $(LDFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework$(BOOST_SUFFIX) $(LIBS)
clean:
clean:
-del /Q bitcoind test_bitcoin
rm -f bitcoind.exe test_bitcoin.exe
-del /Q obj\*
rm -f obj/*
-del /Q obj-test\*
rm -f obj-test/*
cd leveldb && $(MAKE) TARGET_OS=NATIVE_WINDOWS clean && cd ..
FORCE:
FORCE: