mescc: Support regular C99 compile, headers + mlibc.
[mes.git] / make / bin.make
1 O_FILES := $(C_FILES:%.c=$(OUT)/%.$(CROSS)o)
2 D_FILES := $(O_FILES:%o=%d)
3
4 ifneq ($(DEBUG),)
5 $(info TARGET=$(TARGET))
6 $(info C_FILES=$(C_FILES))
7 $(info O_FILES=$(O_FILES))
8 $(info O_FILES=$(D_FILES))
9 endif
10
11 CLEAN+=$(O_FILES) $(OUT)/$(TARGET)
12 DIST-CLEAN+=$(D_FILES)
13
14 INCLUDES+=libc/include libc $(OUT)/$(DIR)
15
16 $(OUT)/$(TARGET): ld:=$(CROSS)LD
17 $(OUT)/$(TARGET): LD:=$(CROSS)$(LD)
18 $(OUT)/$(TARGET): CC:=$(CROSS)$(CC)
19 $(OUT)/$(TARGET): LDFLAGS:=$(LDFLAGS) $(LD_FLAGS) $(LINK)
20 $(OUT)/$(TARGET): O_FILES:=$(O_FILES)
21 $(OUT)/$(TARGET): $(O_FILES)
22         @echo " $(ld)   $(notdir $^) -> $(notdir $@)"
23         $(QUIET)$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@
24
25 include make/compile.make