Reid Spencer | 8b2e141 | 2006-11-17 03:32:33 +0000 | [diff] [blame] | 1 | ##===- runtime/libprofile/Makefile -------------------------*- Makefile -*-===## |
Mikhail Glushenkov | a7236d3 | 2010-09-03 15:42:45 +0000 | [diff] [blame] | 2 | # |
Reid Spencer | 8b2e141 | 2006-11-17 03:32:33 +0000 | [diff] [blame] | 3 | # The LLVM Compiler Infrastructure |
| 4 | # |
Chris Lattner | 57360d1 | 2007-12-29 20:11:13 +0000 | [diff] [blame] | 5 | # This file is distributed under the University of Illinois Open Source |
| 6 | # License. See LICENSE.TXT for details. |
Mikhail Glushenkov | a7236d3 | 2010-09-03 15:42:45 +0000 | [diff] [blame] | 7 | # |
Reid Spencer | 8b2e141 | 2006-11-17 03:32:33 +0000 | [diff] [blame] | 8 | ##===----------------------------------------------------------------------===## |
| 9 | |
| 10 | LEVEL = ../.. |
Andreas Neustifter | 1c29357 | 2009-08-28 16:13:45 +0000 | [diff] [blame] | 11 | include $(LEVEL)/Makefile.config |
| 12 | |
Daniel Dunbar | 7cfbe25 | 2010-02-23 10:28:06 +0000 | [diff] [blame] | 13 | ifneq ($(strip $(LLVMCC)),) |
Reid Spencer | 8b2e141 | 2006-11-17 03:32:33 +0000 | [diff] [blame] | 14 | BYTECODE_LIBRARY = 1 |
Daniel Dunbar | a4b62c4 | 2009-08-20 05:12:55 +0000 | [diff] [blame] | 15 | endif |
Reid Spencer | 8b2e141 | 2006-11-17 03:32:33 +0000 | [diff] [blame] | 16 | LIBRARYNAME = profile_rt |
Nick Lewycky | bcffb1f | 2011-04-29 02:12:06 +0000 | [diff] [blame] | 17 | LINK_LIBS_IN_SHARED = 1 |
| 18 | SHARED_LIBRARY = 1 |
Mikhail Glushenkov | a7236d3 | 2010-09-03 15:42:45 +0000 | [diff] [blame] | 19 | EXTRA_DIST = libprofile.exports |
| 20 | EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/libprofile.exports |
Reid Spencer | 8b2e141 | 2006-11-17 03:32:33 +0000 | [diff] [blame] | 21 | |
| 22 | include $(LEVEL)/Makefile.common |
Bill Wendling | 1922a11 | 2011-06-13 20:14:37 +0000 | [diff] [blame^] | 23 | |
| 24 | ifeq ($(HOST_OS),Darwin) |
| 25 | # Special hack to allow libprofile_rt to have an offset version number. |
| 26 | ifdef LLVM_LTO_VERSION_OFFSET |
| 27 | LTO_LIBRARY_VERSION := $(shell expr $(LLVM_SUBMIT_VERSION) + \ |
| 28 | $(LLVM_LTO_VERSION_OFFSET)) |
| 29 | else |
| 30 | LTO_LIBRARY_VERSION := $(LLVM_SUBMIT_VERSION) |
| 31 | endif |
| 32 | |
| 33 | # Set dylib internal version number to llvmCore submission number. |
| 34 | ifdef LLVM_SUBMIT_VERSION |
| 35 | LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \ |
| 36 | -Wl,$(LTO_LIBRARY_VERSION).$(LLVM_SUBMIT_SUBVERSION) \ |
| 37 | -Wl,-compatibility_version -Wl,1 |
| 38 | endif |
| 39 | # Extra options to override libtool defaults. |
| 40 | LLVMLibsOptions := $(LLVMLibsOptions) \ |
| 41 | -Wl,-dead_strip \ |
| 42 | -Wl,-seg1addr -Wl,0xE0000000 |
| 43 | |
| 44 | # Mac OS X 10.4 and earlier tools do not allow a second -install_name on |
| 45 | # command line. |
| 46 | DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/') |
| 47 | ifneq ($(DARWIN_VERS),8) |
| 48 | LLVMLibsOptions := $(LLVMLibsOptions) \ |
| 49 | -Wl,-install_name \ |
| 50 | -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)" |
| 51 | endif |
| 52 | endif |