blob: db4133538b68c414f68973c0068f7186349cd396 [file] [log] [blame]
Shih-wei Liaoea285162010-06-04 12:34:56 -07001###########################################################
2## TableGen: Compile .td files to .inc.
3###########################################################
4ifeq ($(LOCAL_MODULE_CLASS),)
5 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
6endif
7
8ifneq ($(strip $(TBLGEN_TABLES)),)
9
10intermediates := $(call local-intermediates-dir)
11
12ifneq ($(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)),)
13LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/clang/Basic/,$(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)))
14$(intermediates)/clang/Basic/Diagnostic%Kinds.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(TBLGEN)
15 @echo "Building Clang $(patsubst Diagnostic%Kinds.inc,%,$(@F)) diagnostic tables with tblgen"
16 $(call transform-host-td-to-out,clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc,%,$(@F)))
17endif
18
19ifneq ($(findstring DiagnosticGroups.inc,$(TBLGEN_TABLES)),)
20LOCAL_GENERATED_SOURCES += $(intermediates)/clang/Basic/DiagnosticGroups.inc
21$(intermediates)/clang/Basic/DiagnosticGroups.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(CLANG_ROOT_PATH)/include/clang/Basic/DiagnosticGroups.td $(TBLGEN)
22 @echo "Building Clang diagnostic groups with tblgen"
23 $(call transform-host-td-to-out,clang-diag-groups)
24endif
25
26ifneq ($(findstring Options.inc,$(TBLGEN_TABLES)),)
27LOCAL_GENERATED_SOURCES += $(intermediates)/clang/Driver/Options.inc
28$(intermediates)/clang/Driver/Options.inc: $(CLANG_ROOT_PATH)/include/clang/Driver/Options.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(TBLGEN)
29 @echo "Building Clang Driver Option tables with tblgen"
30 $(call transform-host-td-to-out,opt-parser-defs)
31endif
32
33ifneq ($(findstring CC1Options.inc,$(TBLGEN_TABLES)),)
34LOCAL_GENERATED_SOURCES += $(intermediates)/clang/Driver/CC1Options.inc
35$(intermediates)/clang/Driver/CC1Options.inc: $(CLANG_ROOT_PATH)/include/clang/Driver/CC1Options.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(TBLGEN)
36 @echo "Building Clang CC1 Option tables with tblgen"
37 $(call transform-host-td-to-out,opt-parser-defs)
38endif
39
40
41endif