]> git.sur5r.net Git - cc65/blob - test/misc/Makefile
Ignore return values only with CMD.EXE.
[cc65] / test / misc / Makefile
1
2 # makefile for the remaining tests that need special care in one way or another
3
4 ifneq ($(shell echo),)
5   CMD_EXE := 1
6 endif
7
8 ifdef CMD_EXE
9   M := -
10   S := $(subst /,\,/)
11   NOT := - # Hack
12   DEL = del /f $(subst /,\,$1)
13 else
14   M :=
15   S := /
16   NOT := !
17   DEL = $(RM) $1
18 endif
19
20 CC65FLAGS := -t sim6502
21 SIM65FLAGS := -x 200000000
22
23 CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
24 SIM65 := $(if $(wildcard ../../bin/sim65*),..$S..$Sbin$Ssim65,sim65)
25
26 WORKDIR := ..$S..$Stestwrk
27 DIFF := $(WORKDIR)/bdiff
28
29 .PHONY: all clean
30
31 SOURCES := $(wildcard *.c)
32 TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c=$(WORKDIR)/%$(option)prg))
33
34 all: $(TESTS)
35
36 # should compile, but then hangs in an endless loop
37 $(WORKDIR)/endless%prg: endless.c
38         $(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@
39         $(NOT) $(SIM65) $(SIM65FLAGS) $@
40
41 # these need reference data that can't be generated by a host-compiled program,
42 # in a useful way
43 $(WORKDIR)/limits%prg: limits.c
44         $(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@
45         $(SIM65) $(SIM65FLAGS) $@ > $(WORKDIR)/limits.out
46         $(DIFF) $(WORKDIR)/limits.out limits.ref
47
48 # the rest are tests that fail currently for one reason or another
49 $(WORKDIR)/fields%prg: fields.c
50         @echo "FIXME: " $@ "currently will fail."
51         $(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@
52         -$(SIM65) $(SIM65FLAGS) $@
53 $(WORKDIR)/sitest%prg: sitest.c
54         @echo "FIXME: " $@ "currently will fail."
55         -$(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@
56 #       -$(SIM65) $(SIM65FLAGS) $@
57 $(WORKDIR)/cc65141011%prg: cc65141011.c
58         @echo "FIXME: " $@ "currently can fail."
59         $(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@
60         -$(SIM65) $(SIM65FLAGS) $@
61
62 clean:
63         $M@$(call DEL,$(TESTS))
64         $M@$(call DEL,$(SOURCES:.c=.o))
65         $M@$(call DEL,$(SOURCES:%.c=$(WORKDIR)/%.out))