Remove unused includes.
[novacoin.git] / src / makefile.osx
1 # -*- mode: Makefile; -*-
2 # Copyright (c) 2011 Bitcoin Developers
3 # Distributed under the MIT/X11 software license, see the accompanying
4 # file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6 # Mac OS X makefile for bitcoin
7 # Originally by Laszlo Hanyecz (solar@heliacal.net)
8
9 CC=llvm-gcc
10 CXX=llvm-g++
11 DEPSDIR=/opt/local
12
13 INCLUDEPATHS= \
14  -I"$(CURDIR)" \
15  -I"$(CURDIR)"/obj \
16  -I"$(DEPSDIR)/include" \
17  -I"$(DEPSDIR)/include/db48"
18
19 LIBPATHS= \
20  -L"$(DEPSDIR)/lib" \
21  -L"$(DEPSDIR)/lib/db48"
22
23 USE_LEVELDB:=0
24 USE_IPV6:=1
25
26 LIBS= -dead_strip
27
28 ifdef STATIC
29 # Build STATIC if you are redistributing the bitcoind binary
30 LIBS += \
31  $(DEPSDIR)/lib/db48/libdb_cxx-4.8.a \
32  $(DEPSDIR)/lib/libboost_system-mt.a \
33  $(DEPSDIR)/lib/libboost_filesystem-mt.a \
34  $(DEPSDIR)/lib/libboost_program_options-mt.a \
35  $(DEPSDIR)/lib/libboost_thread-mt.a \
36  $(DEPSDIR)/lib/libssl.a \
37  $(DEPSDIR)/lib/libcrypto.a \
38  -lz
39 else
40 LIBS += \
41  -ldb_cxx-4.8 \
42  -lboost_system-mt \
43  -lboost_filesystem-mt \
44  -lboost_program_options-mt \
45  -lboost_thread-mt \
46  -lssl \
47  -lcrypto \
48  -lz
49 endif
50
51 DEFS=-DMAC_OSX -DMSG_NOSIGNAL=0 -DBOOST_SPIRIT_THREADSAFE -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
52
53 ifdef RELEASE
54 # Compile for maximum compatibility and smallest size.
55 # This requires that dependencies are compiled
56 # the same way.
57 CFLAGS = -O2 -msse2
58 else
59 CFLAGS = -g -msse2
60 endif
61
62 # ppc doesn't work because we don't support big-endian
63 CFLAGS += -Wall -Wextra -Wformat -Wno-ignored-qualifiers -Wformat-security -Wno-unused-parameter \
64     $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
65
66 OBJS= \
67     obj/alert.o \
68     obj/version.o \
69     obj/checkpoints.o \
70     obj/netbase.o \
71     obj/addrman.o \
72     obj/crypter.o \
73     obj/base58.o \
74     obj/key.o \
75     obj/db.o \
76     obj/init.o \
77     obj/irc.o \
78     obj/keystore.o \
79     obj/main.o \
80     obj/miner.o \
81     obj/net.o \
82     obj/ntp.o \
83     obj/stun.o \
84     obj/protocol.o \
85     obj/bitcoinrpc.o \
86     obj/rpccrypt.o \
87     obj/rpcdump.o \
88     obj/rpcnet.o \
89     obj/rpcmining.o \
90     obj/rpcwallet.o \
91     obj/rpcblockchain.o \
92     obj/rpcrawtransaction.o \
93     obj/script.o \
94     obj/sync.o \
95     obj/util.o \
96     obj/wallet.o \
97     obj/walletdb.o \
98     obj/noui.o \
99     obj/kernel.o \
100     obj/kernel_worker.o \
101     obj/ecies.o \
102     obj/cryptogram.o
103
104 ifneq (${USE_IPV6}, -)
105         DEFS += -DUSE_IPV6=$(USE_IPV6)
106 endif
107
108 all: novacoind
109
110 #
111 # LevelDB support
112 #
113 ifdef USE_LEVELDB
114 LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
115 DEFS += $(addprefix -I,$(CURDIR)/leveldb/include) -DUSE_LEVELDB
116 DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
117 OBJS += obj/txdb-leveldb.o
118 leveldb/libleveldb.a:
119         @echo "Building LevelDB ..."; cd leveldb; CC=$(CC) CXX=$(CXX) make; cd ..
120 obj/txdb-leveldb.o: leveldb/libleveldb.a
121 else
122 OBJS += obj/txdb-bdb.o
123 endif
124
125 ifeq (${USE_ASM}, 1)
126 # Assembler implementation
127 OBJS += crypto/scrypt/asm/obj/scrypt-x86.o crypto/scrypt/asm/obj/scrypt-x86_64.o crypto/scrypt/asm/obj/asm-wrapper.o
128
129 crypto/scrypt/asm/obj/scrypt-x86.o: crypto/scrypt/asm/scrypt-x86.S
130         $(CXX) -c $(CFLAGS) -MMD -o $@ $<
131
132 crypto/scrypt/asm/obj/scrypt-x86_64.o: crypto/scrypt/asm/scrypt-x86_64.S
133         $(CXX) -c $(CFLAGS) -MMD -o $@ $<
134
135 crypto/scrypt/asm/obj/asm-wrapper.o: crypto/scrypt/asm/asm-wrapper.cpp
136         $(CXX) -c $(CFLAGS) -MMD -o $@ $<
137
138 DEFS += -DUSE_ASM
139
140 else
141 ifeq  (${USE_SSE2}, 1)
142 # Intrinsic implementation
143 DEFS += -DUSE_SSE2
144 OBJS += crypto/scrypt/intrin/obj/scrypt-sse2.o
145
146 crypto/scrypt/intrin/obj/scrypt-sse2.o: crypto/scrypt/intrin/scrypt-sse2.cpp
147         $(CXX) -c $(CFLAGS) -MMD -o $@ $<
148 else
149 # Generic implementation
150 OBJS += crypto/scrypt/generic/obj/scrypt-generic.o
151
152 crypto/scrypt/generic/obj/scrypt-generic.o: crypto/scrypt/generic/scrypt-generic.cpp
153         $(CXX) -c $(CFLAGS) -MMD -o $@ $<
154 endif
155 endif
156
157
158 # auto-generated dependencies:
159 -include obj/*.P
160
161 obj/build.h: FORCE
162         /bin/sh ../share/genbuild.sh obj/build.h
163 version.cpp: obj/build.h
164 DEFS += -DHAVE_BUILD_INFO
165
166 obj/%.o: %.cpp
167         $(CXX) -c $(CFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
168         @cp $(@:%.o=%.d) $(@:%.o=%.P); \
169           sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
170               -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
171           rm -f $(@:%.o=%.d)
172
173 novacoind: $(OBJS:obj/%=obj/%)
174         $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
175
176 clean:
177         -rm -f novacoind
178         -rm -f obj/*.o
179         -rm -f obj/*.P
180         -rm -f obj/*.d
181         -rm -f crypto/scrypt/asm/obj/*.o
182         -rm -f crypto/scrypt/asm/obj/*.P
183         -rm -f crypto/scrypt/asm/obj/*.d
184         -rm -f crypto/scrypt/intrin/obj/*.o
185         -rm -f crypto/scrypt/intrin/obj/*.P
186         -rm -f crypto/scrypt/intrin/obj/*.d
187         -rm -f crypto/scrypt/generic/obj/*.o
188         -rm -f crypto/scrypt/generic/obj/*.P
189         -rm -f crypto/scrypt/generic/obj/*.d
190         -rm -f obj/build.h
191
192 FORCE: