1 # Makefile for the remaining tests that need special care in one way or another
11 MKDIR = mkdir $(subst /,\,$1)
12 RMDIR = -rmdir /s /q $(subst /,\,$1)
13 DEL = del /f $(subst /,\,$1)
23 SIM65FLAGS = -x 200000000
25 CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
26 SIM65 := $(if $(wildcard ../../bin/sim65*),..$S..$Sbin$Ssim65,sim65)
28 WORKDIR = ..$S..$Stestwrk$Smisc
30 OPTIONS = g O Os Osi Osir Oi Oir Or
32 DIFF = $(WORKDIR)$Sbdiff$(EXE)
39 SOURCES := $(wildcard *.c)
40 TESTS = $(foreach option,$(OPTIONS),$(SOURCES:%.c=$(WORKDIR)/%.$(option).6502.prg))
41 TESTS += $(foreach option,$(OPTIONS),$(SOURCES:%.c=$(WORKDIR)/%.$(option).65c02.prg))
46 $(call MKDIR,$(WORKDIR))
48 $(DIFF): ../bdiff.c | $(WORKDIR)
49 $(CC) $(CFLAGS) -o $@ $<
53 # should compile, but then hangs in an endless loop
54 $(WORKDIR)/endless.$1.$2.prg: endless.c | $(WORKDIR)
55 $(CL65) -t sim$2 -$1 -o $$@ $$<
56 $(NOT) $(SIM65) $(SIM65FLAGS) $$@
58 # these need reference data that can't be generated by a host-compiled program,
60 $(WORKDIR)/limits.$1.$2.prg: limits.c $(DIFF)
61 $(CL65) -t sim$2 -$1 -o $$@ $$<
62 $(SIM65) $(SIM65FLAGS) $$@ > $(WORKDIR)/limits.$1.out
63 $(DIFF) $(WORKDIR)/limits.$1.out limits.ref
65 # the rest are tests that fail currently for one reason or another
66 $(WORKDIR)/fields.$1.$2.prg: fields.c | $(WORKDIR)
67 @echo "FIXME: " $$@ "currently will fail."
68 $(CL65) -t sim$2 -$1 -o $$@ $$<
69 -$(SIM65) $(SIM65FLAGS) $$@
70 $(WORKDIR)/sitest.$1.$2.prg: sitest.c | $(WORKDIR)
71 @echo "FIXME: " $$@ "currently will fail."
72 -$(CL65) -t sim$2 -$1 -o $$@ $$<
73 # -$(SIM65) $(SIM65FLAGS) $$@
74 $(WORKDIR)/cc65141011.$1.$2.prg: cc65141011.c | $(WORKDIR)
75 @echo "FIXME: " $$@ "currently can fail."
76 $(CL65) -t sim$2 -$1 -o $$@ $$<
77 -$(SIM65) $(SIM65FLAGS) $$@
81 $(foreach option,$(OPTIONS),$(eval $(call PRG_template,$(option),6502)))
82 $(foreach option,$(OPTIONS),$(eval $(call PRG_template,$(option),65c02)))
85 @$(call RMDIR,$(WORKDIR))
86 @$(call DEL,$(SOURCES:.c=.o))