blob: abe70983df42e0bf8b8fe3f8d3bc8eb71ae2b2db [file] [log] [blame]
Daniel Dunbar544ecd12009-03-02 19:59:07 +00001##===- tools/driver/Makefile -------------------------------*- Makefile -*-===##
Daniel Dunbarf72bdf72009-12-11 22:20:12 +00002#
Daniel Dunbar544ecd12009-03-02 19:59:07 +00003# The LLVM Compiler Infrastructure
4#
5# This file is distributed under the University of Illinois Open Source
6# License. See LICENSE.TXT for details.
Daniel Dunbarf72bdf72009-12-11 22:20:12 +00007#
Daniel Dunbar544ecd12009-03-02 19:59:07 +00008##===----------------------------------------------------------------------===##
Daniel Dunbare6c1daa2010-06-08 20:34:18 +00009CLANG_LEVEL := ../..
Daniel Dunbar544ecd12009-03-02 19:59:07 +000010
Daniel Dunbar36245c52009-03-24 03:07:05 +000011TOOLNAME = clang
Daniel Dunbare2aa06d2010-01-18 17:52:48 +000012ifndef CLANG_IS_PRODUCTION
Daniel Dunbarb8c48252009-11-19 00:21:33 +000013TOOLALIAS = clang++
Daniel Dunbare43887b2010-04-01 18:21:41 +000014else
15 ifdef CLANGXX_IS_PRODUCTION
16 TOOLALIAS = clang++
17 endif
Daniel Dunbare2aa06d2010-01-18 17:52:48 +000018endif
Daniel Dunbar544ecd12009-03-02 19:59:07 +000019
Daniel Dunbarb5b7d1a2010-09-10 21:42:03 +000020# We don't currently expect production Clang builds to be interested in
21# plugins. This is important for startup performance.
22ifdef CLANG_IS_PRODUCTION
23TOOL_NO_EXPORTS := 1
24endif
25
Daniel Dunbar2126aae2010-09-16 00:42:38 +000026ifdef CLANG_ORDER_FILE
27TOOL_ORDER_FILE := $(CLANG_ORDER_FILE)
28endif
29
Daniel Dunbar20267fe2010-07-15 19:33:44 +000030# Include tool version information on OS X.
31TOOL_INFO_PLIST := Info.plist
32
Daniel Dunbarf72bdf72009-12-11 22:20:12 +000033# Include this here so we can get the configuration of the targets that have
34# been configured for construction. We have to do this early so we can set up
35# LINK_COMPONENTS before including Makefile.rules
Daniel Dunbare6c1daa2010-06-08 20:34:18 +000036include $(CLANG_LEVEL)/../../Makefile.config
Daniel Dunbar544ecd12009-03-02 19:59:07 +000037
Daniel Dunbar6f8362c2010-06-07 23:27:59 +000038LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
Nick Lewycky207bce32011-04-21 23:44:07 +000039 instrumentation ipo selectiondag
Peter Collingbourne85dd0bd2010-08-24 00:31:22 +000040USEDLIBS = clangFrontendTool.a clangFrontend.a clangDriver.a \
41 clangSerialization.a clangCodeGen.a clangParse.a clangSema.a \
Argyrios Kyrtzidisecd33342011-02-14 18:13:01 +000042 clangStaticAnalyzerFrontend.a clangStaticAnalyzerCheckers.a \
43 clangStaticAnalyzerCore.a \
Zhongxing Xu40c9d8a2011-01-10 09:23:01 +000044 clangAnalysis.a clangIndex.a clangRewrite.a \
Peter Collingbourne85dd0bd2010-08-24 00:31:22 +000045 clangAST.a clangLex.a clangBasic.a
Daniel Dunbarf72bdf72009-12-11 22:20:12 +000046
Daniel Dunbare6c1daa2010-06-08 20:34:18 +000047include $(CLANG_LEVEL)/Makefile
Daniel Dunbar5564ba72009-09-22 22:31:13 +000048
Daniel Dunbar20267fe2010-07-15 19:33:44 +000049# Set the tool version information values.
50ifeq ($(HOST_OS),Darwin)
51ifdef CLANG_VENDOR
52TOOL_INFO_NAME := $(CLANG_VENDOR) clang
53else
54TOOL_INFO_NAME := clang
55endif
56
57ifdef CLANG_VENDOR_UTI
58TOOL_INFO_UTI := $(CLANG_VENDOR_UTI)
59else
60TOOL_INFO_UTI := org.llvm.clang
61endif
62
63TOOL_INFO_VERSION := $(word 3,$(shell grep "CLANG_VERSION " \
64 $(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include/clang/Basic/Version.inc))
65ifdef LLVM_SUBMIT_VERSION
66TOOL_INFO_BUILD_VERSION := $(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION)
67else
68TOOL_INFO_BUILD_VERSION :=
69endif
70endif
71
Daniel Dunbar5564ba72009-09-22 22:31:13 +000072# Translate make variable to define when building a "production" clang.
73ifdef CLANG_IS_PRODUCTION
74CPP.Defines += -DCLANG_IS_PRODUCTION
75endif
Daniel Dunbare43887b2010-04-01 18:21:41 +000076ifdef CLANGXX_IS_PRODUCTION
77CPP.Defines += -DCLANGXX_IS_PRODUCTION
78endif