1 # Copyright (c) 2009-2010 Satoshi Nakamoto
2 # Distributed under the MIT/X11 software license, see the accompanying
3 # file COPYING or http://www.opensource.org/licenses/mit-license.php.
13 BOOST_SUFFIX?=-mgw49-mt-s-1_57
17 -I"/c/deps/boost_1_57_0" \
19 -I"/c/deps/db-6.0.20/build_unix" \
20 -I"/c/deps/openssl-1.0.2/include"
23 -L"$(CURDIR)/leveldb" \
24 -L"/c/deps/boost_1_57_0/stage/lib" \
25 -L"/c/deps/miniupnpc" \
26 -L"/c/deps/db-6.0.20/build_unix" \
27 -L"/c/deps/openssl-1.0.2"
32 -l boost_system$(BOOST_SUFFIX) \
33 -l boost_filesystem$(BOOST_SUFFIX) \
34 -l boost_program_options$(BOOST_SUFFIX) \
35 -l boost_thread$(BOOST_SUFFIX) \
36 -l boost_chrono$(BOOST_SUFFIX) \
41 DEFS=-DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -D__STDC_FORMAT_MACROS
43 CFLAGS=-mthreads -O2 -msse2 -w -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
44 LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware -static
49 ifneq (${USE_UPNP}, -)
50 INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw"
51 LIBPATHS += -L"C:\miniupnpc-1.6-mgw"
52 LIBS += -l miniupnpc -l iphlpapi
53 DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP) -DMINIUPNP_STATICLIB
56 ifneq (${USE_IPV6}, -)
57 DEFS += -DUSE_IPV6=$(USE_IPV6)
60 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 mswsock -l shlwapi
62 # TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are
63 HEADERS = $(wildcard *.h)
88 obj/rpcrawtransaction.o \
105 LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
106 DEFS += $(addprefix -I,$(CURDIR)/leveldb/include) -DUSE_LEVELDB
107 DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
108 OBJS += obj/txdb-leveldb.o
109 leveldb/libleveldb.a:
110 cd leveldb;TARGET_OS=NATIVE_WINDOWS make libleveldb.a libmemenv.a;; cd ..
111 obj/txdb-leveldb.o: leveldb/libleveldb.a
113 OBJS += obj/txdb-bdb.o
117 OBJS += obj/scrypt-x86.o obj/scrypt-x86_64.o
119 obj/scrypt-x86.o: scrypt-x86.S
120 $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
122 obj/scrypt-x86_64.o: scrypt-x86_64.S
123 $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
125 OBJS += obj/scrypt-generic.o
127 obj/scrypt-generic.o: scrypt-generic.c
128 $(CC) -c $(xCXXFLAGS) -MMD -o $@ $<
131 ifeq (${USE_SSE2}, 1)
133 OBJS += obj/scrypt-sse2.o
134 obj/scrypt-sse2.o: scrypt-sse2.cpp $(HEADERS)
135 g++ -c $(CFLAGS) -MMD -o $@ $<
138 obj/%.o: %.cpp $(HEADERS)
139 g++ -c $(CFLAGS) -o $@ $<
141 novacoind.exe: $(OBJS:obj/%=obj/%)
142 g++ $(CFLAGS) $(LDFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)