summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-11-02 18:06:01 -0400
committermidipix <writeonce@midipix.org>2016-11-02 18:06:01 -0400
commitcef05b74a3da979e412a3b2be54b4d9e846e9bb5 (patch)
treef1c4612d3045e4c6523b259cfacfdeff46022fa4
parent1d226189ab95c481f771ce62853af4118024f66f (diff)
downloadbfirm-cef05b74a3da979e412a3b2be54b4d9e846e9bb5.tar.bz2
bfirm-cef05b74a3da979e412a3b2be54b4d9e846e9bb5.tar.xz
build system: added source list and object file make rules.
-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)