1 # Makefile for the remaining tests that need special care in one way or another
12 MKDIR = mkdir $(subst /,\,$1)
13 RMDIR = -rmdir /s /q $(subst /,\,$1)
14 DEL = del /f $(subst /,\,$1)
28 NULLERR = 2>$(NULLDEV)
31 SIM65FLAGS = -x 200000000
33 CL65 := $(if $(wildcard ../../bin/cl65*),..$S..$Sbin$Scl65,cl65)
34 SIM65 := $(if $(wildcard ../../bin/sim65*),..$S..$Sbin$Ssim65,sim65)
36 WORKDIR = ..$S..$Stestwrk$Smisc
38 OPTIONS = g O Os Osi Osir Osr Oi Oir Or
40 DIFF = $(WORKDIR)$Sbdiff$(EXE)
47 SOURCES := $(wildcard *.c)
48 TESTS = $(foreach option,$(OPTIONS),$(SOURCES:%.c=$(WORKDIR)/%.$(option).6502.prg))
49 TESTS += $(foreach option,$(OPTIONS),$(SOURCES:%.c=$(WORKDIR)/%.$(option).65c02.prg))
54 $(call MKDIR,$(WORKDIR))
56 $(DIFF): ../bdiff.c | $(WORKDIR)
57 $(CC) $(CFLAGS) -o $@ $<
61 # should compile, but then hangs in an endless loop
62 $(WORKDIR)/endless.$1.$2.prg: endless.c | $(WORKDIR)
63 $(if $(QUIET),echo misc/endless.$1.$2.prg)
64 $(CL65) -t sim$2 -$1 -o $$@ $$< $(NULLERR)
65 $(NOT) $(SIM65) $(SIM65FLAGS) $$@ $(NULLOUT) $(NULLERR)
67 # these need reference data that can't be generated by a host-compiled program,
69 $(WORKDIR)/limits.$1.$2.prg: limits.c $(DIFF)
70 $(if $(QUIET),echo misc/limits.$1.$2.prg)
71 $(CL65) -t sim$2 -$1 -o $$@ $$< $(NULLERR)
72 $(SIM65) $(SIM65FLAGS) $$@ > $(WORKDIR)/limits.$1.out
73 $(DIFF) $(WORKDIR)/limits.$1.out limits.ref
75 $(WORKDIR)/goto.$1.$2.prg: goto.c $(DIFF)
76 $(if $(QUIET),echo misc/goto.$1.$2.prg)
77 $(CL65) -t sim$2 -$1 -o $$@ $$< 2>$(WORKDIR)/goto.$1.out
78 $(DIFF) $(WORKDIR)/goto.$1.out goto.ref
80 # the rest are tests that fail currently for one reason or another
81 $(WORKDIR)/fields.$1.$2.prg: fields.c | $(WORKDIR)
82 @echo "FIXME: " $$@ "currently will fail."
83 $(CL65) -t sim$2 -$1 -o $$@ $$< $(NULLERR)
84 -$(SIM65) $(SIM65FLAGS) $$@ $(NULLOUT)
85 $(WORKDIR)/sitest.$1.$2.prg: sitest.c | $(WORKDIR)
86 @echo "FIXME: " $$@ "currently will fail."
87 -$(CL65) -t sim$2 -$1 -o $$@ $$< $(NULLERR)
88 # -$(SIM65) $(SIM65FLAGS) $$@ $(NULLOUT)
89 $(WORKDIR)/cc65141011.$1.$2.prg: cc65141011.c | $(WORKDIR)
90 @echo "FIXME: " $$@ "currently can fail."
91 $(CL65) -t sim$2 -$1 -o $$@ $$< $(NULLERR)
92 -$(SIM65) $(SIM65FLAGS) $$@ $(NULLOUT)
96 $(foreach option,$(OPTIONS),$(eval $(call PRG_template,$(option),6502)))
97 $(foreach option,$(OPTIONS),$(eval $(call PRG_template,$(option),65c02)))
100 @$(call RMDIR,$(WORKDIR))
101 @$(call DEL,$(SOURCES:.c=.o))