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 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
  42. HEADERS = \
  43. base58.h \
  44. bignum.h \
  45. checkpoints.h \
  46. crypter.h \
  47. db.h \
  48. headers.h \
  49. init.h \
  50. irc.h \
  51. key.h \
  52. keystore.h \
  53. main.h \
  54. net.h \
  55. noui.h \
  56. protocol.h \
  57. bitcoinrpc.h \
  58. script.h \
  59. serialize.h \
  60. strlcpy.h \
  61. uint256.h \
  62. util.h \
  63. wallet.h
  64. OBJS= \
  65. obj/checkpoints.o \
  66. obj/crypter.o \
  67. obj/key.o \
  68. obj/db.o \
  69. obj/init.o \
  70. obj/irc.o \
  71. obj/keystore.o \
  72. obj/main.o \
  73. obj/net.o \
  74. obj/protocol.o \
  75. obj/bitcoinrpc.o \
  76. obj/rpcdump.o \
  77. obj/script.o \
  78. obj/util.o \
  79. obj/wallet.o
  80. ifdef USE_UPNP
  81. DEFS += -DUSE_UPNP=$(USE_UPNP)
  82. ifdef STATIC
  83. LIBS += $(DEPSDIR)/lib/libminiupnpc.a
  84. else
  85. LIBS += -lminiupnpc
  86. endif
  87. endif
  88. all: bitcoind
  89. # auto-generated dependencies:
  90. -include obj/nogui/*.P
  91. -include obj/test/*.P
  92. obj/nogui/%.o: %.cpp
  93. $(CXX) -c $(CFLAGS) -MMD -o $@ $<
  94. @cp $(@:%.o=%.d) $(@:%.o=%.P); \
  95. sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
  96. -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
  97. rm -f $(@:%.o=%.d)
  98. bitcoind: $(OBJS:obj/%=obj/nogui/%)
  99. $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
  100. TESTOBJS := $(patsubst test/%.cpp,obj/test/%.o,$(wildcard test/*.cpp))
  101. obj/test/%.o: test/%.cpp
  102. $(CXX) -c $(CFLAGS) -MMD -o $@ $<
  103. @cp $(@:%.o=%.d) $(@:%.o=%.P); \
  104. sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
  105. -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
  106. rm -f $(@:%.o=%.d)
  107. test_bitcoin: $(TESTOBJS) $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
  108. $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) $(DEPSDIR)/lib/libboost_unit_test_framework-mt.a
  109. clean:
  110. -rm -f bitcoind test_bitcoin
  111. -rm -f obj/*.o
  112. -rm -f obj/nogui/*.o
  113. -rm -f obj/test/*.o
  114. -rm -f obj/*.P
  115. -rm -f obj/nogui/*.P
  116. -rm -f obj/test/*.P