Switch GetMyExternalIP from HTTP request to STUN approach
[novacoin.git] / src / makefile.mingw
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.
4
5 USE_UPNP:=0
6 USE_IPV6:=1
7
8 INCLUDEPATHS= \
9  -I"C:\boost-1.50.0-mgw" \
10  -I"C:\db-4.8.30.NC-mgw\build_unix" \
11  -I"C:\openssl-1.0.1c-mgw\include"
12
13 LIBPATHS= \
14  -L"C:\boost-1.50.0-mgw\stage\lib" \
15  -L"C:\db-4.8.30.NC-mgw\build_unix" \
16  -L"C:\openssl-1.0.1c-mgw"
17
18 LIBS= \
19  -l boost_system-mgw44-mt-1_53 \
20  -l boost_filesystem-mgw44-mt-1_53 \
21  -l boost_program_options-mgw44-mt-1_53 \
22  -l boost_thread-mgw44-mt-1_53 \
23  -l boost_chrono-mgw44-mt-1_53 \
24  -l db_cxx \
25  -l ssl \
26  -l crypto
27
28 DEFS=-DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE
29 DEBUGFLAGS=-g
30 CFLAGS=-mthreads -O3 -msse2 -w -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
31 LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat
32
33 TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data)
34
35 ifndef USE_UPNP
36         override USE_UPNP = -
37 endif
38 ifneq (${USE_UPNP}, -)
39  INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw"
40  LIBPATHS += -L"C:\miniupnpc-1.6-mgw"
41  LIBS += -l miniupnpc -l iphlpapi
42  DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP) -DMINIUPNP_STATICLIB
43 endif
44
45 ifneq (${USE_IPV6}, -)
46         DEFS += -DUSE_IPV6=$(USE_IPV6)
47 endif
48
49 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
50
51 # TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are
52 HEADERS = $(wildcard *.h)
53
54 OBJS= \
55     obj/alert.o \
56     obj/version.o \
57     obj/checkpoints.o \
58     obj/netbase.o \
59     obj/addrman.o \
60     obj/crypter.o \
61     obj/key.o \
62     obj/db.o \
63     obj/init.o \
64     obj/irc.o \
65     obj/keystore.o \
66     obj/main.o \
67     obj/miner.o \
68     obj/net.o \
69     obj/stun.o \
70     obj/protocol.o \
71     obj/bitcoinrpc.o \
72     obj/rpcdump.o \
73     obj/rpcnet.o \
74     obj/rpcmining.o \
75     obj/rpcwallet.o \
76     obj/rpcblockchain.o \
77     obj/rpcrawtransaction.o \
78     obj/script.o \
79     obj/sync.o \
80     obj/util.o \
81     obj/wallet.o \
82     obj/walletdb.o \
83     obj/noui.o \
84     obj/kernel.o \
85     obj/pbkdf2.o \
86     obj/scrypt.o
87
88 all: novacoind.exe
89
90 #
91 # LevelDB support
92 #
93 ifdef USE_LEVELDB
94 LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
95 DEFS += $(addprefix -I,$(CURDIR)/leveldb/include) -DUSE_LEVELDB
96 DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
97 OBJS += obj/txdb-leveldb.o
98 leveldb/libleveldb.a:
99         cd leveldb; make; cd ..
100 obj/txdb-leveldb.o: leveldb/libleveldb.lib
101 else
102 OBJS += obj/txdb-bdb.o
103 endif
104
105 ifdef USE_ASM
106 OBJS += obj/scrypt-x86.o obj/scrypt-x86_64.o
107
108 obj/scrypt-x86.o: scrypt-x86.S
109         $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
110
111 obj/scrypt-x86_64.o: scrypt-x86_64.S
112         $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
113 else
114 OBJS += obj/scrypt-generic.o
115
116 obj/scrypt-generic.o: scrypt-generic.c
117         $(CC) -c $(xCXXFLAGS) -MMD -o $@ $<
118 endif
119
120 obj/%.o: %.cpp $(HEADERS)
121         g++ -c $(CFLAGS) -o $@ $<
122
123 novacoind.exe: $(OBJS:obj/%=obj/%)
124         g++ $(CFLAGS) $(LDFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
125
126 clean:
127         -del /Q novacoind
128         -del /Q obj\*
129
130 FORCE: