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 12 ifneq ($(findstring AttrImpl.inc,$(TBLGEN_TABLES)),) 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 $(CLANG_TBLGEN) 15 @echo "Building Clang attribute implementations with tblgen" 16 $(call transform-host-clang-td-to-out,clang-attr-impl) 17 endif 18 19 ifneq ($(findstring AttrList.inc,$(TBLGEN_TABLES)),) 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 $(CLANG_TBLGEN) 22 @echo "Building Clang attribute list with tblgen" 23 $(call transform-host-clang-td-to-out,clang-attr-list) 24 endif 25 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 $(CLANG_TBLGEN) 29 @echo "Building Clang attribute spelling list with tblgen" 30 $(call transform-host-clang-td-to-out,clang-attr-spelling-list) 31 endif 32 33 ifneq ($(findstring AttrPCHRead.inc,$(TBLGEN_TABLES)),) 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 $(CLANG_TBLGEN) 36 @echo "Building Clang attribute pch read with tblgen" 37 $(call transform-host-clang-td-to-out,clang-attr-pch-read) 38 endif 39 40 ifneq ($(findstring AttrPCHWrite.inc,$(TBLGEN_TABLES)),) 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 $(CLANG_TBLGEN) 43 @echo "Building Clang attribute pch write with tblgen" 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) 52 endif 53 54 ifneq ($(findstring Attrs.inc,$(TBLGEN_TABLES)),) 55 LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/Attrs.inc 56 $(intermediates)/include/clang/AST/Attrs.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN) 57 @echo "Building Clang attribute classes with tblgen" 58 $(call transform-host-clang-td-to-out,clang-attr-classes) 59 endif 60 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 \ 66 $(CLANG_TBLGEN) 67 @echo "Building Clang static analyzer checkers list with tblgen" 68 $(call transform-host-clang-td-to-out,clang-sa-checkers) 69 endif 70 71 ifneq ($(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)),) 72 LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/include/clang/Basic/,$(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES))) 73 $(intermediates)/include/clang/Basic/Diagnostic%Kinds.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(CLANG_TBLGEN) 74 @echo "Building Clang $(patsubst Diagnostic%Kinds.inc,%,$(@F)) diagnostic tables with tblgen" 75 $(call transform-host-clang-td-to-out,clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc,%,$(@F))) 76 endif 77 78 ifneq ($(findstring DiagnosticGroups.inc,$(TBLGEN_TABLES)),) 79 LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/DiagnosticGroups.inc 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) 81 @echo "Building Clang diagnostic groups with tblgen" 82 $(call transform-host-clang-td-to-out,clang-diag-groups) 83 endif 84 85 ifneq ($(findstring DiagnosticIndexName.inc,$(TBLGEN_TABLES)),) 86 LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/DiagnosticIndexName.inc 87 $(intermediates)/include/clang/Basic/DiagnosticIndexName.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(CLANG_TBLGEN) 88 @echo "Building Clang diagnostic name index with tblgen" 89 $(call transform-host-clang-td-to-out,clang-diag-groups) 90 endif 91 92 ifneq ($(findstring DeclNodes.inc,$(TBLGEN_TABLES)),) 93 LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/DeclNodes.inc 94 $(intermediates)/include/clang/AST/DeclNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/DeclNodes.td $(CLANG_TBLGEN) 95 @echo "Building Clang declaration node tables with tblgen" 96 $(call transform-host-clang-td-to-out,clang-decl-nodes) 97 endif 98 99 ifneq ($(findstring StmtNodes.inc,$(TBLGEN_TABLES)),) 100 LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/StmtNodes.inc 101 $(intermediates)/include/clang/AST/StmtNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/StmtNodes.td $(CLANG_TBLGEN) 102 @echo "Building Clang statement node tables with tblgen" 103 $(call transform-host-clang-td-to-out,clang-stmt-nodes) 104 endif 105 106 ifneq ($(findstring arm_neon.inc,$(TBLGEN_TABLES)),) 107 LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/arm_neon.inc 108 $(intermediates)/include/clang/Basic/arm_neon.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/arm_neon.td $(CLANG_TBLGEN) 109 @echo "Building Clang arm_neon.inc with tblgen" 110 $(call transform-host-clang-td-to-out,arm-neon-sema) 111 endif 112 113 ifneq ($(findstring Options.inc,$(TBLGEN_TABLES)),) 114 LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/Options.inc 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) 116 @echo "Building Clang Driver Option tables with tblgen" 117 $(call transform-host-clang-td-to-out,opt-parser-defs) 118 endif 119 120 ifneq ($(findstring CC1Options.inc,$(TBLGEN_TABLES)),) 121 LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/CC1Options.inc 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) 123 @echo "Building Clang CC1 Option tables with tblgen" 124 $(call transform-host-clang-td-to-out,opt-parser-defs) 125 endif 126 127 ifneq ($(findstring CC1AsOptions.inc,$(TBLGEN_TABLES)),) 128 LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/CC1AsOptions.inc 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) 130 @echo "Building Clang CC1 As Option tables with tblgen" 131 $(call transform-host-clang-td-to-out,opt-parser-defs) 132 endif 133 134 LOCAL_C_INCLUDES += $(intermediates)/include 135 136 endif 137