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 | |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 54 | ifneq ($(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 55 | LOCAL_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 Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 57 | @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))) |
| 59 | endif |
| 60 | |
| 61 | ifneq ($(findstring DiagnosticGroups.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 62 | LOCAL_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 Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 64 | @echo "Building Clang diagnostic groups with tblgen" |
| 65 | $(call transform-host-td-to-out,clang-diag-groups) |
| 66 | endif |
| 67 | |
Shih-wei Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 68 | ifneq ($(findstring DeclNodes.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 69 | LOCAL_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 Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 71 | @echo "Building Clang declaration node tables with tblgen" |
| 72 | $(call transform-host-td-to-out,clang-decl-nodes) |
| 73 | endif |
| 74 | |
| 75 | ifneq ($(findstring StmtNodes.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 76 | LOCAL_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 Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 78 | @echo "Building Clang statement node tables with tblgen" |
| 79 | $(call transform-host-td-to-out,clang-stmt-nodes) |
| 80 | endif |
| 81 | |
| 82 | ifneq ($(findstring arm_neon.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 83 | LOCAL_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 Liao | 3049ec9 | 2010-09-10 14:45:09 -0700 | [diff] [blame] | 85 | @echo "Building Clang arm_neon.inc with tblgen" |
| 86 | $(call transform-host-td-to-out,arm-neon-sema) |
| 87 | endif |
| 88 | |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 89 | ifneq ($(findstring Options.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 90 | LOCAL_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 Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 92 | @echo "Building Clang Driver Option tables with tblgen" |
| 93 | $(call transform-host-td-to-out,opt-parser-defs) |
| 94 | endif |
| 95 | |
| 96 | ifneq ($(findstring CC1Options.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 97 | LOCAL_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 Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 99 | @echo "Building Clang CC1 Option tables with tblgen" |
| 100 | $(call transform-host-td-to-out,opt-parser-defs) |
| 101 | endif |
| 102 | |
Logan | 150e0ef | 2011-01-19 10:29:26 +0800 | [diff] [blame] | 103 | ifneq ($(findstring CC1AsOptions.inc,$(TBLGEN_TABLES)),) |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 104 | LOCAL_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) |
Logan | 150e0ef | 2011-01-19 10:29:26 +0800 | [diff] [blame] | 106 | @echo "Building Clang CC1 As Option tables with tblgen" |
| 107 | $(call transform-host-td-to-out,opt-parser-defs) |
| 108 | endif |
| 109 | |
Logan | ac774a7 | 2011-01-19 12:06:46 +0800 | [diff] [blame] | 110 | LOCAL_C_INCLUDES += $(intermediates)/include |
| 111 | |
Shih-wei Liao | 200213f | 2010-06-07 22:05:52 -0700 | [diff] [blame] | 112 | endif |