• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1###########################################################
2## TableGen: Compile .td files to .inc.
3###########################################################
4ifeq ($(LOCAL_MODULE_CLASS),)
5    LOCAL_MODULE_CLASS := STATIC_LIBRARIES
6endif
7
8ifneq ($(strip $(TBLGEN_TABLES)),)
9
10intermediates := $(call local-intermediates-dir)
11
12ifneq ($(findstring AttrImpl.inc,$(TBLGEN_TABLES)),)
13LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/AttrImpl.inc
14$(intermediates)/include/clang/AST/AttrImpl.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN)
15	@echo "Building Clang attribute implementations with tblgen"
16	$(call transform-host-td-to-out,clang-attr-impl)
17endif
18
19ifneq ($(findstring AttrList.inc,$(TBLGEN_TABLES)),)
20LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/AttrList.inc
21$(intermediates)/include/clang/Basic/AttrList.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN)
22	@echo "Building Clang attribute list with tblgen"
23	$(call transform-host-td-to-out,clang-attr-list)
24endif
25
26ifneq ($(findstring AttrSpellings.inc,$(TBLGEN_TABLES)),)
27    LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Lex/AttrSpellings.inc
28$(intermediates)/include/clang/Lex/AttrSpellings.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN)
29	@echo "Building Clang attribute spelling list with tblgen"
30	$(call transform-host-td-to-out,clang-attr-spelling-list)
31endif
32
33ifneq ($(findstring AttrPCHRead.inc,$(TBLGEN_TABLES)),)
34LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Serialization/AttrPCHRead.inc
35$(intermediates)/include/clang/Serialization/AttrPCHRead.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN)
36	@echo "Building Clang attribute pch read with tblgen"
37	$(call transform-host-td-to-out,clang-attr-pch-read)
38endif
39
40ifneq ($(findstring AttrPCHWrite.inc,$(TBLGEN_TABLES)),)
41LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Serialization/AttrPCHWrite.inc
42$(intermediates)/include/clang/Serialization/AttrPCHWrite.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN)
43	@echo "Building Clang attribute pch write with tblgen"
44	$(call transform-host-td-to-out,clang-attr-pch-write)
45endif
46
47ifneq ($(findstring Attrs.inc,$(TBLGEN_TABLES)),)
48LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/Attrs.inc
49$(intermediates)/include/clang/AST/Attrs.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN)
50	@echo "Building Clang attribute classes with tblgen"
51	$(call transform-host-td-to-out,clang-attr-classes)
52endif
53
54ifneq ($(findstring Checkers.inc,$(TBLGEN_TABLES)),)
55LOCAL_GENERATED_SOURCES += $(intermediates)/Checkers.inc
56$(intermediates)/Checkers.inc: \
57  $(CLANG_ROOT_PATH)/lib/StaticAnalyzer/Checkers/Checkers.td \
58  $(CLANG_ROOT_PATH)/include/clang/StaticAnalyzer/Checkers/CheckerBase.td \
59  $(TBLGEN)
60	@echo "Building Clang static analyzer checkers list with tblgen"
61	$(call transform-host-td-to-out,clang-sa-checkers)
62endif
63
64ifneq ($(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)),)
65LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/include/clang/Basic/,$(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)))
66$(intermediates)/include/clang/Basic/Diagnostic%Kinds.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(TBLGEN)
67	@echo "Building Clang $(patsubst Diagnostic%Kinds.inc,%,$(@F)) diagnostic tables with tblgen"
68	$(call transform-host-td-to-out,clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc,%,$(@F)))
69endif
70
71ifneq ($(findstring DiagnosticGroups.inc,$(TBLGEN_TABLES)),)
72LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/DiagnosticGroups.inc
73$(intermediates)/include/clang/Basic/DiagnosticGroups.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(CLANG_ROOT_PATH)/include/clang/Basic/DiagnosticGroups.td $(TBLGEN)
74	@echo "Building Clang diagnostic groups with tblgen"
75	$(call transform-host-td-to-out,clang-diag-groups)
76endif
77
78ifneq ($(findstring DiagnosticIndexName.inc,$(TBLGEN_TABLES)),)
79LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/DiagnosticIndexName.inc
80$(intermediates)/include/clang/Basic/DiagnosticIndexName.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(TBLGEN)
81	@echo "Building Clang diagnostic name index with tblgen"
82	$(call transform-host-td-to-out,clang-diag-groups)
83endif
84
85ifneq ($(findstring DeclNodes.inc,$(TBLGEN_TABLES)),)
86LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/DeclNodes.inc
87$(intermediates)/include/clang/AST/DeclNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/DeclNodes.td $(TBLGEN)
88	@echo "Building Clang declaration node tables with tblgen"
89	$(call transform-host-td-to-out,clang-decl-nodes)
90endif
91
92ifneq ($(findstring StmtNodes.inc,$(TBLGEN_TABLES)),)
93LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/StmtNodes.inc
94$(intermediates)/include/clang/AST/StmtNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/StmtNodes.td $(TBLGEN)
95	@echo "Building Clang statement node tables with tblgen"
96	$(call transform-host-td-to-out,clang-stmt-nodes)
97endif
98
99ifneq ($(findstring arm_neon.inc,$(TBLGEN_TABLES)),)
100LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/arm_neon.inc
101$(intermediates)/include/clang/Basic/arm_neon.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/arm_neon.td $(TBLGEN)
102	@echo "Building Clang arm_neon.inc with tblgen"
103	$(call transform-host-td-to-out,arm-neon-sema)
104endif
105
106ifneq ($(findstring Options.inc,$(TBLGEN_TABLES)),)
107LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/Options.inc
108$(intermediates)/include/clang/Driver/Options.inc: $(CLANG_ROOT_PATH)/include/clang/Driver/Options.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(TBLGEN)
109	@echo "Building Clang Driver Option tables with tblgen"
110	$(call transform-host-td-to-out,opt-parser-defs)
111endif
112
113ifneq ($(findstring CC1Options.inc,$(TBLGEN_TABLES)),)
114LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/CC1Options.inc
115$(intermediates)/include/clang/Driver/CC1Options.inc: $(CLANG_ROOT_PATH)/include/clang/Driver/CC1Options.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(TBLGEN)
116	@echo "Building Clang CC1 Option tables with tblgen"
117	$(call transform-host-td-to-out,opt-parser-defs)
118endif
119
120ifneq ($(findstring CC1AsOptions.inc,$(TBLGEN_TABLES)),)
121LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/CC1AsOptions.inc
122$(intermediates)/include/clang/Driver/CC1AsOptions.inc: $(CLANG_ROOT_PATH)/include/clang/Driver/CC1AsOptions.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(TBLGEN)
123	@echo "Building Clang CC1 As Option tables with tblgen"
124	$(call transform-host-td-to-out,opt-parser-defs)
125endif
126
127LOCAL_C_INCLUDES += $(intermediates)/include
128
129endif
130