blob: ea0eadaf2fc881cf984eecc987c293c4f6c71a1b [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
Logan Chienfe6bd6d2011-10-21 15:03:07 +080014$(intermediates)/include/clang/AST/AttrImpl.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070015 @echo "Building Clang attribute implementations with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +080016 $(call transform-host-clang-td-to-out,clang-attr-impl)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070017endif
18
19ifneq ($(findstring AttrList.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080020LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/AttrList.inc
Logan Chienfe6bd6d2011-10-21 15:03:07 +080021$(intermediates)/include/clang/Basic/AttrList.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070022 @echo "Building Clang attribute list with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +080023 $(call transform-host-clang-td-to-out,clang-attr-list)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070024endif
25
Logan9c64df22011-02-15 06:27:21 +080026ifneq ($(findstring AttrSpellings.inc,$(TBLGEN_TABLES)),)
27 LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Lex/AttrSpellings.inc
Logan Chienfe6bd6d2011-10-21 15:03:07 +080028$(intermediates)/include/clang/Lex/AttrSpellings.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
Logan9c64df22011-02-15 06:27:21 +080029 @echo "Building Clang attribute spelling list with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +080030 $(call transform-host-clang-td-to-out,clang-attr-spelling-list)
Logan9c64df22011-02-15 06:27:21 +080031endif
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
Logan Chienfe6bd6d2011-10-21 15:03:07 +080035$(intermediates)/include/clang/Serialization/AttrPCHRead.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
Logan150e0ef2011-01-19 10:29:26 +080036 @echo "Building Clang attribute pch read with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +080037 $(call transform-host-clang-td-to-out,clang-attr-pch-read)
Logan150e0ef2011-01-19 10:29:26 +080038endif
39
40ifneq ($(findstring AttrPCHWrite.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080041LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Serialization/AttrPCHWrite.inc
Logan Chienfe6bd6d2011-10-21 15:03:07 +080042$(intermediates)/include/clang/Serialization/AttrPCHWrite.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
Logan150e0ef2011-01-19 10:29:26 +080043 @echo "Building Clang attribute pch write with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +080044 $(call transform-host-clang-td-to-out,clang-attr-pch-write)
45endif
46
47ifneq ($(findstring AttrLateParsed.inc,$(TBLGEN_TABLES)),)
48LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Parse/AttrLateParsed.inc
49$(intermediates)/include/clang/Parse/AttrLateParsed.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
50 @echo "Building Clang attribute late parsed list with tblgen"
51 $(call transform-host-clang-td-to-out,clang-attr-late-parsed-list)
Logan150e0ef2011-01-19 10:29:26 +080052endif
53
Shih-wei Liao3049ec92010-09-10 14:45:09 -070054ifneq ($(findstring Attrs.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080055LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/Attrs.inc
Logan Chienfe6bd6d2011-10-21 15:03:07 +080056$(intermediates)/include/clang/AST/Attrs.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070057 @echo "Building Clang attribute classes with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +080058 $(call transform-host-clang-td-to-out,clang-attr-classes)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070059endif
60
Logan Chienc805eb92011-03-08 02:13:34 +080061ifneq ($(findstring Checkers.inc,$(TBLGEN_TABLES)),)
62LOCAL_GENERATED_SOURCES += $(intermediates)/Checkers.inc
63$(intermediates)/Checkers.inc: \
64 $(CLANG_ROOT_PATH)/lib/StaticAnalyzer/Checkers/Checkers.td \
65 $(CLANG_ROOT_PATH)/include/clang/StaticAnalyzer/Checkers/CheckerBase.td \
Logan Chienfe6bd6d2011-10-21 15:03:07 +080066 $(CLANG_TBLGEN)
Logan Chienc805eb92011-03-08 02:13:34 +080067 @echo "Building Clang static analyzer checkers list with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +080068 $(call transform-host-clang-td-to-out,clang-sa-checkers)
Logan Chienc805eb92011-03-08 02:13:34 +080069endif
70
Shih-wei Liaoea285162010-06-04 12:34:56 -070071ifneq ($(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080072LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/include/clang/Basic/,$(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)))
Logan Chienfe6bd6d2011-10-21 15:03:07 +080073$(intermediates)/include/clang/Basic/Diagnostic%Kinds.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(CLANG_TBLGEN)
Shih-wei Liaoea285162010-06-04 12:34:56 -070074 @echo "Building Clang $(patsubst Diagnostic%Kinds.inc,%,$(@F)) diagnostic tables with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +080075 $(call transform-host-clang-td-to-out,clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc,%,$(@F)))
Shih-wei Liaoea285162010-06-04 12:34:56 -070076endif
77
78ifneq ($(findstring DiagnosticGroups.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080079LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/DiagnosticGroups.inc
Logan Chienfe6bd6d2011-10-21 15:03:07 +080080$(intermediates)/include/clang/Basic/DiagnosticGroups.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(CLANG_ROOT_PATH)/include/clang/Basic/DiagnosticGroups.td $(CLANG_TBLGEN)
Shih-wei Liaoea285162010-06-04 12:34:56 -070081 @echo "Building Clang diagnostic groups with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +080082 $(call transform-host-clang-td-to-out,clang-diag-groups)
Shih-wei Liaoea285162010-06-04 12:34:56 -070083endif
84
Nowar Gu0c115a12011-05-14 13:42:21 +080085ifneq ($(findstring DiagnosticIndexName.inc,$(TBLGEN_TABLES)),)
86LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/DiagnosticIndexName.inc
Logan Chienfe6bd6d2011-10-21 15:03:07 +080087$(intermediates)/include/clang/Basic/DiagnosticIndexName.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(CLANG_TBLGEN)
Nowar Gu0c115a12011-05-14 13:42:21 +080088 @echo "Building Clang diagnostic name index with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +080089 $(call transform-host-clang-td-to-out,clang-diag-groups)
Nowar Gu0c115a12011-05-14 13:42:21 +080090endif
91
Shih-wei Liao3049ec92010-09-10 14:45:09 -070092ifneq ($(findstring DeclNodes.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +080093LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/DeclNodes.inc
Logan Chienfe6bd6d2011-10-21 15:03:07 +080094$(intermediates)/include/clang/AST/DeclNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/DeclNodes.td $(CLANG_TBLGEN)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070095 @echo "Building Clang declaration node tables with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +080096 $(call transform-host-clang-td-to-out,clang-decl-nodes)
Shih-wei Liao3049ec92010-09-10 14:45:09 -070097endif
98
99ifneq ($(findstring StmtNodes.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +0800100LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/StmtNodes.inc
Logan Chienfe6bd6d2011-10-21 15:03:07 +0800101$(intermediates)/include/clang/AST/StmtNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/StmtNodes.td $(CLANG_TBLGEN)
Shih-wei Liao3049ec92010-09-10 14:45:09 -0700102 @echo "Building Clang statement node tables with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +0800103 $(call transform-host-clang-td-to-out,clang-stmt-nodes)
Shih-wei Liao3049ec92010-09-10 14:45:09 -0700104endif
105
106ifneq ($(findstring arm_neon.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +0800107LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/arm_neon.inc
Logan Chienfe6bd6d2011-10-21 15:03:07 +0800108$(intermediates)/include/clang/Basic/arm_neon.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/arm_neon.td $(CLANG_TBLGEN)
Shih-wei Liao3049ec92010-09-10 14:45:09 -0700109 @echo "Building Clang arm_neon.inc with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +0800110 $(call transform-host-clang-td-to-out,arm-neon-sema)
Shih-wei Liao3049ec92010-09-10 14:45:09 -0700111endif
112
Shih-wei Liaoea285162010-06-04 12:34:56 -0700113ifneq ($(findstring Options.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +0800114LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/Options.inc
Logan Chienfe6bd6d2011-10-21 15:03:07 +0800115$(intermediates)/include/clang/Driver/Options.inc: $(CLANG_ROOT_PATH)/include/clang/Driver/Options.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(CLANG_TBLGEN)
Shih-wei Liaoea285162010-06-04 12:34:56 -0700116 @echo "Building Clang Driver Option tables with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +0800117 $(call transform-host-clang-td-to-out,opt-parser-defs)
Shih-wei Liaoea285162010-06-04 12:34:56 -0700118endif
119
120ifneq ($(findstring CC1Options.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +0800121LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/CC1Options.inc
Logan Chienfe6bd6d2011-10-21 15:03:07 +0800122$(intermediates)/include/clang/Driver/CC1Options.inc: $(CLANG_ROOT_PATH)/include/clang/Driver/CC1Options.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(CLANG_TBLGEN)
Shih-wei Liaoea285162010-06-04 12:34:56 -0700123 @echo "Building Clang CC1 Option tables with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +0800124 $(call transform-host-clang-td-to-out,opt-parser-defs)
Shih-wei Liaoea285162010-06-04 12:34:56 -0700125endif
126
Logan150e0ef2011-01-19 10:29:26 +0800127ifneq ($(findstring CC1AsOptions.inc,$(TBLGEN_TABLES)),)
Loganac774a72011-01-19 12:06:46 +0800128LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/CC1AsOptions.inc
Logan Chienfe6bd6d2011-10-21 15:03:07 +0800129$(intermediates)/include/clang/Driver/CC1AsOptions.inc: $(CLANG_ROOT_PATH)/include/clang/Driver/CC1AsOptions.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(CLANG_TBLGEN)
Logan150e0ef2011-01-19 10:29:26 +0800130 @echo "Building Clang CC1 As Option tables with tblgen"
Logan Chienfe6bd6d2011-10-21 15:03:07 +0800131 $(call transform-host-clang-td-to-out,opt-parser-defs)
Logan150e0ef2011-01-19 10:29:26 +0800132endif
133
Loganac774a72011-01-19 12:06:46 +0800134LOCAL_C_INCLUDES += $(intermediates)/include
135
Shih-wei Liao200213f2010-06-07 22:05:52 -0700136endif