OSDN Git Service

Add opt.
[android-x86/external-llvm.git] / tblgen-rules.mk
1 # Only use this on the device or emulator.
2 ifeq ($(TARGET_ARCH),arm)
3
4 ###########################################################
5 ## Commands for running tblgen to compile a td file
6 ##########################################################
7 define transform-td-to-out
8 $(if $(LOCAL_IS_HOST_MODULE),   \
9         $(call transform-host-td-to-out,$(1)),  \
10         $(call transform-device-td-to-out,$(1)))
11 endef
12
13 ###########################################################
14 ## TableGen: Compile .td files to .inc.
15 ###########################################################
16 ifeq ($(LOCAL_MODULE_CLASS),)
17         LOCAL_MODULE_CLASS := STATIC_LIBRARIES
18 endif
19
20 ifneq ($(strip $(TBLGEN_TABLES)),)
21
22 intermediates := $(call local-intermediates-dir)
23 tblgen_gen_tables := $(addprefix $(intermediates)/,$(TBLGEN_TABLES))
24 LOCAL_GENERATED_SOURCES += $(tblgen_gen_tables)
25
26 tblgen_source_dir := $(LOCAL_PATH)
27 ifneq ($(TBLGEN_TD_DIR),)
28 tblgen_source_dir := $(TBLGEN_TD_DIR)
29 endif
30
31 ifneq ($(filter %GenRegisterNames.inc,$(tblgen_gen_tables)),)
32 $(intermediates)/%GenRegisterNames.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
33         $(call transform-td-to-out,register-enums)
34 endif
35
36 ifneq ($(filter %GenRegisterInfo.h.inc,$(tblgen_gen_tables)),)
37 $(intermediates)/%GenRegisterInfo.h.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
38         $(call transform-td-to-out,register-desc-header)
39 endif
40
41 ifneq ($(filter %GenRegisterInfo.inc,$(tblgen_gen_tables)),)
42 $(intermediates)/%GenRegisterInfo.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
43         $(call transform-td-to-out,register-desc)
44 endif
45
46 ifneq ($(filter %GenInstrNames.inc,$(tblgen_gen_tables)),)
47 $(intermediates)/%GenInstrNames.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
48         $(call transform-td-to-out,instr-enums)
49 endif
50
51 ifneq ($(filter %GenInstrInfo.inc,$(tblgen_gen_tables)),)
52 $(intermediates)/%GenInstrInfo.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
53         $(call transform-td-to-out,instr-desc)
54 endif
55
56 ifneq ($(filter %GenAsmWriter.inc,$(tblgen_gen_tables)),)
57 $(intermediates)/%GenAsmWriter.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
58         $(call transform-td-to-out,asm-writer)
59 endif
60
61 ifneq ($(filter %GenAsmWriter1.inc,$(tblgen_gen_tables)),)
62 $(intermediates)/%GenAsmWriter1.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
63         $(call transform-td-to-out,asm-writer -asmwriternum=1)
64 endif
65
66 ifneq ($(filter %GenAsmMatcher.inc,$(tblgen_gen_tables)),)
67 $(intermediates)/%GenAsmMatcher.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
68         $(call transform-td-to-out,asm-matcher)
69 endif
70
71 ifneq ($(filter %GenCodeEmitter.inc,$(tblgen_gen_tables)),)
72 $(intermediates)/%GenCodeEmitter.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
73         $(call transform-td-to-out,emitter)
74 endif
75
76 ifneq ($(filter %GenDAGISel.inc,$(tblgen_gen_tables)),)
77 $(intermediates)/%GenDAGISel.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
78         $(call transform-td-to-out,dag-isel)
79 endif
80
81 ifneq ($(filter %GenDisassemblerTables.inc,$(tblgen_gen_tables)),)
82 $(intermediates)/%GenDisassemblerTables.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
83         $(call transform-td-to-out,disassembler)
84 endif
85
86 ifneq ($(filter %GenEDInfo.inc,$(tblgen_gen_tables)),)
87 $(intermediates)/%GenEDInfo.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
88         $(call transform-td-to-out,enhanced-disassembly-info)
89 endif
90
91 ifneq ($(filter %GenFastISel.inc,$(tblgen_gen_tables)),)
92 $(intermediates)/%GenFastISel.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
93         $(call transform-td-to-out,fast-isel)
94 endif
95
96 ifneq ($(filter %GenSubtarget.inc,$(tblgen_gen_tables)),)
97 $(intermediates)/%GenSubtarget.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
98         $(call transform-td-to-out,subtarget)
99 endif
100
101 ifneq ($(filter %GenCallingConv.inc,$(tblgen_gen_tables)),)
102 $(intermediates)/%GenCallingConv.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
103         $(call transform-td-to-out,callingconv)
104 endif
105
106 ifneq ($(filter %GenIntrinsics.inc,$(tblgen_gen_tables)),)
107 $(intermediates)/%GenIntrinsics.inc: $(tblgen_source_dir)/%.td $(TBLGEN)
108         $(call transform-td-to-out,tgt_intrinsics)
109 endif
110
111 ifneq ($(findstring ARMGenDecoderTables.inc,$(tblgen_gen_tables)),)
112 $(intermediates)/ARMGenDecoderTables.inc: $(tblgen_source_dir)/ARM.td $(TBLGEN)
113         $(call transform-td-to-out,arm-decoder)
114 endif
115
116 endif
117
118 endif