]> git.sur5r.net Git - cc65/blob - test/misc/Makefile
Merge branch 'master' of https://github.com/cc65/cc65 into c1p
[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 CC65FLAGS := -t sim6502
9 SIM65FLAGS := -x 200000000
10
11 CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
12 SIM65 := $(if $(wildcard ../../bin/sim65*),../../bin/sim65,sim65)
13
14 ifdef CMD_EXE
15 RM := del /f
16 else
17 RM := rm -f
18 endif
19
20 WORKDIR := ../../testwrk
21
22 DIFF := $(WORKDIR)/bdiff
23
24 .PHONY: all clean
25
26 SOURCES := $(wildcard *.c)
27 TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c=$(WORKDIR)/%$(option)prg))
28
29 all: $(TESTS)
30
31 # should compile, but then hangs in an endless loop
32 $(WORKDIR)/endless%prg: endless.c
33         $(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@
34         ! $(SIM65) $(SIM65FLAGS) $@
35
36 # these need reference data that can't be generated by a host-compiled program,
37 # in a useful way
38 $(WORKDIR)/limits%prg: limits.c
39         $(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@
40         $(SIM65) $(SIM65FLAGS) $@ > $(WORKDIR)/limits.out
41         $(DIFF) $(WORKDIR)/limits.out limits.ref
42
43 # the rest are tests that fail currently for one reason or another
44 $(WORKDIR)/fields%prg: fields.c
45         @echo "FIXME: " $@ "currently will fail."
46         $(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@
47         -$(SIM65) $(SIM65FLAGS) $@
48 $(WORKDIR)/sitest%prg: sitest.c
49         @echo "FIXME: " $@ "currently will fail."
50         -$(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@
51 #       -$(SIM65) $(SIM65FLAGS) $@
52
53 clean:
54         @$(RM) $(TESTS)
55         @$(RM) $(SOURCES:.c=.o)
56         @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.out)