]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/clang/Basic/Makefile
Vendor import of clang release_30 branch r142614:
[FreeBSD/FreeBSD.git] / include / clang / Basic / Makefile
1 CLANG_LEVEL := ../../..
2 BUILT_SOURCES = \
3         DiagnosticAnalysisKinds.inc DiagnosticASTKinds.inc \
4         DiagnosticCommonKinds.inc DiagnosticDriverKinds.inc \
5         DiagnosticFrontendKinds.inc DiagnosticLexKinds.inc \
6         DiagnosticParseKinds.inc DiagnosticSemaKinds.inc \
7         DiagnosticIndexName.inc DiagnosticGroups.inc AttrList.inc arm_neon.inc \
8         Version.inc
9
10 TABLEGEN_INC_FILES_COMMON = 1
11
12 include $(CLANG_LEVEL)/Makefile
13
14 INPUT_TDS = $(wildcard $(PROJ_SRC_DIR)/Diagnostic*.td)
15
16 # Compute the Clang version from the LLVM version, unless specified explicitly.
17 ifndef CLANG_VERSION
18 CLANG_VERSION := $(subst svn,,$(LLVMVersion))
19 CLANG_VERSION := $(subst rc,,$(CLANG_VERSION))
20 endif
21
22 CLANG_VERSION_COMPONENTS := $(subst ., ,$(CLANG_VERSION))
23 CLANG_VERSION_MAJOR := $(word 1,$(CLANG_VERSION_COMPONENTS))
24 CLANG_VERSION_MINOR := $(word 2,$(CLANG_VERSION_COMPONENTS))
25 CLANG_VERSION_PATCHLEVEL := $(word 3,$(CLANG_VERSION_COMPONENTS))
26 ifeq ($(CLANG_VERSION_PATCHLEVEL),)
27 CLANG_HAS_VERSION_PATCHLEVEL := 0
28 else
29 CLANG_HAS_VERSION_PATCHLEVEL := 1
30 endif
31
32 $(ObjDir)/Diagnostic%Kinds.inc.tmp : Diagnostic.td Diagnostic%Kinds.td $(CLANG_TBLGEN) $(ObjDir)/.dir
33         $(Echo) "Building Clang $(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) diagnostic tables with tblgen"
34         $(Verb) $(ClangTableGen) -gen-clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) -o $(call SYSPATH, $@) $<
35
36 $(ObjDir)/DiagnosticIndexName.inc.tmp : Diagnostic.td $(INPUT_TDS) $(CLANG_TBLGEN) $(ObjDir)/.dir
37         $(Echo) "Building Clang diagnostic name index with tblgen"
38         $(Verb) $(ClangTableGen) -gen-clang-diags-index-name -o $(call SYSPATH, $@) $<
39
40 $(ObjDir)/DiagnosticGroups.inc.tmp : Diagnostic.td DiagnosticGroups.td $(INPUT_TDS) $(CLANG_TBLGEN) $(ObjDir)/.dir
41         $(Echo) "Building Clang diagnostic groups with tblgen"
42         $(Verb) $(ClangTableGen) -gen-clang-diag-groups -o $(call SYSPATH, $@) $<
43
44 $(ObjDir)/AttrList.inc.tmp : Attr.td $(CLANG_TBLGEN) $(ObjDir)/.dir
45         $(Echo) "Building Clang attribute list with tblgen"
46         $(Verb) $(ClangTableGen) -gen-clang-attr-list -o $(call SYSPATH, $@) \
47           -I $(PROJ_SRC_DIR)/../.. $<
48
49 $(ObjDir)/arm_neon.inc.tmp : arm_neon.td $(CLANG_TBLGEN) $(ObjDir)/.dir
50         $(Echo) "Building Clang arm_neon.inc with tblgen"
51         $(Verb) $(ClangTableGen) -gen-arm-neon-sema -o $(call SYSPATH, $@) $<
52
53 $(ObjDir)/Version.inc.tmp : Version.inc.in Makefile $(LLVM_OBJ_ROOT)/Makefile.config $(ObjDir)/.dir
54         $(Echo) "Updating Clang version info."
55         $(Verb)sed -e "s#@CLANG_VERSION@#$(CLANG_VERSION)#g" \
56                    -e "s#@CLANG_VERSION_MAJOR@#$(CLANG_VERSION_MAJOR)#g" \
57                    -e "s#@CLANG_VERSION_MINOR@#$(CLANG_VERSION_MINOR)#g" \
58                    -e "s#@CLANG_VERSION_PATCHLEVEL@#$(CLANG_VERSION_PATCHLEVEL)#g" \
59                    -e "s#@CLANG_HAS_VERSION_PATCHLEVEL@#$(CLANG_HAS_VERSION_PATCHLEVEL)#g" \
60                    $< > $@