GNUmakefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. # LLVM LOCAL file build machinery
  2. # LLVM Compiler Makefile for use by buildit.
  3. #
  4. # This makefile is intended only for use with B&I buildit. For "normal" builds
  5. # use the conventional top-level makefile.
  6. #
  7. # You can specify TARGETS=ppc (or i386) on the buildit command line to limit the
  8. # build to just one target. The default is for ppc and i386. The compiler
  9. # targeted at this host gets built anyway, but not installed unless it's listed
  10. # in TARGETS.
  11. # Include the set of standard Apple makefile definitions.
  12. ifndef CoreOSMakefiles
  13. CoreOSMakefiles = $(MAKEFILEPATH)/CoreOS
  14. endif
  15. include $(CoreOSMakefiles)/Standard/Standard.make
  16. # Enable Apple extensions to (gnu)make.
  17. USE_APPLE_PB_SUPPORT = all
  18. RC_ARCHS := ppc i386
  19. HOSTS = $(RC_ARCHS)
  20. targets = echo $(RC_ARCHS)
  21. TARGETS := $(shell $(targets))
  22. SRCROOT = .
  23. SRC = $(shell cd $(SRCROOT) && pwd | sed s,/private,,)
  24. OBJROOT = $(SRC)/obj
  25. SYMROOT = $(OBJROOT)/../sym
  26. DSTROOT = $(OBJROOT)/../dst
  27. #######################################################################
  28. PREFIX = /usr/local
  29. # Unless assertions are forced on in the GMAKE command line, disable them.
  30. ifndef ENABLE_ASSERTIONS
  31. ENABLE_ASSERTIONS := no
  32. endif
  33. # Default is optimized build.
  34. ifeq ($(LLVM_DEBUG),1)
  35. LLVM_OPTIMIZED := no
  36. else
  37. LLVM_OPTIMIZED := yes
  38. endif
  39. # Default to do a native build, not a cross-build for an ARM host or simulator.
  40. ARM_HOSTED_BUILD := no
  41. IOS_SIM_BUILD := no
  42. ifndef RC_ProjectSourceVersion
  43. RC_ProjectSourceVersion = 9999
  44. endif
  45. ifndef RC_ProjectSourceSubversion
  46. RC_ProjectSourceSubversion = 0
  47. endif
  48. # NOTE : Always put version numbers at the end because they are optional.
  49. install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
  50. cd $(OBJROOT) && \
  51. $(SRC)/utils/buildit/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
  52. $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \
  53. $(ENABLE_ASSERTIONS) $(LLVM_OPTIMIZED) \
  54. $(ARM_HOSTED_BUILD) $(IOS_SIM_BUILD) \
  55. $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion)
  56. EmbeddedHosted:
  57. $(MAKE) ARM_HOSTED_BUILD=yes PREFIX=/usr/local install
  58. # When building for the iOS simulator, MACOSX_DEPLOYMENT_TARGET is not set
  59. # by default, but it needs to be set when building tools that run on the host
  60. # (e.g., tblgen), so set it here.
  61. EmbeddedSim:
  62. export MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion`; \
  63. $(MAKE) IOS_SIM_BUILD=yes PREFIX=$(SDKROOT)/usr/local install
  64. Embedded:
  65. ARM_PLATFORM=`xcodebuild -version -sdk iphoneos PlatformPath` && \
  66. $(MAKE) DSTROOT=$(DSTROOT)$$ARM_PLATFORM/Developer install
  67. # installhdrs does nothing, because the headers aren't useful until
  68. # the compiler is installed.
  69. installhdrs:
  70. # We build and install in one shell script.
  71. build:
  72. installsrc:
  73. @echo
  74. @echo ++++++++++++++++++++++
  75. @echo + Installing sources +
  76. @echo ++++++++++++++++++++++
  77. @echo
  78. if [ $(SRCROOT) != . ]; then \
  79. $(PAX) -rw . $(SRCROOT); \
  80. fi
  81. find -d "$(SRCROOT)" \( -type d -a -name .svn -o \
  82. -type f -a -name .DS_Store -o \
  83. -name \*~ -o -name .\#\* \) \
  84. -exec rm -rf {} \;
  85. rm -rf "$(SRCROOT)/test"
  86. #######################################################################
  87. clean:
  88. @echo
  89. @echo ++++++++++++
  90. @echo + Cleaning +
  91. @echo ++++++++++++
  92. @echo
  93. @if [ -d $(OBJROOT) -a "$(OBJROOT)" != / ]; then \
  94. echo '*** DELETING ' $(OBJROOT); \
  95. rm -rf $(OBJROOT); \
  96. fi
  97. @if [ -d $(SYMROOT) -a "$(SYMROOT)" != / ]; then \
  98. echo '*** DELETING ' $(SYMROOT); \
  99. rm -rf $(SYMROOT); \
  100. fi
  101. @if [ -d $(DSTROOT) -a "$(DSTROOT)" != / ]; then \
  102. echo '*** DELETING ' $(DSTROOT); \
  103. rm -rf $(DSTROOT); \
  104. fi
  105. #######################################################################
  106. $(OBJROOT) $(SYMROOT) $(DSTROOT):
  107. mkdir -p $@
  108. .PHONY: install installsrc clean EmbeddedHosted EmbeddedSim Embedded