summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--project/common.mk33
1 files changed, 33 insertions, 0 deletions
diff --git a/project/common.mk b/project/common.mk
index 24b24c3..2be2961 100644
--- a/project/common.mk
+++ b/project/common.mk
@@ -1,3 +1,15 @@
+ir/%.lo: build/gen/ir/%.c $(ALL_HEADERS) host.tag tree.tag gen.tag
+ $(CC) -c -o $@ $< $(CFLAGS_SHARED)
+
+ir/%.o: build/gen/ir/%.c $(ALL_HEADERS) host.tag tree.tag gen.tag
+ $(CC) -c -o $@ $< $(CFLAGS_STATIC)
+
+ir/%.lo: $(SOURCE_DIR)/ir/%.c $(ALL_HEADERS) host.tag tree.tag gen.tag
+ $(CC) -c -o $@ $< $(CFLAGS_SHARED)
+
+ir/%.o: $(SOURCE_DIR)/ir/%.c $(ALL_HEADERS) host.tag tree.tag gen.tag
+ $(CC) -c -o $@ $< $(CFLAGS_STATIC)
+
GEN_IR_SRCS = \
build/gen/ir/ir/gen_irio.c \
build/gen/ir/ir/gen_irnode.c \
@@ -22,3 +34,24 @@ GEN_REGALLOC_SRCS = \
build/gen/ir/be/ia32/gen_ia32_regalloc_if.c \
build/gen/ir/be/sparc/gen_sparc_regalloc_if.c \
build/gen/ir/be/TEMPLATE/gen_TEMPLATE_regalloc_if.c \
+
+
+be_src_dirs = $(SOURCE_DIR)/ir/be/*/
+be_src_files = $(addsuffix *.c,$(be_src_dirs))
+be_sort_files = $(sort $(wildcard $(be_src_files)))
+
+ir_src_dirs = $(SOURCE_DIR)/ir/*/
+ir_src_files = $(addsuffix *.c,$(ir_src_dirs))
+ir_sort_files = $(sort $(wildcard $(ir_src_files)))
+
+gen_src_files = $(GEN_IR_SRCS)
+gen_src_files += $(GEN_EMITTER_SRCS)
+gen_src_files += $(GEN_OPCODES_SRCS)
+gen_src_files += $(GEN_REGALLOC_SRCS)
+
+
+BE_SRCS = $(subst $(SOURCE_DIR)/ir/,ir/,$(be_sort_files))
+IR_SRCS = $(subst $(SOURCE_DIR)/ir/,ir/,$(ir_sort_files))
+GEN_SRCS = $(subst build/gen/ir/,ir/,$(gen_src_files))
+
+COMMON_SRCS = $(BE_SRCS) $(IR_SRCS) $(GEN_SRCS)