2 # makefile for the regression tests that return an error code on failure
8 CC65FLAGS := -t sim6502
9 SIM65FLAGS := -x 200000000
11 CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
12 SIM65 := $(if $(wildcard ../../bin/sim65*),../../bin/sim65,sim65)
20 WORKDIR := ../../testwrk
24 SOURCES := $(wildcard *.c)
25 TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c=$(WORKDIR)/%$(option)prg))
29 # Some files have "K & R"-style syntax. Therefore, some forward
30 # function-declarations don't match the later function definitions.
31 # Those programs fail when fastcall is used; but, the cdecl calling convention
32 # tolerates those conflicts. Therefore, make their functions default to cdecl.
34 $(WORKDIR)/cq4%prg $(WORKDIR)/cq71.%rg $(WORKDIR)/cq81%prg $(WORKDIR)/cq84%prg: CC65FLAGS += -Wc --all-cdecl
37 $(CL65) $(CC65FLAGS) $< -o $@
38 $(SIM65) $(SIM65FLAGS) $@
40 $(WORKDIR)/%.o.prg: %.c
41 $(CL65) -O $(CC65FLAGS) $< -o $@
42 $(SIM65) $(SIM65FLAGS) $@
44 $(WORKDIR)/%.os.prg: %.c
45 $(CL65) -Os $(CC65FLAGS) $< -o $@
46 $(SIM65) $(SIM65FLAGS) $@
48 $(WORKDIR)/%.osi.prg: %.c
49 $(CL65) -Osi $(CC65FLAGS) $< -o $@
50 $(SIM65) $(SIM65FLAGS) $@
52 $(WORKDIR)/%.osir.prg: %.c
53 $(CL65) -Osir $(CC65FLAGS) $< -o $@
54 $(SIM65) $(SIM65FLAGS) $@
56 $(WORKDIR)/%.oi.prg: %.c
57 $(CL65) -Oi $(CC65FLAGS) $< -o $@
58 $(SIM65) $(SIM65FLAGS) $@
60 $(WORKDIR)/%.oir.prg: %.c
61 $(CL65) -Oir $(CC65FLAGS) $< -o $@
62 $(SIM65) $(SIM65FLAGS) $@
64 $(WORKDIR)/%.or.prg: %.c
65 $(CL65) -Or $(CC65FLAGS) $< -o $@
66 $(SIM65) $(SIM65FLAGS) $@
70 @$(RM) $(SOURCES:.c=.o)