summaryrefslogtreecommitdiff
path: root/tools/driver/Makefile
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-07-15 19:33:44 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-07-15 19:33:44 +0000
commit7bad56cd0c9c1ae816c47a217461dbce986620c5 (patch)
treeafb6f3cf2f1327d89a340de25b7947df8e4c6709 /tools/driver/Makefile
parent7c7a79303b62f51c1ff02f9ce41d81211a69d3b4 (diff)
downloadclang-7bad56cd0c9c1ae816c47a217461dbce986620c5.tar.gz
clang-7bad56cd0c9c1ae816c47a217461dbce986620c5.tar.bz2
clang-7bad56cd0c9c1ae816c47a217461dbce986620c5.tar.xz
build/Darwin: Enable version information for clang executable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108445 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver/Makefile')
-rw-r--r--tools/driver/Makefile26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/driver/Makefile b/tools/driver/Makefile
index b049af64bb..b8c91e8873 100644
--- a/tools/driver/Makefile
+++ b/tools/driver/Makefile
@@ -17,6 +17,9 @@ else
endif
endif
+# Include tool version information on OS X.
+TOOL_INFO_PLIST := Info.plist
+
# Include this here so we can get the configuration of the targets that have
# been configured for construction. We have to do this early so we can set up
# LINK_COMPONENTS before including Makefile.rules
@@ -30,6 +33,29 @@ USEDLIBS = clangFrontend.a clangDriver.a clangCodeGen.a clangSema.a \
include $(CLANG_LEVEL)/Makefile
+# Set the tool version information values.
+ifeq ($(HOST_OS),Darwin)
+ifdef CLANG_VENDOR
+TOOL_INFO_NAME := $(CLANG_VENDOR) clang
+else
+TOOL_INFO_NAME := clang
+endif
+
+ifdef CLANG_VENDOR_UTI
+TOOL_INFO_UTI := $(CLANG_VENDOR_UTI)
+else
+TOOL_INFO_UTI := org.llvm.clang
+endif
+
+TOOL_INFO_VERSION := $(word 3,$(shell grep "CLANG_VERSION " \
+ $(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include/clang/Basic/Version.inc))
+ifdef LLVM_SUBMIT_VERSION
+TOOL_INFO_BUILD_VERSION := $(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION)
+else
+TOOL_INFO_BUILD_VERSION :=
+endif
+endif
+
# Translate make variable to define when building a "production" clang.
ifdef CLANG_IS_PRODUCTION
CPP.Defines += -DCLANG_IS_PRODUCTION