Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 1 | ########################################################### |
| 2 | ## TableGen: Compile .td files to .inc. |
| 3 | ########################################################### |
| 4 | ifeq ($(LOCAL_MODULE_CLASS),) |
| 5 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 6 | endif |
| 7 | |
| 8 | ifneq ($(strip $(TBLGEN_TABLES)),) |
| 9 | |
| 10 | intermediates := $(call local-intermediates-dir) |
| 11 | |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 12 | ifneq ($(findstring AttrImpl.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 13 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/AttrImpl.inc |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 14 | $(intermediates)/include/clang/AST/AttrImpl.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 15 | @echo "Building Clang attribute implementations with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 16 | $(call transform-host-clang-td-to-out,clang-attr-impl) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 17 | endif |
| 18 | |
| 19 | ifneq ($(findstring AttrList.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 20 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/AttrList.inc |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 21 | $(intermediates)/include/clang/Basic/AttrList.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 22 | @echo "Building Clang attribute list with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 23 | $(call transform-host-clang-td-to-out,clang-attr-list) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 24 | endif |
| 25 | |
Logan | 9c64df2 | 2011-02-15 06:27:21 +0800 | [diff] [blame] | 26 | ifneq ($(findstring AttrSpellings.inc,$(TBLGEN_TABLES)),) |
| 27 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Lex/AttrSpellings.inc |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 28 | $(intermediates)/include/clang/Lex/AttrSpellings.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN) |
Logan | 9c64df2 | 2011-02-15 06:27:21 +0800 | [diff] [blame] | 29 | @echo "Building Clang attribute spelling list with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 30 | $(call transform-host-clang-td-to-out,clang-attr-spelling-list) |
Logan | 9c64df2 | 2011-02-15 06:27:21 +0800 | [diff] [blame] | 31 | endif |
| 32 | |
Logan | 150e0ef | 2011-01-19 10:29:26 +0800 | [diff] [blame] | 33 | ifneq ($(findstring AttrPCHRead.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 34 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Serialization/AttrPCHRead.inc |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 35 | $(intermediates)/include/clang/Serialization/AttrPCHRead.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN) |
Logan | 150e0ef | 2011-01-19 10:29:26 +0800 | [diff] [blame] | 36 | @echo "Building Clang attribute pch read with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 37 | $(call transform-host-clang-td-to-out,clang-attr-pch-read) |
Logan | 150e0ef | 2011-01-19 10:29:26 +0800 | [diff] [blame] | 38 | endif |
| 39 | |
| 40 | ifneq ($(findstring AttrPCHWrite.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 41 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Serialization/AttrPCHWrite.inc |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 42 | $(intermediates)/include/clang/Serialization/AttrPCHWrite.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN) |
Logan | 150e0ef | 2011-01-19 10:29:26 +0800 | [diff] [blame] | 43 | @echo "Building Clang attribute pch write with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 44 | $(call transform-host-clang-td-to-out,clang-attr-pch-write) |
| 45 | endif |
| 46 | |
| 47 | ifneq ($(findstring AttrLateParsed.inc,$(TBLGEN_TABLES)),) |
| 48 | LOCAL_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) |
Logan | 150e0ef | 2011-01-19 10:29:26 +0800 | [diff] [blame] | 52 | endif |
| 53 | |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 54 | ifneq ($(findstring Attrs.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 55 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/Attrs.inc |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 56 | $(intermediates)/include/clang/AST/Attrs.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 57 | @echo "Building Clang attribute classes with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 58 | $(call transform-host-clang-td-to-out,clang-attr-classes) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 59 | endif |
| 60 | |
Logan Chien | c805eb9 | 2011-03-08 02:13:34 +0800 | [diff] [blame] | 61 | ifneq ($(findstring Checkers.inc,$(TBLGEN_TABLES)),) |
| 62 | LOCAL_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 Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 66 | $(CLANG_TBLGEN) |
Logan Chien | c805eb9 | 2011-03-08 02:13:34 +0800 | [diff] [blame] | 67 | @echo "Building Clang static analyzer checkers list with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 68 | $(call transform-host-clang-td-to-out,clang-sa-checkers) |
Logan Chien | c805eb9 | 2011-03-08 02:13:34 +0800 | [diff] [blame] | 69 | endif |
| 70 | |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 71 | ifneq ($(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 72 | LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/include/clang/Basic/,$(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES))) |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 73 | $(intermediates)/include/clang/Basic/Diagnostic%Kinds.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(CLANG_TBLGEN) |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 74 | @echo "Building Clang $(patsubst Diagnostic%Kinds.inc,%,$(@F)) diagnostic tables with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 75 | $(call transform-host-clang-td-to-out,clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc,%,$(@F))) |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 76 | endif |
| 77 | |
| 78 | ifneq ($(findstring DiagnosticGroups.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 79 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/DiagnosticGroups.inc |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 80 | $(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 Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 81 | @echo "Building Clang diagnostic groups with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 82 | $(call transform-host-clang-td-to-out,clang-diag-groups) |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 83 | endif |
| 84 | |
Nowar Gu | 0c115a1 | 2011-05-14 13:42:21 +0800 | [diff] [blame] | 85 | ifneq ($(findstring DiagnosticIndexName.inc,$(TBLGEN_TABLES)),) |
| 86 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/DiagnosticIndexName.inc |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 87 | $(intermediates)/include/clang/Basic/DiagnosticIndexName.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(CLANG_TBLGEN) |
Nowar Gu | 0c115a1 | 2011-05-14 13:42:21 +0800 | [diff] [blame] | 88 | @echo "Building Clang diagnostic name index with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 89 | $(call transform-host-clang-td-to-out,clang-diag-groups) |
Nowar Gu | 0c115a1 | 2011-05-14 13:42:21 +0800 | [diff] [blame] | 90 | endif |
| 91 | |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 92 | ifneq ($(findstring DeclNodes.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 93 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/DeclNodes.inc |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 94 | $(intermediates)/include/clang/AST/DeclNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/DeclNodes.td $(CLANG_TBLGEN) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 95 | @echo "Building Clang declaration node tables with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 96 | $(call transform-host-clang-td-to-out,clang-decl-nodes) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 97 | endif |
| 98 | |
| 99 | ifneq ($(findstring StmtNodes.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 100 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/StmtNodes.inc |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 101 | $(intermediates)/include/clang/AST/StmtNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/StmtNodes.td $(CLANG_TBLGEN) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 102 | @echo "Building Clang statement node tables with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 103 | $(call transform-host-clang-td-to-out,clang-stmt-nodes) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 104 | endif |
| 105 | |
| 106 | ifneq ($(findstring arm_neon.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 107 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/arm_neon.inc |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 108 | $(intermediates)/include/clang/Basic/arm_neon.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/arm_neon.td $(CLANG_TBLGEN) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 109 | @echo "Building Clang arm_neon.inc with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 110 | $(call transform-host-clang-td-to-out,arm-neon-sema) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 111 | endif |
| 112 | |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 113 | ifneq ($(findstring Options.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 114 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/Options.inc |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 115 | $(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 Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 116 | @echo "Building Clang Driver Option tables with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 117 | $(call transform-host-clang-td-to-out,opt-parser-defs) |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 118 | endif |
| 119 | |
| 120 | ifneq ($(findstring CC1Options.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 121 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/CC1Options.inc |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 122 | $(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 Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 123 | @echo "Building Clang CC1 Option tables with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 124 | $(call transform-host-clang-td-to-out,opt-parser-defs) |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 125 | endif |
| 126 | |
Logan | 150e0ef | 2011-01-19 10:29:26 +0800 | [diff] [blame] | 127 | ifneq ($(findstring CC1AsOptions.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 128 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/CC1AsOptions.inc |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 129 | $(intermediates)/include/clang/Driver/CC1AsOptions.inc: $(CLANG_ROOT_PATH)/include/clang/Driver/CC1AsOptions.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(CLANG_TBLGEN) |
Logan | 150e0ef | 2011-01-19 10:29:26 +0800 | [diff] [blame] | 130 | @echo "Building Clang CC1 As Option tables with tblgen" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 131 | $(call transform-host-clang-td-to-out,opt-parser-defs) |
Logan | 150e0ef | 2011-01-19 10:29:26 +0800 | [diff] [blame] | 132 | endif |
| 133 | |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 134 | LOCAL_C_INCLUDES += $(intermediates)/include |
| 135 | |
Shih-wei Liao | 200213f | 2010-06-07 22:05:52 -0700 | [diff] [blame] | 136 | endif |