mescc: Produce M1 output instead of hex2.
[mes.git] / stage0 / stage0.make
1 ifneq ($(HEX2),)
2
3 CLEAN+=$(OUT)/0exit-42
4 $(OUT)/0exit-42: stage0/elf32-0header.hex2 stage0/elf32-body-exit-42.hex2 stage0/elf-0footer.hex2 | $(OUT)
5         @echo "  HEX2   $(notdir $^) -> $(notdir $@)"
6         $(QUIET)$(HEX2) $(HEX2_FLAGS) $(^:%=-f %) > $@ || rm -f $@
7         chmod +x $@
8 TARGET:=0exit-42
9 EXPECT:=42
10 include make/check.make
11
12 CLEAN+=$(OUT)/exit-42
13 $(OUT)/exit-42: stage0/elf32-header.hex2 stage0/elf32-body-exit-42.hex2 stage0/elf32-footer-single-main.hex2 | $(OUT)
14         @echo "  HEX2   $(notdir $^) -> $(notdir $@)"
15         $(QUIET)$(HEX2) $(HEX2_FLAGS) $(^:%=-f %) > $@ || rm -f $@
16         chmod +x $@
17 TARGET:=exit-42
18 EXPECT:=42
19 include make/check.make
20
21 CLEAN+=$(OUT)/exit-42.guile
22 $(OUT)/exit-42.guile: stage0/elf32-header.hex2 $(OUT)/mlibc/mini-libc-mes.hex2 $(OUT)/stage0/exit-42.hex2 stage0/elf32-footer-single-main.hex2 | $(OUT)
23         @echo "  HEX2   $(notdir $^) -> $(notdir $@)"
24         $(QUIET)$(HEX2) $(HEX2_FLAGS) $(^:%=-f %) > $@ || rm -f $@
25         chmod +x $@
26
27 MESCC.scm:=guile/mescc.scm
28 $(OUT)/%.hex2: %.c | all-go
29         @echo "  MESCC.scm      $(notdir $<) -> $(notdir $@)"
30         @mkdir -p $(dir $@)
31         $(QUIET) $(MESCC.scm) -c -o $@ $^
32
33 TARGET:=exit-42.guile
34 EXPECT:=42
35 include make/check.make
36
37 endif