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"
29 # Build STATIC if you are redistributing the bitcoind binary
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 \
43 -lboost_filesystem-mt \
44 -lboost_program_options-mt \
51 DEFS=-DMAC_OSX -DMSG_NOSIGNAL=0 -DBOOST_SPIRIT_THREADSAFE -D__STDC_FORMAT_MACROS
54 # Compile for maximum compatibility and smallest size.
55 # This requires that dependencies are compiled
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)
89 obj/rpcrawtransaction.o \
101 ifneq (${USE_UPNP}, -)
102 DEFS += -DUSE_UPNP=$(USE_UPNP)
104 LIBS += $(DEPSDIR)/lib/libminiupnpc.a
110 ifneq (${USE_IPV6}, -)
111 DEFS += -DUSE_IPV6=$(USE_IPV6)
120 LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
121 DEFS += $(addprefix -I,$(CURDIR)/leveldb/include) -DUSE_LEVELDB
122 DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
123 OBJS += obj/txdb-leveldb.o
124 leveldb/libleveldb.a:
125 @echo "Building LevelDB ..."; cd leveldb; make; cd ..
126 obj/txdb-leveldb.o: leveldb/libleveldb.a
128 OBJS += obj/txdb-bdb.o
132 # Assembler implementation
133 OBJS += scrypt-asm/obj/scrypt-arm.o scrypt-asm/obj/scrypt-x86.o scrypt-asm/obj/scrypt-x86_64.o scrypt-asm/obj/asm-wrapper.o
135 scrypt-asm/obj/scrypt-x86.o: scrypt-asm/scrypt-x86.S
136 $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
138 scrypt-asm/obj/scrypt-x86_64.o: scrypt-asm/scrypt-x86_64.S
139 $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
141 scrypt-asm/obj/scrypt-arm.o: scrypt-asm/scrypt-arm.S
142 $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
144 scrypt-asm/obj/asm-wrapper.o: scrypt-asm/asm-wrapper.cpp
145 $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
147 ifeq (${USE_SSE2}, 1)
148 # Intrinsic implementation
150 OBJS += scrypt-intrin/obj/scrypt-sse2.o
152 scrypt-intrin/obj/scrypt-sse2.o: scrypt-intrin/scrypt-sse2.cpp
153 $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
155 ifneq (${USE_ASM}, 1)
156 # Generic implementation
157 OBJS += obj/scrypt-generic.o
159 obj/scrypt-generic.o: scrypt-generic.cpp
160 $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
166 # auto-generated dependencies:
170 /bin/sh ../share/genbuild.sh obj/build.h
171 version.cpp: obj/build.h
172 DEFS += -DHAVE_BUILD_INFO
175 $(CXX) -c $(CFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
176 @cp $(@:%.o=%.d) $(@:%.o=%.P); \
177 sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
178 -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
181 novacoind: $(OBJS:obj/%=obj/%)
182 $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
189 -rm -f scrypt-asm/obj/*.o
190 -rm -f scrypt-asm/obj/*.P
191 -rm -f scrypt-asm/obj/*.d
192 -rm -f scrypt-intrin/obj/*.o
193 -rm -f scrypt-intrin/obj/*.P
194 -rm -f scrypt-intrin/obj/*.d