2006-11-17 11:32:33 +08:00
|
|
|
##===- runtime/libprofile/Makefile -------------------------*- Makefile -*-===##
|
2010-09-03 23:42:45 +08:00
|
|
|
#
|
2006-11-17 11:32:33 +08:00
|
|
|
# The LLVM Compiler Infrastructure
|
|
|
|
#
|
2007-12-30 04:11:13 +08:00
|
|
|
# This file is distributed under the University of Illinois Open Source
|
|
|
|
# License. See LICENSE.TXT for details.
|
2010-09-03 23:42:45 +08:00
|
|
|
#
|
2006-11-17 11:32:33 +08:00
|
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
|
|
|
|
LEVEL = ../..
|
2009-08-29 00:13:45 +08:00
|
|
|
include $(LEVEL)/Makefile.config
|
|
|
|
|
2010-02-23 18:28:06 +08:00
|
|
|
ifneq ($(strip $(LLVMCC)),)
|
2006-11-17 11:32:33 +08:00
|
|
|
BYTECODE_LIBRARY = 1
|
2009-08-20 13:12:55 +08:00
|
|
|
endif
|
2006-11-17 11:32:33 +08:00
|
|
|
LIBRARYNAME = profile_rt
|
2011-04-29 10:12:06 +08:00
|
|
|
LINK_LIBS_IN_SHARED = 1
|
|
|
|
SHARED_LIBRARY = 1
|
2006-11-17 11:32:33 +08:00
|
|
|
|
2011-07-20 07:33:42 +08:00
|
|
|
# Build and install this archive.
|
|
|
|
BUILD_ARCHIVE = 1
|
|
|
|
override NO_INSTALL_ARCHIVES =
|
|
|
|
|
2006-11-17 11:32:33 +08:00
|
|
|
include $(LEVEL)/Makefile.common
|
2011-06-14 04:14:37 +08:00
|
|
|
|
|
|
|
ifeq ($(HOST_OS),Darwin)
|
|
|
|
# Special hack to allow libprofile_rt to have an offset version number.
|
2011-06-15 12:56:13 +08:00
|
|
|
PROFILE_RT_LIBRARY_VERSION := $(LLVM_SUBMIT_VERSION)
|
2011-06-14 04:14:37 +08:00
|
|
|
|
|
|
|
# Set dylib internal version number to llvmCore submission number.
|
|
|
|
ifdef LLVM_SUBMIT_VERSION
|
|
|
|
LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
|
2011-06-15 12:56:13 +08:00
|
|
|
-Wl,$(PROFILE_RT_LIBRARY_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
|
2011-06-14 04:14:37 +08:00
|
|
|
-Wl,-compatibility_version -Wl,1
|
|
|
|
endif
|
|
|
|
# Extra options to override libtool defaults.
|
|
|
|
LLVMLibsOptions := $(LLVMLibsOptions) \
|
2013-06-04 23:26:37 +08:00
|
|
|
-Wl,-dead_strip
|
2011-06-14 04:14:37 +08:00
|
|
|
|
|
|
|
# Mac OS X 10.4 and earlier tools do not allow a second -install_name on
|
|
|
|
# command line.
|
|
|
|
DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
|
|
|
|
ifneq ($(DARWIN_VERS),8)
|
2012-10-04 07:52:10 +08:00
|
|
|
LLVMLibsOptions := $(LLVMLibsOptions) \
|
2011-06-14 04:14:37 +08:00
|
|
|
-Wl,-install_name \
|
|
|
|
-Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
|
|
|
|
endif
|
2012-10-04 07:52:10 +08:00
|
|
|
|
|
|
|
# If we're doing an Apple-style build, add the LTO object path.
|
2013-02-14 03:44:08 +08:00
|
|
|
ifeq ($(RC_XBS),YES)
|
2012-10-10 13:29:15 +08:00
|
|
|
TempFile := $(shell mkdir -p ${OBJROOT}/dSYMs ; mktemp ${OBJROOT}/dSYMs/profile_rt-lto.XXXXXX)
|
2012-10-04 07:52:10 +08:00
|
|
|
LLVMLibsOptions := $(LLVMLibsOptions) \
|
|
|
|
-Wl,-object_path_lto -Wl,$(TempFile)
|
|
|
|
endif
|
2011-06-14 04:14:37 +08:00
|
|
|
endif
|