blob: b8c91e88738aadd1d126eeab4ba88c59d5d89c6e [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 Dunbar20267fe2010-07-15 19:33:44 +000020# Include tool version information on OS X.
21TOOL_INFO_PLIST := Info.plist
22
Daniel Dunbarf72bdf72009-12-11 22:20:12 +000023# Include this here so we can get the configuration of the targets that have
24# been configured for construction. We have to do this early so we can set up
25# LINK_COMPONENTS before including Makefile.rules
Daniel Dunbare6c1daa2010-06-08 20:34:18 +000026include $(CLANG_LEVEL)/../../Makefile.config
Daniel Dunbar544ecd12009-03-02 19:59:07 +000027
Daniel Dunbar6f8362c2010-06-07 23:27:59 +000028LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
29 ipo selectiondag
Zhongxing Xu0fcbe362010-01-29 03:25:47 +000030USEDLIBS = clangFrontend.a clangDriver.a clangCodeGen.a clangSema.a \
31 clangChecker.a clangAnalysis.a clangRewrite.a clangAST.a \
Ted Kremenekd6b87082010-01-25 04:41:41 +000032 clangParse.a clangLex.a clangBasic.a
Daniel Dunbarf72bdf72009-12-11 22:20:12 +000033
Daniel Dunbare6c1daa2010-06-08 20:34:18 +000034include $(CLANG_LEVEL)/Makefile
Daniel Dunbar5564ba72009-09-22 22:31:13 +000035
Daniel Dunbar20267fe2010-07-15 19:33:44 +000036# Set the tool version information values.
37ifeq ($(HOST_OS),Darwin)
38ifdef CLANG_VENDOR
39TOOL_INFO_NAME := $(CLANG_VENDOR) clang
40else
41TOOL_INFO_NAME := clang
42endif
43
44ifdef CLANG_VENDOR_UTI
45TOOL_INFO_UTI := $(CLANG_VENDOR_UTI)
46else
47TOOL_INFO_UTI := org.llvm.clang
48endif
49
50TOOL_INFO_VERSION := $(word 3,$(shell grep "CLANG_VERSION " \
51 $(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include/clang/Basic/Version.inc))
52ifdef LLVM_SUBMIT_VERSION
53TOOL_INFO_BUILD_VERSION := $(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION)
54else
55TOOL_INFO_BUILD_VERSION :=
56endif
57endif
58
Daniel Dunbar5564ba72009-09-22 22:31:13 +000059# Translate make variable to define when building a "production" clang.
60ifdef CLANG_IS_PRODUCTION
61CPP.Defines += -DCLANG_IS_PRODUCTION
62endif
Daniel Dunbare43887b2010-04-01 18:21:41 +000063ifdef CLANGXX_IS_PRODUCTION
64CPP.Defines += -DCLANGXX_IS_PRODUCTION
65endif