# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
-DEPSDIR:=/usr/i586-mingw32msvc
+TARGET_PLATFORM:=i686
+#TARGET_PLATFORM:=x86_64
+
+DEPSDIR:=/usr/$(TARGET_PLATFORM)-w64-mingw32
+CC:=$(TARGET_PLATFORM)-w64-mingw32-gcc
+CXX:=$(TARGET_PLATFORM)-w64-mingw32-g++
+RANLIB=$(TARGET_PLATFORM)-w64-mingw32-ranlib
+STRIP=$(TARGET_PLATFORM)-w64-mingw32-strip
USE_UPNP:=0
USE_IPV6:=1
INCLUDEPATHS= \
-I"$(CURDIR)" \
-I"$(CURDIR)"/obj \
- -I"$(DEPSDIR)/boost_1_50_0" \
- -I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
- -I"$(DEPSDIR)/openssl-1.0.1c/include" \
+ -I"$(DEPSDIR)/boost_1_55_0" \
+ -I"$(DEPSDIR)/db-6.0.20/build_unix" \
+ -I"$(DEPSDIR)/openssl-1.0.1f/include" \
-I"$(DEPSDIR)"
LIBPATHS= \
- -L"$(DEPSDIR)/boost_1_50_0/stage/lib" \
- -L"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
- -L"$(DEPSDIR)/openssl-1.0.1c"
+ -L"$(DEPSDIR)/boost_1_55_0/stage/lib" \
+ -L"$(DEPSDIR)/db-6.0.20/build_unix" \
+ -L"$(DEPSDIR)/openssl-1.0.1f"
LIBS= \
- -l boost_system-mt-s \
- -l boost_filesystem-mt-s \
- -l boost_program_options-mt-s \
- -l boost_thread_win32-mt-s \
- -l boost_chrono-mt-s \
+ -l boost_system-mt \
+ -l boost_filesystem-mt \
+ -l boost_program_options-mt \
+ -l boost_thread_win32-mt \
+ -l boost_chrono-mt \
-l db_cxx \
-l ssl \
-l crypto
DEFS=-D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE
DEBUGFLAGS=-g
-CFLAGS=-O2 -msse2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
-LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat
+CFLAGS=-O3 -msse2 -w -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
+LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -static-libgcc -static-libstdc++
TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data)
obj/pbkdf2.o \
obj/scrypt.o \
obj/scrypt-x86.o \
- obj/scrypt-x86_64.o
+ obj/scrypt-x86_64.o \
+ obj/zerocoin/Accumulator.o \
+ obj/zerocoin/AccumulatorProofOfKnowledge.o \
+ obj/zerocoin/Coin.o \
+ obj/zerocoin/CoinSpend.o \
+ obj/zerocoin/Commitment.o \
+ obj/zerocoin/ParamGeneration.o \
+ obj/zerocoin/Params.o \
+ obj/zerocoin/SerialNumberSignatureOfKnowledge.o \
+ obj/zerocoin/SpendMetaData.o \
+ obj/zerocoin/ZeroTest.o
all: novacoind.exe
#
# LevelDB support
#
-ifdef USE_LEVELDB
-LIBS += $(CURDIR)/leveldb/libleveldb.lib $(CURDIR)/leveldb/libmemenv.lib
+ifeq (${USE_LEVELDB}, 1)
+LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
DEFS += -I"$(CURDIR)/leveldb/include" -DUSE_LEVELDB
DEFS += -I"$(CURDIR)/leveldb/helpers"
OBJS += obj/txdb-leveldb.o
-leveldb/libleveldb.lib:
- @echo "Building LevelDB ..."; cd leveldb; TARGET_OS=OS_WINDOWS_CROSSCOMPILE make; cd ..
-obj/txdb-leveldb.o: leveldb/libleveldb.lib
+leveldb/libleveldb.a:
+ @echo "Building LevelDB ..." && cd leveldb && CC=$(CC) CXX=$(CXX) TARGET_OS=OS_WINDOWS_CROSSCOMPILE CXXFLAGS="-I$(INCLUDEPATHS)" LDFLAGS="-L$(LIBPATHS)" $(MAKE) libleveldb.a libmemenv.a && $(RANLIB) libleveldb.a && $(RANLIB) libmemenv.a && cd ..
+obj/txdb-leveldb.o: leveldb/libleveldb.a
else
OBJS += obj/txdb-bdb.o
endif
DEFS += -DHAVE_BUILD_INFO
obj/%.o: %.cpp $(HEADERS)
- i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
+ $(CXX) -c $(CFLAGS) -o $@ $<
+
+obj/zerocoin/%.o: zerocoin/%.cpp $(HEADERS)
+ $(CXX) -c $(CFLAGS) -o $@ $<
-bitcoind.exe: $(OBJS:obj/%=obj/%)
- i586-mingw32msvc-g++ $(CFLAGS) $(LDFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
+novacoind.exe: $(OBJS:obj/%=obj/%)
+ $(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lshlwapi
+ $(STRIP) novacoind.exe
TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
obj-test/%.o: test/%.cpp $(HEADERS)
- i586-mingw32msvc-g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $<
+ $(CXX) -c $(TESTDEFS) $(CFLAGS) -o $@ $<
test_novacoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
- i586-mingw32msvc-g++ $(CFLAGS) $(LDFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework-mt-s $(LIBS)
+ $(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework-mt-s $(LIBS)
+ $(STRIP) test_novacoin.exe
obj/scrypt-x86.o: scrypt-x86.S
- i586-mingw32msvc-g++ -c $(CFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(CFLAGS) -MMD -o $@ $<
obj/scrypt-x86_64.o: scrypt-x86_64.S
- i586-mingw32msvc-g++ -c $(CFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(CFLAGS) -MMD -o $@ $<
clean:
-rm -f obj/*.o
+ -rm -f obj/zerocoin/*.o
-rm -f novacoind.exe
-rm -f obj-test/*.o
-rm -f test_novacoin.exe
-rm -f obj/build.h
+ cd leveldb && TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) clean && cd ..
FORCE: