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