Makefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Uncomment these if you are on OS X and want to build universal libraries.
  2. # This is only important if you intend to produce a Ledger binary for
  3. # installation.
  4. STOW_ROOT = /usr/local/Cellar/boost
  5. PRODUCTS = $(HOME)/Products
  6. GCC_VERSION = 4.7
  7. BOOST_VERSION = 1_52_0
  8. CC = gcc-mp-$(GCC_VERSION)
  9. ifeq ($(CC),clang)
  10. CXX = clang++
  11. LD = llvm-ld
  12. DIR_SUFFIX = clang
  13. OPTJ =
  14. else
  15. CXX = g++-mp-$(GCC_VERSION)
  16. LD = gcc-mp-$(GCC_VERSION)
  17. DIR_SUFFIX = gcc$(subst .,,$(GCC_VERSION))
  18. OPTJ = #-j8
  19. endif
  20. CFLAGS = $(CPPFLAGS) -g2 -ggdb
  21. LDFLAGS = -g2 -ggdb
  22. BOOST_SOURCE = boost-release
  23. ifeq ($(GCC_VERSION),4.7)
  24. BOOST_DEFINES = define=_GLIBCXX__PTHREADS=1
  25. else
  26. BOOST_DEFINES =
  27. endif
  28. ifeq ($(CC),clang)
  29. BOOST_TOOLSET = clang
  30. else
  31. BOOST_TOOLSET = darwin
  32. endif
  33. BOOST_FLAGS = toolset=$(BOOST_TOOLSET) --layout=versioned \
  34. link=shared threading=single $(BOOST_DEFINES)
  35. BOOST_DIR = boost_$(BOOST_VERSION)-$(DIR_SUFFIX)
  36. BOOST_STOW = $(STOW_ROOT)/$(BOOST_VERSION)
  37. BOOST_BUILD = $(PRODUCTS)/$(BOOST_DIR)
  38. all: boost-build
  39. prepare-boost:
  40. perl -i -pe 's/local command = \[ common\.get-invocation-command darwin : g\+\+ : .*/local command = [ common.get-invocation-command darwin : g++ : $(CXX) ] ;/;' $(BOOST_SOURCE)/tools/build/v2/tools/darwin.jam
  41. perl -i -pe 's/flags darwin\.compile OPTIONS : -no-cpp-precomp -gdwarf-2 (-fexceptions )?;/flags darwin\.compile OPTIONS : -gdwarf-2 \1;/;' $(BOOST_SOURCE)/tools/build/v2/tools/darwin.jam
  42. boost-build: prepare-boost
  43. (cd $(BOOST_SOURCE) && \
  44. sh bootstrap.sh && \
  45. ./b2 $(OPTJ) debug release --prefix=$(BOOST_STOW) \
  46. --build-dir=$(BOOST_BUILD) $(BOOST_FLAGS) install)
  47. clean:
  48. -rm -fr $(BOOST_STOW) $(BOOST_BUILD)