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.
6 # Mac OS X makefile for bitcoin
7 # Originally by Laszlo Hanyecz (solar@heliacal.net)
15 -I"$(DEPSDIR)/include" \
16 -I"$(DEPSDIR)/include/db48"
20 -L"$(DEPSDIR)/lib/db48"
28 # Build STATIC if you are redistributing the bitcoind binary
30 $(DEPSDIR)/lib/db48/libdb_cxx-4.8.a \
31 $(DEPSDIR)/lib/libboost_system-mt.a \
32 $(DEPSDIR)/lib/libboost_filesystem-mt.a \
33 $(DEPSDIR)/lib/libboost_program_options-mt.a \
34 $(DEPSDIR)/lib/libboost_thread-mt.a \
35 $(DEPSDIR)/lib/libssl.a \
36 $(DEPSDIR)/lib/libcrypto.a \
42 -lboost_filesystem-mt \
43 -lboost_program_options-mt \
50 DEFS=-DMAC_OSX -DMSG_NOSIGNAL=0 -DBOOST_SPIRIT_THREADSAFE -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
53 # Compile for maximum compatibility and smallest size.
54 # This requires that dependencies are compiled
61 # ppc doesn't work because we don't support big-endian
62 CFLAGS += -Wall -Wextra -Wformat -Wno-ignored-qualifiers -Wformat-security -Wno-unused-parameter \
63 $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
90 obj/rpcrawtransaction.o \
100 ifneq (${USE_IPV6}, -)
101 DEFS += -DUSE_IPV6=$(USE_IPV6)
110 LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
111 DEFS += $(addprefix -I,$(CURDIR)/leveldb/include) -DUSE_LEVELDB
112 DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
113 OBJS += obj/txdb-leveldb.o
114 leveldb/libleveldb.a:
115 @echo "Building LevelDB ..."; cd leveldb; make; cd ..
116 obj/txdb-leveldb.o: leveldb/libleveldb.a
118 OBJS += obj/txdb-bdb.o
122 # Assembler implementation
123 OBJS += crypto/scrypt/asm/obj/scrypt-x86.o crypto/scrypt/asm/obj/scrypt-x86_64.o crypto/scrypt/asm/obj/asm-wrapper.o
125 crypto/scrypt/asm/obj/scrypt-x86.o: crypto/scrypt/asm/scrypt-x86.S
126 $(CXX) -c $(CFLAGS) -MMD -o $@ $<
128 crypto/scrypt/asm/obj/scrypt-x86_64.o: crypto/scrypt/asm/scrypt-x86_64.S
129 $(CXX) -c $(CFLAGS) -MMD -o $@ $<
131 crypto/scrypt/asm/obj/asm-wrapper.o: crypto/scrypt/asm/asm-wrapper.cpp
132 $(CXX) -c $(CFLAGS) -MMD -o $@ $<
137 ifeq (${USE_SSE2}, 1)
138 # Intrinsic implementation
140 OBJS += crypto/scrypt/intrin/obj/scrypt-sse2.o
142 crypto/scrypt/intrin/obj/scrypt-sse2.o: crypto/scrypt/intrin/scrypt-sse2.cpp
143 $(CXX) -c $(CFLAGS) -MMD -o $@ $<
145 # Generic implementation
146 OBJS += crypto/scrypt/generic/obj/scrypt-generic.o
148 crypto/scrypt/generic/obj/scrypt-generic.o: crypto/scrypt/generic/scrypt-generic.cpp
149 $(CXX) -c $(CFLAGS) -MMD -o $@ $<
154 # auto-generated dependencies:
158 /bin/sh ../share/genbuild.sh obj/build.h
159 version.cpp: obj/build.h
160 DEFS += -DHAVE_BUILD_INFO
163 $(CXX) -c $(CFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
164 @cp $(@:%.o=%.d) $(@:%.o=%.P); \
165 sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
166 -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
169 novacoind: $(OBJS:obj/%=obj/%)
170 $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
177 -rm -f crypto/scrypt/asm/obj/*.o
178 -rm -f crypto/scrypt/asm/obj/*.P
179 -rm -f crypto/scrypt/asm/obj/*.d
180 -rm -f crypto/scrypt/intrin/obj/*.o
181 -rm -f crypto/scrypt/intrin/obj/*.P
182 -rm -f crypto/scrypt/intrin/obj/*.d
183 -rm -f crypto/scrypt/generic/obj/*.o
184 -rm -f crypto/scrypt/generic/obj/*.P
185 -rm -f crypto/scrypt/generic/obj/*.d