blob: 447f0e4eb06beb822e7c8f5ae3e3ebe5b5b51291 [file] [log] [blame]
Daniel Dunbar3ede8d02009-03-02 19:59:07 +00001##===- tools/driver/Makefile -------------------------------*- Makefile -*-===##
Daniel Dunbar21085772009-12-11 22:20:12 +00002#
Daniel Dunbar3ede8d02009-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 Dunbar21085772009-12-11 22:20:12 +00007#
Daniel Dunbar3ede8d02009-03-02 19:59:07 +00008##===----------------------------------------------------------------------===##
Daniel Dunbarafed0992010-06-08 20:34:18 +00009CLANG_LEVEL := ../..
Daniel Dunbar3ede8d02009-03-02 19:59:07 +000010
Daniel Dunbar7ec3daf2009-03-24 03:07:05 +000011TOOLNAME = clang
Daniel Dunbar3f693d22010-01-18 17:52:48 +000012ifndef CLANG_IS_PRODUCTION
Daniel Dunbarf4961da2009-11-19 00:21:33 +000013TOOLALIAS = clang++
Daniel Dunbar5d93ed32010-04-01 18:21:41 +000014else
15 ifdef CLANGXX_IS_PRODUCTION
16 TOOLALIAS = clang++
17 endif
Daniel Dunbar3f693d22010-01-18 17:52:48 +000018endif
Daniel Dunbar3ede8d02009-03-02 19:59:07 +000019
Daniel Dunbar7bad56c2010-07-15 19:33:44 +000020# Include tool version information on OS X.
21TOOL_INFO_PLIST := Info.plist
22
Daniel Dunbar21085772009-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 Dunbarafed0992010-06-08 20:34:18 +000026include $(CLANG_LEVEL)/../../Makefile.config
Daniel Dunbar3ede8d02009-03-02 19:59:07 +000027
Daniel Dunbar4cbbd942010-06-07 23:27:59 +000028LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
29 ipo selectiondag
Peter Collingbourne1b7255d2010-08-24 00:31:22 +000030USEDLIBS = clangFrontendTool.a clangFrontend.a clangDriver.a \
31 clangSerialization.a clangCodeGen.a clangParse.a clangSema.a \
32 clangChecker.a clangAnalysis.a clangIndex.a clangRewrite.a \
33 clangAST.a clangLex.a clangBasic.a
Daniel Dunbar21085772009-12-11 22:20:12 +000034
Daniel Dunbarafed0992010-06-08 20:34:18 +000035include $(CLANG_LEVEL)/Makefile
Daniel Dunbarf44c5852009-09-22 22:31:13 +000036
Daniel Dunbar7bad56c2010-07-15 19:33:44 +000037# Set the tool version information values.
38ifeq ($(HOST_OS),Darwin)
39ifdef CLANG_VENDOR
40TOOL_INFO_NAME := $(CLANG_VENDOR) clang
41else
42TOOL_INFO_NAME := clang
43endif
44
45ifdef CLANG_VENDOR_UTI
46TOOL_INFO_UTI := $(CLANG_VENDOR_UTI)
47else
48TOOL_INFO_UTI := org.llvm.clang
49endif
50
51TOOL_INFO_VERSION := $(word 3,$(shell grep "CLANG_VERSION " \
52 $(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include/clang/Basic/Version.inc))
53ifdef LLVM_SUBMIT_VERSION
54TOOL_INFO_BUILD_VERSION := $(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION)
55else
56TOOL_INFO_BUILD_VERSION :=
57endif
58endif
59
Daniel Dunbarf44c5852009-09-22 22:31:13 +000060# Translate make variable to define when building a "production" clang.
61ifdef CLANG_IS_PRODUCTION
62CPP.Defines += -DCLANG_IS_PRODUCTION
63endif
Daniel Dunbar5d93ed32010-04-01 18:21:41 +000064ifdef CLANGXX_IS_PRODUCTION
65CPP.Defines += -DCLANGXX_IS_PRODUCTION
66endif