Home | History | Annotate | Download | only in clang
      1 ###################################4########################
      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 define transform-clang-td-to-out
     11 $(if $(LOCAL_IS_HOST_MODULE),	\
     12 	$(call transform-host-clang-td-to-out,$(1)),	\
     13 	$(call transform-device-clang-td-to-out,$(1)))
     14 endef
     15 
     16 define transform-td-to-out
     17 $(if $(LOCAL_IS_HOST_MODULE),	\
     18 	$(call transform-host-td-to-out,$(1)),	\
     19 	$(call transform-device-td-to-out,$(1)))
     20 endef
     21 
     22 generated_sources := $(call local-generated-sources-dir)
     23 
     24 ifneq ($(findstring AttrDump.inc,$(TBLGEN_TABLES)),)
     25 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/AST/AttrDump.inc
     26 $(generated_sources)/include/clang/AST/AttrDump.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
     27 $(generated_sources)/include/clang/AST/AttrDump.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
     28 	$(call transform-clang-td-to-out,clang-attr-dump)
     29 endif
     30 
     31 ifneq ($(findstring AttrImpl.inc,$(TBLGEN_TABLES)),)
     32 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/AST/AttrImpl.inc
     33 $(generated_sources)/include/clang/AST/AttrImpl.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
     34 $(generated_sources)/include/clang/AST/AttrImpl.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
     35 	$(call transform-clang-td-to-out,clang-attr-impl)
     36 endif
     37 
     38 ifneq ($(findstring AttrHasAttributeImpl.inc,$(TBLGEN_TABLES)),)
     39 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Basic/AttrHasAttributeImpl.inc
     40 $(generated_sources)/include/clang/Basic/AttrHasAttributeImpl.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
     41 $(generated_sources)/include/clang/Basic/AttrHasAttributeImpl.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
     42 	$(call transform-clang-td-to-out,clang-attr-has-attribute-impl)
     43 endif
     44 
     45 ifneq ($(findstring AttrList.inc,$(TBLGEN_TABLES)),)
     46 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Basic/AttrList.inc
     47 $(generated_sources)/include/clang/Basic/AttrList.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
     48 $(generated_sources)/include/clang/Basic/AttrList.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
     49 	$(call transform-clang-td-to-out,clang-attr-list)
     50 endif
     51 
     52 ifneq ($(findstring AttrSpellingListIndex.inc,$(TBLGEN_TABLES)),)
     53 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Sema/AttrSpellingListIndex.inc
     54 $(generated_sources)/include/clang/Sema/AttrSpellingListIndex.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
     55 $(generated_sources)/include/clang/Sema/AttrSpellingListIndex.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
     56 	$(call transform-clang-td-to-out,clang-attr-spelling-index)
     57 endif
     58 
     59 ifneq ($(findstring AttrPCHRead.inc,$(TBLGEN_TABLES)),)
     60 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Serialization/AttrPCHRead.inc
     61 $(generated_sources)/include/clang/Serialization/AttrPCHRead.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
     62 $(generated_sources)/include/clang/Serialization/AttrPCHRead.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
     63 	$(call transform-clang-td-to-out,clang-attr-pch-read)
     64 endif
     65 
     66 ifneq ($(findstring AttrPCHWrite.inc,$(TBLGEN_TABLES)),)
     67 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Serialization/AttrPCHWrite.inc
     68 $(generated_sources)/include/clang/Serialization/AttrPCHWrite.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
     69 $(generated_sources)/include/clang/Serialization/AttrPCHWrite.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
     70 	$(call transform-clang-td-to-out,clang-attr-pch-write)
     71 endif
     72 
     73 ifneq ($(findstring Attrs.inc,$(TBLGEN_TABLES)),)
     74 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/AST/Attrs.inc
     75 $(generated_sources)/include/clang/AST/Attrs.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
     76 $(generated_sources)/include/clang/AST/Attrs.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
     77 	$(call transform-clang-td-to-out,clang-attr-classes)
     78 endif
     79 
     80 ifneq ($(findstring AttrParserStringSwitches.inc,$(TBLGEN_TABLES)),)
     81 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Parse/AttrParserStringSwitches.inc
     82 $(generated_sources)/include/clang/Parse/AttrParserStringSwitches.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
     83 $(generated_sources)/include/clang/Parse/AttrParserStringSwitches.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
     84 	$(call transform-clang-td-to-out,clang-attr-parser-string-switches)
     85 endif
     86 
     87 ifneq ($(findstring AttrVisitor.inc,$(TBLGEN_TABLES)),)
     88 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/AST/AttrVisitor.inc
     89 $(generated_sources)/include/clang/AST/AttrVisitor.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
     90 $(generated_sources)/include/clang/AST/AttrVisitor.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
     91 	$(call transform-clang-td-to-out,clang-attr-ast-visitor)
     92 endif
     93 
     94 ifneq ($(findstring AttrParsedAttrKinds.inc,$(TBLGEN_TABLES)),)
     95 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Sema/AttrParsedAttrKinds.inc
     96 $(generated_sources)/include/clang/Sema/AttrParsedAttrKinds.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
     97 $(generated_sources)/include/clang/Sema/AttrParsedAttrKinds.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
     98 	$(call transform-clang-td-to-out,clang-attr-parsed-attr-kinds)
     99 endif
    100 
    101 ifneq ($(findstring AttrParsedAttrImpl.inc,$(TBLGEN_TABLES)),)
    102 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Sema/AttrParsedAttrImpl.inc
    103 $(generated_sources)/include/clang/Sema/AttrParsedAttrImpl.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    104 $(generated_sources)/include/clang/Sema/AttrParsedAttrImpl.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
    105 	$(call transform-clang-td-to-out,clang-attr-parsed-attr-impl)
    106 endif
    107 
    108 ifneq ($(findstring AttrParsedAttrList.inc,$(TBLGEN_TABLES)),)
    109 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Sema/AttrParsedAttrList.inc
    110 $(generated_sources)/include/clang/Sema/AttrParsedAttrList.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    111 $(generated_sources)/include/clang/Sema/AttrParsedAttrList.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
    112 	$(call transform-clang-td-to-out,clang-attr-parsed-attr-list)
    113 endif
    114 
    115 ifneq ($(findstring AttrTemplateInstantiate.inc,$(TBLGEN_TABLES)),)
    116 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Sema/AttrTemplateInstantiate.inc
    117 $(generated_sources)/include/clang/Sema/AttrTemplateInstantiate.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    118 $(generated_sources)/include/clang/Sema/AttrTemplateInstantiate.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td $(CLANG_TBLGEN)
    119 	$(call transform-clang-td-to-out,clang-attr-template-instantiate)
    120 endif
    121 
    122 ifneq ($(findstring Checkers.inc,$(TBLGEN_TABLES)),)
    123 LOCAL_GENERATED_SOURCES += $(generated_sources)/Checkers.inc
    124 $(generated_sources)/Checkers.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    125 $(generated_sources)/Checkers.inc: \
    126   $(CLANG_ROOT_PATH)/lib/StaticAnalyzer/Checkers/Checkers.td \
    127   $(CLANG_ROOT_PATH)/include/clang/StaticAnalyzer/Checkers/CheckerBase.td \
    128   $(CLANG_TBLGEN)
    129 	$(call transform-clang-td-to-out,clang-sa-checkers)
    130 endif
    131 
    132 ifneq ($(findstring CommentCommandInfo.inc,$(TBLGEN_TABLES)),)
    133 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/AST/CommentCommandInfo.inc
    134 $(generated_sources)/include/clang/AST/CommentCommandInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    135 $(generated_sources)/include/clang/AST/CommentCommandInfo.inc: \
    136   $(CLANG_ROOT_PATH)/include/clang/AST/CommentCommands.td \
    137   $(CLANG_TBLGEN)
    138 	$(call transform-clang-td-to-out,clang-comment-command-info)
    139 endif
    140 
    141 ifneq ($(findstring CommentCommandList.inc,$(TBLGEN_TABLES)),)
    142 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/AST/CommentCommandList.inc
    143 $(generated_sources)/include/clang/AST/CommentCommandList.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    144 $(generated_sources)/include/clang/AST/CommentCommandList.inc: \
    145   $(CLANG_ROOT_PATH)/include/clang/AST/CommentCommands.td \
    146   $(CLANG_TBLGEN)
    147 	$(call transform-clang-td-to-out,clang-comment-command-list)
    148 endif
    149 
    150 ifneq ($(findstring CommentHTMLNamedCharacterReferences.inc,$(TBLGEN_TABLES)),)
    151 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/AST/CommentHTMLNamedCharacterReferences.inc
    152 $(generated_sources)/include/clang/AST/CommentHTMLNamedCharacterReferences.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    153 $(generated_sources)/include/clang/AST/CommentHTMLNamedCharacterReferences.inc: \
    154   $(CLANG_ROOT_PATH)/include/clang/AST/CommentHTMLNamedCharacterReferences.td \
    155   $(CLANG_TBLGEN)
    156 	$(call transform-clang-td-to-out,clang-comment-html-named-character-references)
    157 endif
    158 
    159 ifneq ($(findstring CommentHTMLTagsProperties.inc,$(TBLGEN_TABLES)),)
    160 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/AST/CommentHTMLTagsProperties.inc
    161 $(generated_sources)/include/clang/AST/CommentHTMLTagsProperties.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    162 $(generated_sources)/include/clang/AST/CommentHTMLTagsProperties.inc: \
    163   $(CLANG_ROOT_PATH)/include/clang/AST/CommentHTMLTags.td \
    164   $(CLANG_TBLGEN)
    165 	$(call transform-clang-td-to-out,clang-comment-html-tags-properties)
    166 endif
    167 
    168 ifneq ($(findstring CommentHTMLTags.inc,$(TBLGEN_TABLES)),)
    169 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/AST/CommentHTMLTags.inc
    170 $(generated_sources)/include/clang/AST/CommentHTMLTags.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    171 $(generated_sources)/include/clang/AST/CommentHTMLTags.inc: \
    172   $(CLANG_ROOT_PATH)/include/clang/AST/CommentHTMLTags.td \
    173   $(CLANG_TBLGEN)
    174 	$(call transform-clang-td-to-out,clang-comment-html-tags)
    175 endif
    176 
    177 ifneq ($(findstring CommentNodes.inc,$(TBLGEN_TABLES)),)
    178 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/AST/CommentNodes.inc
    179 $(generated_sources)/include/clang/AST/CommentNodes.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    180 $(generated_sources)/include/clang/AST/CommentNodes.inc: \
    181   $(CLANG_ROOT_PATH)/include/clang/Basic/CommentNodes.td \
    182   $(CLANG_TBLGEN)
    183 	$(call transform-clang-td-to-out,clang-comment-nodes)
    184 endif
    185 
    186 ifneq ($(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)),)
    187 LOCAL_GENERATED_SOURCES += $(addprefix $(generated_sources)/include/clang/Basic/,$(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)))
    188 $(generated_sources)/include/clang/Basic/Diagnostic%Kinds.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    189 $(generated_sources)/include/clang/Basic/Diagnostic%Kinds.inc: \
    190   $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td \
    191   $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic%Kinds.td \
    192   $(CLANG_TBLGEN)
    193 	$(call transform-clang-td-to-out,clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc,%,$(@F)))
    194 endif
    195 
    196 ifneq ($(findstring DiagnosticGroups.inc,$(TBLGEN_TABLES)),)
    197 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Basic/DiagnosticGroups.inc
    198 $(generated_sources)/include/clang/Basic/DiagnosticGroups.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    199 $(generated_sources)/include/clang/Basic/DiagnosticGroups.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(CLANG_ROOT_PATH)/include/clang/Basic/DiagnosticGroups.td $(CLANG_TBLGEN)
    200 	$(call transform-clang-td-to-out,clang-diag-groups)
    201 endif
    202 
    203 ifneq ($(findstring DiagnosticIndexName.inc,$(TBLGEN_TABLES)),)
    204 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Basic/DiagnosticIndexName.inc
    205 $(generated_sources)/include/clang/Basic/DiagnosticIndexName.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    206 $(generated_sources)/include/clang/Basic/DiagnosticIndexName.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(CLANG_TBLGEN)
    207 	$(call transform-clang-td-to-out,clang-diag-groups)
    208 endif
    209 
    210 ifneq ($(findstring DeclNodes.inc,$(TBLGEN_TABLES)),)
    211 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/AST/DeclNodes.inc
    212 $(generated_sources)/include/clang/AST/DeclNodes.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    213 $(generated_sources)/include/clang/AST/DeclNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/DeclNodes.td $(CLANG_TBLGEN)
    214 	$(call transform-clang-td-to-out,clang-decl-nodes)
    215 endif
    216 
    217 ifneq ($(findstring StmtNodes.inc,$(TBLGEN_TABLES)),)
    218 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/AST/StmtNodes.inc
    219 $(generated_sources)/include/clang/AST/StmtNodes.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    220 $(generated_sources)/include/clang/AST/StmtNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/StmtNodes.td $(CLANG_TBLGEN)
    221 	$(call transform-clang-td-to-out,clang-stmt-nodes)
    222 endif
    223 
    224 ifneq ($(findstring arm_neon.inc,$(TBLGEN_TABLES)),)
    225 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Basic/arm_neon.inc
    226 $(generated_sources)/include/clang/Basic/arm_neon.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    227 $(generated_sources)/include/clang/Basic/arm_neon.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/arm_neon.td $(CLANG_TBLGEN)
    228 	$(call transform-clang-td-to-out,arm-neon-sema)
    229 endif
    230 
    231 ifneq ($(findstring Options.inc,$(TBLGEN_TABLES)),)
    232 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Driver/Options.inc
    233 $(generated_sources)/include/clang/Driver/Options.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    234 $(generated_sources)/include/clang/Driver/Options.inc: $(CLANG_ROOT_PATH)/include/clang/Driver/Options.td $(LLVM_ROOT_PATH)/include/llvm/Option/OptParser.td $(CLANG_ROOT_PATH)/include/clang/Driver/CC1Options.td \
    235     $(CLANG_TBLGEN) $(LLVM_TBLGEN)
    236 	$(call transform-td-to-out,opt-parser-defs)
    237 endif
    238 
    239 ifneq ($(findstring arm_neon.h,$(TBLGEN_TABLES)),)
    240 LOCAL_GENERATED_SOURCES += $(generated_sources)/include/clang/Basic/arm_neon.h
    241 $(generated_sources)/include/clang/Basic/arm_neon.h: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
    242 $(generated_sources)/include/clang/Basic/arm_neon.h: $(CLANG_ROOT_PATH)/include/clang/Basic/arm_neon.td $(CLANG_TBLGEN)
    243 	$(call transform-clang-td-to-out,arm-neon)
    244 endif
    245 
    246 LOCAL_C_INCLUDES += $(generated_sources)/include
    247 
    248 endif
    249