mes/make/bin.make
Jan Nieuwenhuizen 3c880bbb56 mescc: Refactor mlibc compilation.
* libc/libc-mes.c: New file.  Contents from module/mes/libc.mes, module/mes/libc-i386.mes.
* libc/libc-gcc.c: Rename from libc/mlibc.c, include libc/mstart.c
* libc/mstart.c: Remove.
* module/mes/libc-i386.mes: Remove.
* module/mes/libc-i386.scm: Remove.
* module/mes/libc.mes: Remove.
* module/mes/libc.scm: Remove.
* GNUmakefile (CFLAGS): Include libc-gcc.c (WAS: mlibc.c).
* make/bin-mlibc.make (C_FLAGS): Remove start.c include.
* make/mescc-guile.make: Rewrite using compile, link.
* make/mescc-mes.make: Likewise.
* scaffold/m.c: Update.
2017-05-21 22:25:02 +02:00

26 lines
661 B
Makefile

O_FILES := $(C_FILES:%.c=$(OUT)/%.$(CROSS)o)
D_FILES := $(O_FILES:%o=%d)
ifneq ($(DEBUG),)
$(info TARGET=$(TARGET))
$(info C_FILES=$(C_FILES))
$(info O_FILES=$(O_FILES))
$(info D_FILES=$(D_FILES))
endif
CLEAN+=$(O_FILES) $(OUT)/$(TARGET)
DIST-CLEAN+=$(D_FILES)
INCLUDES+=libc/include libc $(OUT)/$(DIR)
$(OUT)/$(TARGET): ld:=$(CROSS)LD
$(OUT)/$(TARGET): LD:=$(CROSS)$(LD)
$(OUT)/$(TARGET): CC:=$(CROSS)$(CC)
$(OUT)/$(TARGET): LDFLAGS:=$(LDFLAGS) $(LD_FLAGS) $(LINK)
$(OUT)/$(TARGET): O_FILES:=$(O_FILES)
$(OUT)/$(TARGET): $(O_FILES)
@echo " $(ld) $(notdir $^) -> $(notdir $@)"
$(QUIET)$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@
include make/compile.make