summaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-10-31 19:53:41 -0400
committermidipix <writeonce@midipix.org>2016-11-01 22:13:44 -0400
commita5e4b0b4a214410fe0f8d18709158510ec462b1a (patch)
treeb4360eb815782c4d736f7e1e8c61ef75a3a38c05 /project
parentf98ae1ccab437098f844ced551e07102a9f67073 (diff)
downloadbfirm-a5e4b0b4a214410fe0f8d18709158510ec462b1a.tar.bz2
bfirm-a5e4b0b4a214410fe0f8d18709158510ec462b1a.tar.xz
build system: code generation: added the gen-emitter build target.
Diffstat (limited to 'project')
-rw-r--r--project/codegen.mk76
-rw-r--r--project/common.mk7
-rw-r--r--project/headers.mk7
-rw-r--r--project/tree.mk6
4 files changed, 94 insertions, 2 deletions
diff --git a/project/codegen.mk b/project/codegen.mk
index fe1b610..a7430af 100644
--- a/project/codegen.mk
+++ b/project/codegen.mk
@@ -4,9 +4,32 @@ clean-gen:
rm -f gen.tag
rm -f $(GEN_IR_SRCS)
rm -f $(GEN_IR_HEADERS)
+ rm -f $(GEN_EMITTER_SRCS)
+ rm -f $(GEN_EMITTER_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
GEN_ALL = $(GEN_IR_SRCS) \
$(GEN_IR_HEADERS) \
+ $(GEN_EMITTER_SRCS) \
+ $(GEN_EMITTER_HEADERS) \
+
+
+# build/gen/ir/be
+GEN_BE_DIR_ARM = build/gen/ir/be/arm
+GEN_BE_DIR_AMD64 = build/gen/ir/be/amd64
+GEN_BE_DIR_IA32 = build/gen/ir/be/ia32
+GEN_BE_DIR_SPARC = build/gen/ir/be/sparc
+GEN_BE_DIR_TEMPLATE = build/gen/ir/be/TEMPLATE
+
+GEN_SPEC_ARM = $(SOURCE_DIR)/ir/be/arm/arm_spec.pl
+GEN_SPEC_AMD64 = $(SOURCE_DIR)/ir/be/amd64/amd64_spec.pl
+GEN_SPEC_IA32 = $(SOURCE_DIR)/ir/be/ia32/ia32_spec.pl
+GEN_SPEC_SPARC = $(SOURCE_DIR)/ir/be/sparc/sparc_spec.pl
+GEN_SPEC_TEMPLATE = $(SOURCE_DIR)/ir/be/TEMPLATE/TEMPLATE_spec.pl
# gen-ir
@@ -30,10 +53,59 @@ build/gen/include/libfirm/nodes.h: $(SOURCE_DIR)/scripts/templates/nodes.h \
+# gen-emitter
+GEN_EMITTER_TOOL = $(SOURCE_DIR)/ir/be/scripts/generate_emitter.pl
+
+
+$(GEN_BE_DIR_ARM)/emitter.tag: $(GEN_EMITTER_TOOL) $(GEN_SPEC_ARM)
+ $(GEN_EMITTER_TOOL) $(GEN_SPEC_ARM) $(GEN_BE_DIR_ARM)
+ touch $@
+
+
+$(GEN_BE_DIR_AMD64)/emitter.tag: $(GEN_EMITTER_TOOL) $(GEN_SPEC_AMD64)
+ $(GEN_EMITTER_TOOL) $(GEN_SPEC_AMD64) $(GEN_BE_DIR_AMD64)
+ touch $@
+
+
+$(GEN_BE_DIR_IA32)/emitter.tag: $(GEN_EMITTER_TOOL) $(GEN_SPEC_IA32)
+ $(GEN_EMITTER_TOOL) $(GEN_SPEC_IA32) $(GEN_BE_DIR_IA32)
+ touch $@
+
+
+$(GEN_BE_DIR_SPARC)/emitter.tag: $(GEN_EMITTER_TOOL) $(GEN_SPEC_SPARC)
+ $(GEN_EMITTER_TOOL) $(GEN_SPEC_SPARC) $(GEN_BE_DIR_SPARC)
+ touch $@
+
+
+$(GEN_BE_DIR_TEMPLATE)/emitter.tag: $(GEN_EMITTER_TOOL) $(GEN_SPEC_TEMPLATE)
+ $(GEN_EMITTER_TOOL) $(GEN_SPEC_TEMPLATE) $(GEN_BE_DIR_TEMPLATE)
+ touch $@
+
+
+
+$(GEN_BE_DIR_ARM)/gen_arm_emitter.c: $(GEN_BE_DIR_ARM)/emitter.tag
+$(GEN_BE_DIR_ARM)/gen_arm_emitter.h: $(GEN_BE_DIR_ARM)/emitter.tag
+
+$(GEN_BE_DIR_AMD64)/gen_amd64_emitter.c: $(GEN_BE_DIR_AMD64)/emitter.tag
+$(GEN_BE_DIR_AMD64)/gen_amd64_emitter.h: $(GEN_BE_DIR_AMD64)/emitter.tag
+
+$(GEN_BE_DIR_IA32)/gen_ia32_emitter.c: $(GEN_BE_DIR_IA32)/emitter.tag
+$(GEN_BE_DIR_IA32)/gen_ia32_emitter.h: $(GEN_BE_DIR_IA32)/emitter.tag
+
+$(GEN_BE_DIR_SPARC)/gen_sparc_emitter.c: $(GEN_BE_DIR_SPARC)/emitter.tag
+$(GEN_BE_DIR_SPARC)/gen_sparc_emitter.h: $(GEN_BE_DIR_SPARC)/emitter.tag
+
+$(GEN_BE_DIR_TEMPLATE)/gen_TEMPLATE_emitter.c: $(GEN_BE_DIR_TEMPLATE)/emitter.tag
+$(GEN_BE_DIR_TEMPLATE)/gen_TEMPLATE_emitter.h: $(GEN_BE_DIR_TEMPLATE)/emitter.tag
+
+
+
# gen-all
gen-ir: $(GEN_IR_SRCS) $(GEN_IR_HEADERS)
-gen-all: gen-ir
+gen-emitter: $(GEN_EMITTER_SRCS) $(GEN_EMITTER_HEADERS)
+
+gen-all: gen-ir gen-emitter
gen.tag: $(GEN_ALL)
touch gen.tag
@@ -43,4 +115,4 @@ gen: gen.tag
.PHONY: clean-gen \
gen gen-all \
- gen-ir
+ gen-ir gen-emitter
diff --git a/project/common.mk b/project/common.mk
index a479c01..e360781 100644
--- a/project/common.mk
+++ b/project/common.mk
@@ -1,3 +1,10 @@
GEN_IR_SRCS = \
build/gen/ir/ir/gen_irio.c \
build/gen/ir/ir/gen_irnode.c \
+
+GEN_EMITTER_SRCS = \
+ build/gen/ir/be/arm/gen_arm_emitter.c \
+ build/gen/ir/be/amd64/gen_amd64_emitter.c \
+ build/gen/ir/be/ia32/gen_ia32_emitter.c \
+ build/gen/ir/be/sparc/gen_sparc_emitter.c \
+ build/gen/ir/be/TEMPLATE/gen_TEMPLATE_emitter.c \
diff --git a/project/headers.mk b/project/headers.mk
index 9649bf9..2921a68 100644
--- a/project/headers.mk
+++ b/project/headers.mk
@@ -2,3 +2,10 @@ GEN_IR_HEADERS = \
build/gen/ir/ir/gen_irnode.h \
build/gen/ir/ir/gen_proj_names.h \
build/gen/include/libfirm/nodes.h \
+
+GEN_EMITTER_HEADERS = \
+ build/gen/ir/be/arm/gen_arm_emitter.h \
+ build/gen/ir/be/amd64/gen_amd64_emitter.h \
+ build/gen/ir/be/ia32/gen_ia32_emitter.h \
+ build/gen/ir/be/sparc/gen_sparc_emitter.h \
+ build/gen/ir/be/TEMPLATE/gen_TEMPLATE_emitter.h \
diff --git a/project/tree.mk b/project/tree.mk
index 2642cbd..c23b423 100644
--- a/project/tree.mk
+++ b/project/tree.mk
@@ -5,4 +5,10 @@ tree.tag:
mkdir -p build/gen/ir/ir
mkdir -p build/gen/include
mkdir -p build/gen/include/libfirm
+ mkdir -p build/gen/ir/be
+ mkdir -p build/gen/ir/be/arm
+ mkdir -p build/gen/ir/be/amd64
+ mkdir -p build/gen/ir/be/ia32
+ mkdir -p build/gen/ir/be/sparc
+ mkdir -p build/gen/ir/be/TEMPLATE
touch tree.tag