makefile.mingw 2.11 KB
Newer Older
Gavin Andresen's avatar
Gavin Andresen committed
1 2 3 4
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.

5 6
USE_UPNP:=0

Gavin Andresen's avatar
Gavin Andresen committed
7
INCLUDEPATHS= \
8 9
 -I"C:\boost-1.47.0-mgw" \
 -I"C:\db-4.8.30.NC-mgw\build_unix" \
Gavin Andresen's avatar
Gavin Andresen committed
10
 -I"C:\openssl-1.0.0d-mgw\include"
Gavin Andresen's avatar
Gavin Andresen committed
11 12

LIBPATHS= \
13 14
 -L"C:\boost-1.47.0-mgw\stage\lib" \
 -L"C:\db-4.8.30.NC-mgw\build_unix" \
Gavin Andresen's avatar
Gavin Andresen committed
15
 -L"C:\openssl-1.0.0d-mgw"
Gavin Andresen's avatar
Gavin Andresen committed
16 17

LIBS= \
18 19 20 21
 -l boost_system-mgw45-mt-s-1_47 \
 -l boost_filesystem-mgw45-mt-s-1_47 \
 -l boost_program_options-mgw45-mt-s-1_47 \
 -l boost_thread-mgw45-mt-s-1_47 \
Gavin Andresen's avatar
Gavin Andresen committed
22
 -l db_cxx \
23 24
 -l ssl \
 -l crypto
Gavin Andresen's avatar
Gavin Andresen committed
25

Gavin Andresen's avatar
Gavin Andresen committed
26
DEFS=-DWIN32 -D_WINDOWS -DNOPCH -DBOOST_THREAD_USE_LIB
Gavin Andresen's avatar
Gavin Andresen committed
27
DEBUGFLAGS=-g
28
CFLAGS=-mthreads -O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
29

30

31
ifdef USE_UPNP
32 33
 INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw"
 LIBPATHS += -L"C:\miniupnpc-1.6-mgw"
34 35 36
 LIBS += -l miniupnpc -l iphlpapi
 DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
endif
37 38 39

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

40 41 42
# TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are
HEADERS = $(wildcard *.h)

43
OBJS= \
44
    obj/version.o \
45
    obj/checkpoints.o \
Pieter Wuille's avatar
Pieter Wuille committed
46
    obj/netbase.o \
47
    obj/addrman.o \
48
    obj/crypter.o \
49
    obj/key.o \
50
    obj/db.o \
51
    obj/init.o \
52
    obj/irc.o \
53
    obj/keystore.o \
54
    obj/main.o \
55
    obj/net.o \
56
    obj/protocol.o \
57
    obj/bitcoinrpc.o \
Pieter Wuille's avatar
Pieter Wuille committed
58
    obj/rpcdump.o \
59 60
    obj/script.o \
    obj/util.o \
61 62
    obj/wallet.o \
    obj/noui.o
Gavin Andresen's avatar
Gavin Andresen committed
63 64


Gavin Andresen's avatar
Gavin Andresen committed
65
all: bitcoind.exe
Gavin Andresen's avatar
Gavin Andresen committed
66

67
obj/%.o: %.cpp $(HEADERS)
68
	g++ -c $(CFLAGS) -o $@ $<
Gavin Andresen's avatar
Gavin Andresen committed
69

70
bitcoind.exe: $(OBJS:obj/%=obj/%)
71
	g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
Gavin Andresen's avatar
Gavin Andresen committed
72

73 74
obj/test/test_bitcoin.o: $(wildcard test/*.cpp) $(HEADERS)
	g++ -c $(CFLAGS) -o $@ test/test_bitcoin.cpp
75

76
test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
77
	g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
Gavin Andresen's avatar
Gavin Andresen committed
78 79

clean:
Gavin Andresen's avatar
Gavin Andresen committed
80
	-del /Q bitcoind test_bitcoin
Gavin Andresen's avatar
Gavin Andresen committed
81 82
	-del /Q obj\*
	-del /Q obj\nogui\*
83 84
	-del /Q obj\test\*
	-del /Q test\*.o
Gavin Andresen's avatar
Gavin Andresen committed
85
	-del /Q headers.h.gch
86
	-del /Q build.h