summaryrefslogtreecommitdiff
path: root/project/codegen.mk
diff options
context:
space:
mode:
Diffstat (limited to 'project/codegen.mk')
-rw-r--r--project/codegen.mk62
1 files changed, 60 insertions, 2 deletions
diff --git a/project/codegen.mk b/project/codegen.mk
index a7430af..ee8dfa8 100644
--- a/project/codegen.mk
+++ b/project/codegen.mk
@@ -6,16 +6,25 @@ clean-gen:
rm -f $(GEN_IR_HEADERS)
rm -f $(GEN_EMITTER_SRCS)
rm -f $(GEN_EMITTER_HEADERS)
+ rm -f $(GEN_OPCODES_SRCS)
+ rm -f $(GEN_OPCODES_HEADERS)
rm -f $(GEN_BE_DIR_ARM)/emitter.tag
rm -f $(GEN_BE_DIR_AMD64)/emitter.tag
rm -f $(GEN_BE_DIR_IA32)/emitter.tag
rm -f $(GEN_BE_DIR_SPARC)/emitter.tag
rm -f $(GEN_BE_DIR_TEMPLATE)/emitter.tag
+ rm -f $(GEN_BE_DIR_ARM)/opcodes.tag
+ rm -f $(GEN_BE_DIR_AMD64)/opcodes.tag
+ rm -f $(GEN_BE_DIR_IA32)/opcodes.tag
+ rm -f $(GEN_BE_DIR_SPARC)/opcodes.tag
+ rm -f $(GEN_BE_DIR_TEMPLATE)/opcodes.tag
GEN_ALL = $(GEN_IR_SRCS) \
$(GEN_IR_HEADERS) \
$(GEN_EMITTER_SRCS) \
$(GEN_EMITTER_HEADERS) \
+ $(GEN_OPCODES_SRCS) \
+ $(GEN_OPCODES_HEADERS) \
# build/gen/ir/be
@@ -100,12 +109,61 @@ $(GEN_BE_DIR_TEMPLATE)/gen_TEMPLATE_emitter.h: $(GEN_BE_DIR_TEMPLATE)/emitter.ta
+# gen-opcodes
+GEN_OPCODES_TOOL = $(SOURCE_DIR)/ir/be/scripts/generate_new_opcodes.pl
+
+
+$(GEN_BE_DIR_ARM)/opcodes.tag: $(GEN_OPCODES_TOOL) $(GEN_SPEC_ARM)
+ $(GEN_OPCODES_TOOL) $(GEN_SPEC_ARM) $(GEN_BE_DIR_ARM)
+ touch $@
+
+
+$(GEN_BE_DIR_AMD64)/opcodes.tag: $(GEN_OPCODES_TOOL) $(GEN_SPEC_AMD64)
+ $(GEN_OPCODES_TOOL) $(GEN_SPEC_AMD64) $(GEN_BE_DIR_AMD64)
+ touch $@
+
+
+$(GEN_BE_DIR_IA32)/opcodes.tag: $(GEN_OPCODES_TOOL) $(GEN_SPEC_IA32)
+ $(GEN_OPCODES_TOOL) $(GEN_SPEC_IA32) $(GEN_BE_DIR_IA32)
+ touch $@
+
+
+$(GEN_BE_DIR_SPARC)/opcodes.tag: $(GEN_OPCODES_TOOL) $(GEN_SPEC_SPARC)
+ $(GEN_OPCODES_TOOL) $(GEN_SPEC_SPARC) $(GEN_BE_DIR_SPARC)
+ touch $@
+
+
+$(GEN_BE_DIR_TEMPLATE)/opcodes.tag: $(GEN_OPCODES_TOOL) $(GEN_SPEC_TEMPLATE)
+ $(GEN_OPCODES_TOOL) $(GEN_SPEC_TEMPLATE) $(GEN_BE_DIR_TEMPLATE)
+ touch $@
+
+
+
+$(GEN_BE_DIR_ARM)/gen_arm_new_nodes.c: $(GEN_BE_DIR_ARM)/opcodes.tag
+$(GEN_BE_DIR_ARM)/gen_arm_new_nodes.h: $(GEN_BE_DIR_ARM)/opcodes.tag
+
+$(GEN_BE_DIR_AMD64)/gen_amd64_new_nodes.c: $(GEN_BE_DIR_AMD64)/opcodes.tag
+$(GEN_BE_DIR_AMD64)/gen_amd64_new_nodes.h: $(GEN_BE_DIR_AMD64)/opcodes.tag
+
+$(GEN_BE_DIR_IA32)/gen_ia32_new_nodes.c: $(GEN_BE_DIR_IA32)/opcodes.tag
+$(GEN_BE_DIR_IA32)/gen_ia32_new_nodes.h: $(GEN_BE_DIR_IA32)/opcodes.tag
+
+$(GEN_BE_DIR_SPARC)/gen_sparc_new_nodes.c: $(GEN_BE_DIR_SPARC)/opcodes.tag
+$(GEN_BE_DIR_SPARC)/gen_sparc_new_nodes.h: $(GEN_BE_DIR_SPARC)/opcodes.tag
+
+$(GEN_BE_DIR_TEMPLATE)/gen_TEMPLATE_new_nodes.c: $(GEN_BE_DIR_TEMPLATE)/opcodes.tag
+$(GEN_BE_DIR_TEMPLATE)/gen_TEMPLATE_new_nodes.h: $(GEN_BE_DIR_TEMPLATE)/opcodes.tag
+
+
+
# gen-all
gen-ir: $(GEN_IR_SRCS) $(GEN_IR_HEADERS)
gen-emitter: $(GEN_EMITTER_SRCS) $(GEN_EMITTER_HEADERS)
-gen-all: gen-ir gen-emitter
+gen-opcodes: $(GEN_OPCODES_SRCS) $(GEN_OPCODES_HEADERS)
+
+gen-all: gen-ir gen-emitter gen-opcodes
gen.tag: $(GEN_ALL)
touch gen.tag
@@ -115,4 +173,4 @@ gen: gen.tag
.PHONY: clean-gen \
gen gen-all \
- gen-ir gen-emitter
+ gen-ir gen-emitter gen-opcodes