From cef05b74a3da979e412a3b2be54b4d9e846e9bb5 Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 2 Nov 2016 18:06:01 -0400 Subject: build system: added source list and object file make rules. --- project/common.mk | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'project') 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) -- cgit v1.2.3