2cb78d97e6a90ee8d7cbb5dbd5d86ae24cb3a70a
[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 license.txt or http://www.opensource.org/licenses/mit-license.php.
4
5 USE_UPNP:=0
6
7 INCLUDEPATHS= \
8  -I"C:\boost-1.47.0-mgw" \
9  -I"C:\db-4.8.30.NC-mgw\build_unix" \
10  -I"C:\openssl-1.0.0d-mgw\include"
11
12 LIBPATHS= \
13  -L"C:\boost-1.47.0-mgw\stage\lib" \
14  -L"C:\db-4.8.30.NC-mgw\build_unix" \
15  -L"C:\openssl-1.0.0d-mgw"
16
17 LIBS= \
18  -l boost_system-mgw45-mt-s-1_47 \
19  -l boost_filesystem-mgw45-mt-s-1_47 \
20  -l boost_program_options-mgw45-mt-s-1_47 \
21  -l boost_thread-mgw45-mt-s-1_47 \
22  -l db_cxx \
23  -l ssl \
24  -l crypto
25
26 DEFS=-DWIN32 -D_WINDOWS -DNOPCH -DUSE_SSL -DBOOST_THREAD_USE_LIB
27 DEBUGFLAGS=-g
28 CFLAGS=-mthreads -O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
29 HEADERS = \
30     base58.h \
31     bignum.h \
32     checkpoints.h \
33     crypter.h \
34     db.h \
35     headers.h \
36     init.h \
37     irc.h \
38     key.h \
39     keystore.h \
40     main.h \
41     net.h \
42     noui.h \
43     protocol.h \
44     bitcoinrpc.h \
45     script.h \
46     serialize.h \
47     strlcpy.h \
48     uint256.h \
49     util.h \
50     wallet.h
51
52 ifdef USE_UPNP
53  INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw"
54  LIBPATHS += -L"C:\miniupnpc-1.6-mgw"
55  LIBS += -l miniupnpc -l iphlpapi
56  DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
57 endif
58
59 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
60
61 OBJS= \
62     obj/checkpoints.o \
63     obj/crypter.o \
64     obj/db.o \
65     obj/init.o \
66     obj/irc.o \
67     obj/keystore.o \
68     obj/main.o \
69     obj/net.o \
70     obj/protocol.o \
71     obj/bitcoinrpc.o \
72     obj/script.o \
73     obj/util.o \
74     obj/wallet.o
75
76
77 all: bitcoind.exe
78
79 obj/nogui/%.o: %.cpp $(HEADERS)
80         g++ -c $(CFLAGS) -o $@ $<
81
82 bitcoind.exe: $(OBJS:obj/%=obj/nogui/%)
83         g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
84
85 obj/test/test_bitcoin.o: $(wildcard test/*.cpp) $(HEADERS)
86         g++ -c $(CFLAGS) -o $@ test/test_bitcoin.cpp
87
88 test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
89         g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
90
91 clean:
92         -del /Q bitcoind test_bitcoin
93         -del /Q obj\*
94         -del /Q obj\nogui\*
95         -del /Q obj\test\*
96         -del /Q test\*.o
97         -del /Q headers.h.gch