• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1##===- runtime/libprofile/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
10LEVEL = ../..
11include $(LEVEL)/Makefile.config
12
13LIBRARYNAME = profile_rt
14LINK_LIBS_IN_SHARED = 1
15SHARED_LIBRARY = 1
16
17# Build and install this archive.
18BUILD_ARCHIVE = 1
19override NO_INSTALL_ARCHIVES =
20
21include $(LEVEL)/Makefile.common
22
23ifeq ($(HOST_OS),Darwin)
24    # Special hack to allow libprofile_rt to have an offset version number.
25    PROFILE_RT_LIBRARY_VERSION := $(LLVM_SUBMIT_VERSION)
26
27    # Set dylib internal version number to llvmCore submission number.
28    ifdef LLVM_SUBMIT_VERSION
29        LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
30                        -Wl,$(PROFILE_RT_LIBRARY_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
31                        -Wl,-compatibility_version -Wl,1
32    endif
33    # Extra options to override libtool defaults.
34    LLVMLibsOptions    := $(LLVMLibsOptions)  \
35                         -Wl,-dead_strip
36
37    # Mac OS X 10.4 and earlier tools do not allow a second -install_name on
38    # command line.
39    DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
40    ifneq ($(DARWIN_VERS),8)
41       LLVMLibsOptions    := $(LLVMLibsOptions) \
42                            -Wl,-install_name \
43                            -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)"
44    endif
45
46    # If we're doing an Apple-style build, add the LTO object path.
47    ifeq ($(RC_XBS),YES)
48       TempFile           := $(shell mkdir -p ${OBJROOT}/dSYMs ; mktemp ${OBJROOT}/dSYMs/profile_rt-lto.XXXXXX)
49       LLVMLibsOptions    := $(LLVMLibsOptions) \
50                             -Wl,-object_path_lto -Wl,$(TempFile)
51    endif
52endif
53