Daniel Dunbar | 53a4d7e | 2010-09-15 03:53:45 +0000 | [diff] [blame] | 1 | ##===- clang/runtime/libcxx/Makefile -----------------------*- Makefile -*-===## |
| 2 | # |
| 3 | # The LLVM Compiler Infrastructure |
| 4 | # |
| 5 | # This file is distributed under the University of Illinois Open Source |
| 6 | # License. See LICENSE.TXT for details. |
| 7 | # |
| 8 | ##===----------------------------------------------------------------------===## |
| 9 | # |
| 10 | # This file defines support for building the "libc++" C++ standard library as |
| 11 | # part of a Clang compiler build. |
| 12 | # |
| 13 | ##===----------------------------------------------------------------------===## |
| 14 | |
| 15 | CLANG_LEVEL := ../.. |
| 16 | LEVEL := $(CLANG_LEVEL)/../.. |
| 17 | LIBRARYNAME = c++ |
| 18 | |
| 19 | LINK_LIBS_IN_SHARED = 1 |
| 20 | SHARED_LIBRARY = 1 |
| 21 | |
| 22 | # Include LLVM common makefile. |
| 23 | include $(LEVEL)/Makefile.config |
| 24 | |
| 25 | # Expect libcxx to be in llvm/projects/libcxx |
| 26 | LIBCXX_SRC_ROOT := $(LLVM_SRC_ROOT)/projects/libcxx |
| 27 | |
| 28 | # Override the source root to point at the libcxx sources. |
| 29 | PROJ_MAKEFILE := $(PROJ_SRC_DIR)/Makefile |
| 30 | PROJ_SRC_DIR := $(LIBCXX_SRC_ROOT)/src |
| 31 | CPP.Flags := -nostdinc++ -I$(LIBCXX_SRC_ROOT)/include |
| 32 | CXX.Flags := -std=c++0x |
| 33 | |
| 34 | # Include LLVM makefile rules. |
| 35 | include $(LLVM_SRC_ROOT)/Makefile.rules |
| 36 | |
| 37 | # Force building with the just built Clang. |
| 38 | # |
| 39 | # FIXME: Do we really want to do this? It is uber slow. |
| 40 | # CXX := $(ToolDir)/clang |
| 41 | |
| 42 | ifeq ($(HOST_OS),Darwin) |
| 43 | LLVMLibsOptions += -Wl,-compatibility_version,1 |
| 44 | |
| 45 | # Don't link with default libraries. |
Shantonu Sen | 2ab0303 | 2010-12-01 20:38:11 +0000 | [diff] [blame] | 46 | LLVMLibsOptions += -nodefaultlibs |
Daniel Dunbar | 53a4d7e | 2010-09-15 03:53:45 +0000 | [diff] [blame] | 47 | |
| 48 | # Reexport libc++abi. |
| 49 | LLVMLibsOptions += -Wl,-reexport_library,/usr/lib/libc++abi.dylib |
| 50 | |
| 51 | # Set dylib internal version number to submission number. |
| 52 | ifdef LLVM_SUBMIT_VERSION |
| 53 | LLVMLibsOptions += -Wl,-current_version \ |
| 54 | -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) |
| 55 | endif |
| 56 | |
| 57 | # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line |
| 58 | DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/') |
| 59 | ifneq ($(DARWIN_VERS),8) |
| 60 | LLVMLibsOptions += -Wl,-install_name \ |
| 61 | -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)" |
| 62 | endif |
| 63 | endif |