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 |
| 14 | $(intermediates)/include/clang/AST/AttrImpl.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 15 | @echo "Building Clang attribute implementations with tblgen" |
| 16 | $(call transform-host-td-to-out,clang-attr-impl) |
| 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 |
| 21 | $(intermediates)/include/clang/Basic/AttrList.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 22 | @echo "Building Clang attribute list with tblgen" |
| 23 | $(call transform-host-td-to-out,clang-attr-list) |
| 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 |
| 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) |
| 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 |
| 35 | $(intermediates)/include/clang/Serialization/AttrPCHRead.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN) |
Logan | 150e0ef | 2011-01-19 10:29:26 +0800 | [diff] [blame] | 36 | @echo "Building Clang attribute pch read with tblgen" |
| 37 | $(call transform-host-td-to-out,clang-attr-pch-read) |
| 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 |
| 42 | $(intermediates)/include/clang/Serialization/AttrPCHWrite.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(TBLGEN) |
Logan | 150e0ef | 2011-01-19 10:29:26 +0800 | [diff] [blame] | 43 | @echo "Building Clang attribute pch write with tblgen" |
| 44 | $(call transform-host-td-to-out,clang-attr-pch-write) |
| 45 | endif |
| 46 | |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 47 | ifneq ($(findstring Attrs.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 48 | LOCAL_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 Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 50 | @echo "Building Clang attribute classes with tblgen" |
| 51 | $(call transform-host-td-to-out,clang-attr-classes) |
| 52 | endif |
| 53 | |
Logan Chien | c805eb9 | 2011-03-08 02:13:34 +0800 | [diff] [blame] | 54 | ifneq ($(findstring Checkers.inc,$(TBLGEN_TABLES)),) |
| 55 | LOCAL_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) |
| 62 | endif |
| 63 | |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 64 | ifneq ($(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 65 | LOCAL_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 Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 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))) |
| 69 | endif |
| 70 | |
| 71 | ifneq ($(findstring DiagnosticGroups.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 72 | LOCAL_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 Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 74 | @echo "Building Clang diagnostic groups with tblgen" |
| 75 | $(call transform-host-td-to-out,clang-diag-groups) |
| 76 | endif |
| 77 | |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 78 | ifneq ($(findstring DeclNodes.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 79 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/DeclNodes.inc |
| 80 | $(intermediates)/include/clang/AST/DeclNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/DeclNodes.td $(TBLGEN) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 81 | @echo "Building Clang declaration node tables with tblgen" |
| 82 | $(call transform-host-td-to-out,clang-decl-nodes) |
| 83 | endif |
| 84 | |
| 85 | ifneq ($(findstring StmtNodes.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 86 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/StmtNodes.inc |
| 87 | $(intermediates)/include/clang/AST/StmtNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/StmtNodes.td $(TBLGEN) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 88 | @echo "Building Clang statement node tables with tblgen" |
| 89 | $(call transform-host-td-to-out,clang-stmt-nodes) |
| 90 | endif |
| 91 | |
| 92 | ifneq ($(findstring arm_neon.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 93 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/arm_neon.inc |
| 94 | $(intermediates)/include/clang/Basic/arm_neon.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/arm_neon.td $(TBLGEN) |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 95 | @echo "Building Clang arm_neon.inc with tblgen" |
| 96 | $(call transform-host-td-to-out,arm-neon-sema) |
| 97 | endif |
| 98 | |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 99 | ifneq ($(findstring Options.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 100 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/Options.inc |
| 101 | $(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 Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 102 | @echo "Building Clang Driver Option tables with tblgen" |
| 103 | $(call transform-host-td-to-out,opt-parser-defs) |
| 104 | endif |
| 105 | |
| 106 | ifneq ($(findstring CC1Options.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 107 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/CC1Options.inc |
| 108 | $(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 Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 109 | @echo "Building Clang CC1 Option tables with tblgen" |
| 110 | $(call transform-host-td-to-out,opt-parser-defs) |
| 111 | endif |
| 112 | |
Logan | 150e0ef | 2011-01-19 10:29:26 +0800 | [diff] [blame] | 113 | ifneq ($(findstring CC1AsOptions.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 114 | LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/CC1AsOptions.inc |
| 115 | $(intermediates)/include/clang/Driver/CC1AsOptions.inc: $(CLANG_ROOT_PATH)/include/clang/Driver/CC1AsOptions.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(TBLGEN) |
Logan | 150e0ef | 2011-01-19 10:29:26 +0800 | [diff] [blame] | 116 | @echo "Building Clang CC1 As Option tables with tblgen" |
| 117 | $(call transform-host-td-to-out,opt-parser-defs) |
| 118 | endif |
| 119 | |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 120 | LOCAL_C_INCLUDES += $(intermediates)/include |
| 121 | |
Shih-wei Liao | 200213f | 2010-06-07 22:05:52 -0700 | [diff] [blame] | 122 | endif |