2010-05-01 05:51:10 +08:00
|
|
|
##===- tools/libclang/Makefile -----------------------------*- Makefile -*-===##
|
2009-08-27 06:36:44 +08:00
|
|
|
#
|
|
|
|
# The LLVM Compiler Infrastructure
|
|
|
|
#
|
|
|
|
# This file is distributed under the University of Illinois Open Source
|
|
|
|
# License. See LICENSE.TXT for details.
|
|
|
|
#
|
|
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
|
2010-06-09 04:34:18 +08:00
|
|
|
CLANG_LEVEL := ../..
|
2010-05-01 05:51:10 +08:00
|
|
|
LIBRARYNAME = clang
|
2009-08-27 06:36:44 +08:00
|
|
|
|
2010-05-01 05:51:10 +08:00
|
|
|
EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/libclang.exports
|
2010-04-16 12:45:02 +08:00
|
|
|
|
2009-08-27 06:36:44 +08:00
|
|
|
LINK_LIBS_IN_SHARED = 1
|
|
|
|
SHARED_LIBRARY = 1
|
|
|
|
|
2012-08-09 00:27:29 +08:00
|
|
|
include $(CLANG_LEVEL)/../../Makefile.config
|
2013-01-20 02:24:13 +08:00
|
|
|
LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc
|
2013-01-07 23:45:20 +08:00
|
|
|
USEDLIBS = clangFrontend.a clangDriver.a \
|
|
|
|
clangTooling.a \
|
2012-09-01 13:09:24 +08:00
|
|
|
clangSerialization.a \
|
2013-01-07 23:45:20 +08:00
|
|
|
clangParse.a clangSema.a \
|
|
|
|
clangARCMigrate.a clangRewriteFrontend.a clangRewriteCore.a \
|
|
|
|
clangAnalysis.a clangEdit.a \
|
|
|
|
clangAST.a clangLex.a clangBasic.a \
|
2012-12-19 07:02:59 +08:00
|
|
|
clangFormat.a
|
2009-08-27 06:36:44 +08:00
|
|
|
|
2010-06-09 04:34:18 +08:00
|
|
|
include $(CLANG_LEVEL)/Makefile
|
2009-08-27 06:36:44 +08:00
|
|
|
|
2012-04-16 07:17:25 +08:00
|
|
|
# Add soname to the library.
|
2012-04-25 14:09:30 +08:00
|
|
|
ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU))
|
2012-04-16 07:17:25 +08:00
|
|
|
LDFLAGS += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT)
|
|
|
|
endif
|
|
|
|
|
2009-08-27 06:36:44 +08:00
|
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
# FIXME: This is copied from the 'lto' makefile. Should we share this?
|
|
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
|
|
|
|
ifeq ($(HOST_OS),Darwin)
|
2010-08-20 07:44:02 +08:00
|
|
|
LLVMLibsOptions += -Wl,-compatibility_version,1
|
|
|
|
|
|
|
|
# Set dylib internal version number to submission number.
|
2009-08-27 06:36:44 +08:00
|
|
|
ifdef LLVM_SUBMIT_VERSION
|
2010-08-20 07:44:02 +08:00
|
|
|
LLVMLibsOptions += -Wl,-current_version \
|
|
|
|
-Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION)
|
2009-08-27 06:36:44 +08:00
|
|
|
endif
|
2010-08-20 07:44:02 +08:00
|
|
|
|
|
|
|
# Extra options to override libtool defaults.
|
2012-04-21 06:07:11 +08:00
|
|
|
LLVMLibsOptions += -Wl,-dead_strip
|
2009-08-27 06:36:44 +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)
|
2010-08-20 07:44:02 +08:00
|
|
|
LLVMLibsOptions += -Wl,-install_name \
|
|
|
|
-Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)"
|
2009-08-27 06:36:44 +08:00
|
|
|
endif
|
2012-10-04 07:49:57 +08:00
|
|
|
|
|
|
|
# If we're doing an Apple-style build, add the LTO object path.
|
|
|
|
ifeq ($(RC_BUILDIT),YES)
|
2012-10-10 13:30:49 +08:00
|
|
|
TempFile := $(shell mkdir -p ${OBJROOT}/dSYMs ; mktemp ${OBJROOT}/dSYMs/clang-lto.XXXXXX)
|
2012-10-04 07:49:57 +08:00
|
|
|
LLVMLibsOptions += -Wl,-object_path_lto -Wl,$(TempFile)
|
|
|
|
endif
|
2009-08-27 06:36:44 +08:00
|
|
|
endif
|