You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

makefile.osx 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # -*- mode: Makefile; -*-
  2. # Copyright (c) 2011 Bitcoin Developers
  3. # Distributed under the MIT/X11 software license, see the accompanying
  4. # file license.txt or http://www.opensource.org/licenses/mit-license.php.
  5. # Mac OS X makefile for bitcoin
  6. # Originally by Laszlo Hanyecz (solar@heliacal.net)
  7. CXX=llvm-g++
  8. DEPSDIR=/opt/local
  9. INCLUDEPATHS= \
  10. -I"$(CURDIR)" \
  11. -I"$(DEPSDIR)/include" \
  12. -I"$(DEPSDIR)/include/db48"
  13. LIBPATHS= \
  14. -L"$(DEPSDIR)/lib" \
  15. -L"$(DEPSDIR)/lib/db48"
  16. USE_UPNP:=1
  17. LIBS= -dead_strip
  18. ifdef STATIC
  19. # Build STATIC if you are redistributing the bitcoind binary
  20. LIBS += \
  21. $(DEPSDIR)/lib/db48/libdb_cxx-4.8.a \
  22. $(DEPSDIR)/lib/libboost_system-mt.a \
  23. $(DEPSDIR)/lib/libboost_filesystem-mt.a \
  24. $(DEPSDIR)/lib/libboost_program_options-mt.a \
  25. $(DEPSDIR)/lib/libboost_thread-mt.a \
  26. $(DEPSDIR)/lib/libssl.a \
  27. $(DEPSDIR)/lib/libcrypto.a
  28. else
  29. LIBS += \
  30. -ldb_cxx-4.8 \
  31. -lboost_system-mt \
  32. -lboost_filesystem-mt \
  33. -lboost_program_options-mt \
  34. -lboost_thread-mt \
  35. -lssl \
  36. -lcrypto
  37. endif
  38. DEFS=-DMAC_OSX -DMSG_NOSIGNAL=0 -DUSE_SSL
  39. DEBUGFLAGS=-g
  40. # ppc doesn't work because we don't support big-endian
  41. CFLAGS=-mmacosx-version-min=10.5 -arch i386 -O3 \
  42. -Wextra -Wno-sign-compare -Wno-char-subscripts -Wno-invalid-offsetof -Wformat-security \
  43. $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
  44. OBJS= \
  45. obj/checkpoints.o \
  46. obj/netbase.o \
  47. obj/crypter.o \
  48. obj/key.o \
  49. obj/db.o \
  50. obj/init.o \
  51. obj/irc.o \
  52. obj/keystore.o \
  53. obj/main.o \
  54. obj/net.o \
  55. obj/protocol.o \
  56. obj/bitcoinrpc.o \
  57. obj/rpcdump.o \
  58. obj/script.o \
  59. obj/util.o \
  60. obj/wallet.o
  61. ifdef USE_UPNP
  62. DEFS += -DUSE_UPNP=$(USE_UPNP)
  63. ifdef STATIC
  64. LIBS += $(DEPSDIR)/lib/libminiupnpc.a
  65. else
  66. LIBS += -lminiupnpc
  67. endif
  68. endif
  69. all: bitcoind
  70. # auto-generated dependencies:
  71. -include obj/*.P
  72. -include obj/test/*.P
  73. obj/%.o: %.cpp
  74. $(CXX) -c $(CFLAGS) -MMD -o $@ $<
  75. @cp $(@:%.o=%.d) $(@:%.o=%.P); \
  76. sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
  77. -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
  78. rm -f $(@:%.o=%.d)
  79. bitcoind: $(OBJS:obj/%=obj/%)
  80. $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
  81. TESTOBJS := $(patsubst test/%.cpp,obj/test/%.o,$(wildcard test/*.cpp))
  82. obj/test/%.o: test/%.cpp
  83. $(CXX) -c $(CFLAGS) -MMD -o $@ $<
  84. @cp $(@:%.o=%.d) $(@:%.o=%.P); \
  85. sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
  86. -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
  87. rm -f $(@:%.o=%.d)
  88. test_bitcoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
  89. $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) $(DEPSDIR)/lib/libboost_unit_test_framework-mt.a
  90. clean:
  91. -rm -f bitcoind test_bitcoin
  92. -rm -f obj/*.o
  93. -rm -f obj/test/*.o
  94. -rm -f obj/*.P
  95. -rm -f obj/test/*.P