blob: 817f62f28b4f90c59be6b5223e3930369d43c984 [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
Shih-wei Liaoea285162010-06-04 12:34:56 -070054ifneq ($(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080055LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/include/clang/Basic/,$(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)))
56$(intermediates)/include/clang/Basic/Diagnostic%Kinds.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(TBLGEN)
Shih-wei Liaoea285162010-06-04 12:34:56 -070057 @echo "Building Clang $(patsubst Diagnostic%Kinds.inc,%,$(@F)) diagnostic tables with tblgen"
58 $(call transform-host-td-to-out,clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc,%,$(@F)))
59endif
60
61ifneq ($(findstring DiagnosticGroups.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080062LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/DiagnosticGroups.inc
63$(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 -070064 @echo "Building Clang diagnostic groups with tblgen"
65 $(call transform-host-td-to-out,clang-diag-groups)
66endif
67
Shih-wei Liao3049ec92010-09-10 14:45:09 -070068ifneq ($(findstring DeclNodes.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080069LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/DeclNodes.inc
70$(intermediates)/include/clang/AST/DeclNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/DeclNodes.td $(TBLGEN)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070071 @echo "Building Clang declaration node tables with tblgen"
72 $(call transform-host-td-to-out,clang-decl-nodes)
73endif
74
75ifneq ($(findstring StmtNodes.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080076LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/StmtNodes.inc
77$(intermediates)/include/clang/AST/StmtNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/StmtNodes.td $(TBLGEN)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070078 @echo "Building Clang statement node tables with tblgen"
79 $(call transform-host-td-to-out,clang-stmt-nodes)
80endif
81
82ifneq ($(findstring arm_neon.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080083LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/arm_neon.inc
84$(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 -070085 @echo "Building Clang arm_neon.inc with tblgen"
86 $(call transform-host-td-to-out,arm-neon-sema)
87endif
88
Shih-wei Liaoea285162010-06-04 12:34:56 -070089ifneq ($(findstring Options.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080090LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/Options.inc
91$(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 -070092 @echo "Building Clang Driver Option tables with tblgen"
93 $(call transform-host-td-to-out,opt-parser-defs)
94endif
95
96ifneq ($(findstring CC1Options.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080097LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/CC1Options.inc
98$(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 -070099 @echo "Building Clang CC1 Option tables with tblgen"
100 $(call transform-host-td-to-out,opt-parser-defs)
101endif
102
Logan150e0ef2011-01-19 10:29:26 +0800103ifneq ($(findstring CC1AsOptions.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +0800104LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/CC1AsOptions.inc
105$(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 +0800106 @echo "Building Clang CC1 As Option tables with tblgen"
107 $(call transform-host-td-to-out,opt-parser-defs)
108endif
109
Loganac774a72011-01-19 12:06:46 +0800110LOCAL_C_INCLUDES += $(intermediates)/include
111
Shih-wei Liao200213f2010-06-07 22:05:52 -0700112endif