blob: 9eff7fb41701e86ae9a76e7ae5589a913819a7e5 [file] [log] [blame]
Shih-wei Liaoea285162010-06-04 12:34:56 -07001###########################################################
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
Shih-wei Liao3049ec92010-09-10 14:45:09 -070012ifneq ($(findstring AttrImpl.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080013LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/AttrImpl.inc
14$(intermediates)/include/clang/AST/AttrImpl.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070015 @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)),)
Loganac774a72011-01-19 12:06:46 +080020LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/AttrList.inc
21$(intermediates)/include/clang/Basic/AttrList.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070022 @echo "Building Clang attribute list with tblgen"
23 $(call transform-host-td-to-out,clang-attr-list)
24endif
25
Logan9c64df22011-02-15 06:27:21 +080026ifneq ($(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
Logan150e0ef2011-01-19 10:29:26 +080033ifneq ($(findstring AttrPCHRead.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080034LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Serialization/AttrPCHRead.inc
35$(intermediates)/include/clang/Serialization/AttrPCHRead.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN)
Logan150e0ef2011-01-19 10:29:26 +080036 @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)),)
Loganac774a72011-01-19 12:06:46 +080041LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Serialization/AttrPCHWrite.inc
42$(intermediates)/include/clang/Serialization/AttrPCHWrite.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN)
Logan150e0ef2011-01-19 10:29:26 +080043 @echo "Building Clang attribute pch write with tblgen"
44 $(call transform-host-td-to-out,clang-attr-pch-write)
45endif
46
Shih-wei Liao3049ec92010-09-10 14:45:09 -070047ifneq ($(findstring Attrs.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080048LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/Attrs.inc
49$(intermediates)/include/clang/AST/Attrs.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070050 @echo "Building Clang attribute classes with tblgen"
51 $(call transform-host-td-to-out,clang-attr-classes)
52endif
53
Logan Chienc805eb92011-03-08 02:13:34 +080054ifneq ($(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
Shih-wei Liaoea285162010-06-04 12:34:56 -070064ifneq ($(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080065LOCAL_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)
Shih-wei Liaoea285162010-06-04 12:34:56 -070067 @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)),)
Loganac774a72011-01-19 12:06:46 +080072LOCAL_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)
Shih-wei Liaoea285162010-06-04 12:34:56 -070074 @echo "Building Clang diagnostic groups with tblgen"
75 $(call transform-host-td-to-out,clang-diag-groups)
76endif
77
Nowar Gu0c115a12011-05-14 13:42:21 +080078ifneq ($(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
Shih-wei Liao3049ec92010-09-10 14:45:09 -070085ifneq ($(findstring DeclNodes.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080086LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/DeclNodes.inc
87$(intermediates)/include/clang/AST/DeclNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/DeclNodes.td $(TBLGEN)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070088 @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)),)
Loganac774a72011-01-19 12:06:46 +080093LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/StmtNodes.inc
94$(intermediates)/include/clang/AST/StmtNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/StmtNodes.td $(TBLGEN)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070095 @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)),)
Loganac774a72011-01-19 12:06:46 +0800100LOCAL_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)
Shih-wei Liao3049ec92010-09-10 14:45:09 -0700102 @echo "Building Clang arm_neon.inc with tblgen"
103 $(call transform-host-td-to-out,arm-neon-sema)
104endif
105
Shih-wei Liaoea285162010-06-04 12:34:56 -0700106ifneq ($(findstring Options.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +0800107LOCAL_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)
Shih-wei Liaoea285162010-06-04 12:34:56 -0700109 @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)),)
Loganac774a72011-01-19 12:06:46 +0800114LOCAL_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)
Shih-wei Liaoea285162010-06-04 12:34:56 -0700116 @echo "Building Clang CC1 Option tables with tblgen"
117 $(call transform-host-td-to-out,opt-parser-defs)
118endif
119
Logan150e0ef2011-01-19 10:29:26 +0800120ifneq ($(findstring CC1AsOptions.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +0800121LOCAL_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)
Logan150e0ef2011-01-19 10:29:26 +0800123 @echo "Building Clang CC1 As Option tables with tblgen"
124 $(call transform-host-td-to-out,opt-parser-defs)
125endif
126
Loganac774a72011-01-19 12:06:46 +0800127LOCAL_C_INCLUDES += $(intermediates)/include
128
Shih-wei Liao200213f2010-06-07 22:05:52 -0700129endif