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