1##===- tools/driver/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##===----------------------------------------------------------------------===##
9CLANG_LEVEL := ../..
10
11TOOLNAME = clang
12TOOLALIAS = clang++
13
14ifdef CLANG_ORDER_FILE
15TOOL_ORDER_FILE := $(CLANG_ORDER_FILE)
16endif
17
18# Include tool version information on OS X.
19TOOL_INFO_PLIST := Info.plist
20
21# Include this here so we can get the configuration of the targets that have
22# been configured for construction. We have to do this early so we can set up
23# LINK_COMPONENTS before including Makefile.rules
24include $(CLANG_LEVEL)/../../Makefile.config
25
26# Have the option of not supporting plugins. This is important for startup
27# performance.
28ifeq ($(CLANG_PLUGIN_SUPPORT), 1)
29NO_DEAD_STRIP := 1
30else
31TOOL_NO_EXPORTS := 1
32endif
33
34LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
35                   instrumentation ipo irreader linker objcarcopts option \
36                   profiledata selectiondag
37USEDLIBS = clangFrontendTool.a clangFrontend.a clangDriver.a \
38           clangSerialization.a clangCodeGen.a clangParse.a clangSema.a \
39           clangRewriteFrontend.a clangRewrite.a
40
41ifeq ($(ENABLE_CLANG_STATIC_ANALYZER),1)
42USEDLIBS += clangStaticAnalyzerFrontend.a clangStaticAnalyzerCheckers.a \
43            clangStaticAnalyzerCore.a
44endif
45
46ifeq ($(ENABLE_CLANG_ARCMT),1)
47USEDLIBS += clangARCMigrate.a
48endif
49
50USEDLIBS += clangAnalysis.a clangEdit.a clangAST.a clangLex.a clangBasic.a
51
52include $(CLANG_LEVEL)/Makefile
53
54# Set the tool version information values.
55ifeq ($(HOST_OS),Darwin)
56ifdef CLANG_VENDOR
57TOOL_INFO_NAME := $(CLANG_VENDOR) clang
58else
59TOOL_INFO_NAME := clang
60endif
61
62ifdef CLANG_VENDOR_UTI
63TOOL_INFO_UTI := $(CLANG_VENDOR_UTI)
64else
65TOOL_INFO_UTI := org.llvm.clang
66endif
67
68TOOL_INFO_VERSION := $(word 3,$(shell grep "CLANG_VERSION " \
69	$(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include/clang/Basic/Version.inc))
70ifdef LLVM_SUBMIT_VERSION
71TOOL_INFO_BUILD_VERSION := $(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION)
72else
73TOOL_INFO_BUILD_VERSION :=
74endif
75endif
76