Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 1 | ##===- tools/driver/Makefile -------------------------------*- Makefile -*-===## |
Daniel Dunbar | 2108577 | 2009-12-11 22:20:12 +0000 | [diff] [blame] | 2 | # |
Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 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. |
Daniel Dunbar | 2108577 | 2009-12-11 22:20:12 +0000 | [diff] [blame] | 7 | # |
Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 8 | ##===----------------------------------------------------------------------===## |
Daniel Dunbar | afed099 | 2010-06-08 20:34:18 +0000 | [diff] [blame] | 9 | CLANG_LEVEL := ../.. |
Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 10 | |
Daniel Dunbar | 7ec3daf | 2009-03-24 03:07:05 +0000 | [diff] [blame] | 11 | TOOLNAME = clang |
Daniel Dunbar | 3f693d2 | 2010-01-18 17:52:48 +0000 | [diff] [blame] | 12 | ifndef CLANG_IS_PRODUCTION |
Daniel Dunbar | f4961da | 2009-11-19 00:21:33 +0000 | [diff] [blame] | 13 | TOOLALIAS = clang++ |
Daniel Dunbar | 5d93ed3 | 2010-04-01 18:21:41 +0000 | [diff] [blame] | 14 | else |
| 15 | ifdef CLANGXX_IS_PRODUCTION |
| 16 | TOOLALIAS = clang++ |
| 17 | endif |
Daniel Dunbar | 3f693d2 | 2010-01-18 17:52:48 +0000 | [diff] [blame] | 18 | endif |
Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 19 | |
Daniel Dunbar | 7bad56c | 2010-07-15 19:33:44 +0000 | [diff] [blame] | 20 | # Include tool version information on OS X. |
| 21 | TOOL_INFO_PLIST := Info.plist |
| 22 | |
Daniel Dunbar | 2108577 | 2009-12-11 22:20:12 +0000 | [diff] [blame] | 23 | # 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 Dunbar | afed099 | 2010-06-08 20:34:18 +0000 | [diff] [blame] | 26 | include $(CLANG_LEVEL)/../../Makefile.config |
Daniel Dunbar | 3ede8d0 | 2009-03-02 19:59:07 +0000 | [diff] [blame] | 27 | |
Daniel Dunbar | 4cbbd94 | 2010-06-07 23:27:59 +0000 | [diff] [blame] | 28 | LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \ |
| 29 | ipo selectiondag |
Peter Collingbourne | 1b7255d | 2010-08-24 00:31:22 +0000 | [diff] [blame] | 30 | USEDLIBS = 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 Dunbar | 2108577 | 2009-12-11 22:20:12 +0000 | [diff] [blame] | 34 | |
Daniel Dunbar | afed099 | 2010-06-08 20:34:18 +0000 | [diff] [blame] | 35 | include $(CLANG_LEVEL)/Makefile |
Daniel Dunbar | f44c585 | 2009-09-22 22:31:13 +0000 | [diff] [blame] | 36 | |
Daniel Dunbar | 7bad56c | 2010-07-15 19:33:44 +0000 | [diff] [blame] | 37 | # Set the tool version information values. |
| 38 | ifeq ($(HOST_OS),Darwin) |
| 39 | ifdef CLANG_VENDOR |
| 40 | TOOL_INFO_NAME := $(CLANG_VENDOR) clang |
| 41 | else |
| 42 | TOOL_INFO_NAME := clang |
| 43 | endif |
| 44 | |
| 45 | ifdef CLANG_VENDOR_UTI |
| 46 | TOOL_INFO_UTI := $(CLANG_VENDOR_UTI) |
| 47 | else |
| 48 | TOOL_INFO_UTI := org.llvm.clang |
| 49 | endif |
| 50 | |
| 51 | TOOL_INFO_VERSION := $(word 3,$(shell grep "CLANG_VERSION " \ |
| 52 | $(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include/clang/Basic/Version.inc)) |
| 53 | ifdef LLVM_SUBMIT_VERSION |
| 54 | TOOL_INFO_BUILD_VERSION := $(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) |
| 55 | else |
| 56 | TOOL_INFO_BUILD_VERSION := |
| 57 | endif |
| 58 | endif |
| 59 | |
Daniel Dunbar | f44c585 | 2009-09-22 22:31:13 +0000 | [diff] [blame] | 60 | # Translate make variable to define when building a "production" clang. |
| 61 | ifdef CLANG_IS_PRODUCTION |
| 62 | CPP.Defines += -DCLANG_IS_PRODUCTION |
| 63 | endif |
Daniel Dunbar | 5d93ed3 | 2010-04-01 18:21:41 +0000 | [diff] [blame] | 64 | ifdef CLANGXX_IS_PRODUCTION |
| 65 | CPP.Defines += -DCLANGXX_IS_PRODUCTION |
| 66 | endif |