Build identification strings
[novacoin.git] / src / makefile.linux-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 DEPSDIR:=/usr/i586-mingw32msvc
6
7 USE_UPNP:=0
8
9 INCLUDEPATHS= \
10  -I"$(DEPSDIR)/boost_1_47_0" \
11  -I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
12  -I"$(DEPSDIR)/openssl-1.0.0e/include" \
13  -I"$(DEPSDIR)"
14
15 LIBPATHS= \
16  -L"$(DEPSDIR)/boost_1_47_0/stage/lib" \
17  -L"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
18  -L"$(DEPSDIR)/openssl-1.0.0e"
19
20 LIBS= \
21  -l boost_system-mt-s \
22  -l boost_filesystem-mt-s \
23  -l boost_program_options-mt-s \
24  -l boost_thread_win32-mt-s \
25  -l db_cxx \
26  -l ssl \
27  -l crypto
28
29 DEFS=-D_MT -DWIN32 -D_WINDOWS -DNOPCH -DBOOST_THREAD_USE_LIB
30 DEBUGFLAGS=-g
31 CFLAGS=-O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
32
33
34 ifdef USE_UPNP
35         LIBPATHS += -L"$(DEPSDIR)/miniupnpc"
36         LIBS += -l miniupnpc -l iphlpapi
37         DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
38 endif
39
40 LIBS += -l mingwthrd -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
41
42 # TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are
43 HEADERS = $(wildcard *.h)
44
45 OBJS= \
46     obj/version.o \
47     obj/checkpoints.o \
48     obj/netbase.o \
49     obj/addrman.o \
50     obj/crypter.o \
51     obj/key.o \
52     obj/db.o \
53     obj/init.o \
54     obj/irc.o \
55     obj/keystore.o \
56     obj/main.o \
57     obj/net.o \
58     obj/protocol.o \
59     obj/bitcoinrpc.o \
60     obj/rpcdump.o \
61     obj/script.o \
62     obj/util.o \
63     obj/wallet.o \
64     obj/noui.o
65
66 all: bitcoind.exe
67
68 build.h: FORCE
69         @../share/genbuild.sh build.h
70 DEFS += -DHAVE_BUILD_INFO
71
72 obj/%.o: %.cpp $(HEADERS)
73         i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
74
75 bitcoind.exe: build.h $(OBJS:obj/%=obj/%)
76         i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
77
78
79 obj/test/%.o: obj/test/%.cpp $(HEADERS)
80         i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $<
81
82 test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
83         i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework-mt-s
84
85
86 clean:
87         -rm -f obj/*.o
88         -rm -f obj/test/*.o
89         -rm -f test/*.o
90         -rm -f headers.h.gch
91         -rm -f bitcoind.exe
92         -rm -f test_bitcoin.exe
93         -rm -f src/build.h
94
95 FORCE: