]> git.sur5r.net Git - cc65/blob - test/misc/Makefile
ce1956d861d2a3e70f2d397aa1cb0bd1bb1c204e
[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 TESTS := $(patsubst %.c,$(WORKDIR)/%.prg,$(wildcard *.c))
27 TESTS += $(patsubst %.c,$(WORKDIR)/%.o.prg,$(wildcard *.c))
28 TESTS += $(patsubst %.c,$(WORKDIR)/%.os.prg,$(wildcard *.c))
29 TESTS += $(patsubst %.c,$(WORKDIR)/%.osi.prg,$(wildcard *.c))
30 TESTS += $(patsubst %.c,$(WORKDIR)/%.osir.prg,$(wildcard *.c))
31 TESTS += $(patsubst %.c,$(WORKDIR)/%.oi.prg,$(wildcard *.c))
32 TESTS += $(patsubst %.c,$(WORKDIR)/%.oir.prg,$(wildcard *.c))
33 TESTS += $(patsubst %.c,$(WORKDIR)/%.or.prg,$(wildcard *.c))
34
35 all: $(TESTS)
36
37 # should compile, but then hangs in an endless loop
38 $(WORKDIR)/endless%prg: endless.c
39         $(CL65) $(CC65FLAGS) $< -o $@
40         ! $(SIM65) $(SIM65FLAGS) $@
41
42 # these need reference data that cant be generated by a host compiled program
43 # in a useful way
44 $(WORKDIR)/limits%prg: limits.c
45         $(CL65) $(CC65FLAGS) $< -o $@
46         $(SIM65) $(SIM65FLAGS) $@ > $(WORKDIR)/limits.out
47         $(DIFF) $(WORKDIR)/limits.out limits.ref
48
49 # the rest are tests that fail currently for one reason or another
50 $(WORKDIR)/fields%prg: fields.c
51         @echo "FIXME: " $@ "will currently fail"
52         $(CL65) $(CC65FLAGS) $< -o $@
53         -$(SIM65) $(SIM65FLAGS) $@
54 $(WORKDIR)/sitest%prg: sitest.c
55         @echo "FIXME: " $@ "will currently fail"
56         -$(CL65) $(CC65FLAGS) $< -o $@
57         -$(SIM65) $(SIM65FLAGS) $@
58
59 clean:
60         @$(RM) $(TESTS)
61         @$(RM) $(patsubst %.c,$(WORKDIR)/%.o,$(wildcard *.c))
62         @$(RM) $(patsubst %.c,$(WORKDIR)/%.out,$(wildcard *.c))
63
64