1
0
mirror of https://github.com/cc65/cc65.git synced 2024-09-08 01:54:33 +00:00

Merge pull request #144 from greg-king5/regression-makes

Regression-tests makefiles
This commit is contained in:
Oliver Schmidt 2014-12-20 17:31:33 +01:00
commit d11232214e
5 changed files with 54 additions and 84 deletions

View File

@ -1,41 +1,41 @@
# toplevel makefile for the regression tests # top-level makefile for the regression tests
MAKE := make --no-print-dir # You can comment this special target when you debug the regression tests.
# Then, make will give you more progress reports.
.SILENT:
ifneq ($(shell echo),) ifneq ($(shell echo),)
CMD_EXE = 1 CMD_EXE := 1
endif endif
ifdef CMD_EXE ifdef CMD_EXE
RM := del /f RM := del /f
EXE := .exe EXE := .exe
MKDIR = mkdir MKDIR := mkdir
RMDIR = rmdir RMDIR := rmdir
else else
RM := rm -f RM := rm -f
EXE := EXE :=
MKDIR = mkdir -p MKDIR := mkdir -p
RMDIR = rmdir RMDIR := rmdir
endif endif
WORKDIR := ../testwrk WORKDIR := ../testwrk
.PHONY: dotests clean .PHONY: all dotests continue mostly-clean clean
all: dotests all: dotests
$(WORKDIR): $(WORKDIR):
@$(MKDIR) $(WORKDIR) $(MKDIR) $(WORKDIR)
$(WORKDIR)/bdiff$(EXE): $(WORKDIR) $(WORKDIR)/bdiff$(EXE): bdiff.c | $(WORKDIR)
@$(CC) -o $(WORKDIR)/bdiff$(EXE) bdiff.c $(CC) -O2 -o $@ $<
dotests: $(WORKDIR)/bdiff$(EXE) .NOTPARALLEL:
@$(MAKE) -C val clean all
@$(MAKE) -C ref clean all dotests: mostly-clean continue
@$(MAKE) -C err clean all
@$(MAKE) -C misc clean all
continue: $(WORKDIR)/bdiff$(EXE) continue: $(WORKDIR)/bdiff$(EXE)
@$(MAKE) -C val all @$(MAKE) -C val all
@ -43,10 +43,12 @@ continue: $(WORKDIR)/bdiff$(EXE)
@$(MAKE) -C err all @$(MAKE) -C err all
@$(MAKE) -C misc all @$(MAKE) -C misc all
clean: mostly-clean:
@$(MAKE) -C val clean @$(MAKE) -C val clean
@$(MAKE) -C ref clean @$(MAKE) -C ref clean
@$(MAKE) -C err clean @$(MAKE) -C err clean
@$(MAKE) -C misc clean @$(MAKE) -C misc clean
@$(RM) $(WORKDIR)/bdiff$(EXE)
@$(RMDIR) $(WORKDIR) clean: mostly-clean
$(RM) $(WORKDIR)/bdiff$(EXE)
$(RMDIR) $(WORKDIR)

View File

@ -2,10 +2,10 @@
# makefile for the tests that MUST NOT compile # makefile for the tests that MUST NOT compile
ifneq ($(shell echo),) ifneq ($(shell echo),)
CMD_EXE = 1 CMD_EXE := 1
endif endif
CC65FLAGS = -t sim6502 CC65FLAGS := -t sim6502
CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65) CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
@ -15,19 +15,12 @@ else
RM := rm -f RM := rm -f
endif endif
WORKDIR := ./../../testwrk WORKDIR := ../../testwrk
.PHONY: all clean .PHONY: all clean
SOURCES := $(wildcard *.c) SOURCES := $(wildcard *.c)
TESTS := $(SOURCES:%.c=$(WORKDIR)/%.prg) TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c=$(WORKDIR)/%$(option)prg))
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.o.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.os.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osi.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osir.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oi.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oir.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.or.prg)
all: $(TESTS) all: $(TESTS)
@ -47,6 +40,7 @@ $(WORKDIR)/%.oir.prg: %.c
! $(CL65) -Oir $(CC65FLAGS) $< -o $@ ! $(CL65) -Oir $(CC65FLAGS) $< -o $@
$(WORKDIR)/%.or.prg: %.c $(WORKDIR)/%.or.prg: %.c
! $(CL65) -Or $(CC65FLAGS) $< -o $@ ! $(CL65) -Or $(CC65FLAGS) $< -o $@
clean: clean:
@$(RM) $(TESTS) @$(RM) $(TESTS)
@$(RM) $(SOURCES:%.c=$(WORKDIR)/%.o) @$(RM) $(SOURCES:.c=.o)

View File

@ -2,11 +2,11 @@
# makefile for the remaining tests that need special care in one way or another # makefile for the remaining tests that need special care in one way or another
ifneq ($(shell echo),) ifneq ($(shell echo),)
CMD_EXE = 1 CMD_EXE := 1
endif endif
CC65FLAGS = -t sim6502 CC65FLAGS := -t sim6502
SIM65FLAGS = -x 200000000 SIM65FLAGS := -x 200000000
CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65) CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
SIM65 := $(if $(wildcard ../../bin/sim65*),../../bin/sim65,sim65) SIM65 := $(if $(wildcard ../../bin/sim65*),../../bin/sim65,sim65)
@ -17,51 +17,40 @@ else
RM := rm -f RM := rm -f
endif endif
WORKDIR := ./../../testwrk WORKDIR := ../../testwrk
DIFF := $(WORKDIR)/bdiff DIFF := $(WORKDIR)/bdiff
.PHONY: all clean .PHONY: all clean
SOURCES := $(wildcard *.c) SOURCES := $(wildcard *.c)
TESTS := $(SOURCES:%.c=$(WORKDIR)/%.prg) TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c=$(WORKDIR)/%$(option)prg))
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.o.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.os.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osi.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osir.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oi.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oir.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.or.prg)
# FIXME: actually use/build differently optimized programs here
all: $(TESTS) all: $(TESTS)
# should compile, but then hangs in an endless loop # should compile, but then hangs in an endless loop
$(WORKDIR)/endless%prg: endless.c $(WORKDIR)/endless%prg: endless.c
$(CL65) $(CC65FLAGS) $< -o $@ $(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@
! $(SIM65) $(SIM65FLAGS) $@ ! $(SIM65) $(SIM65FLAGS) $@
# these need reference data that cant be generated by a host compiled program # these need reference data that can't be generated by a host-compiled program,
# in a useful way # in a useful way
$(WORKDIR)/limits%prg: limits.c $(WORKDIR)/limits%prg: limits.c
$(CL65) $(CC65FLAGS) $< -o $@ $(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@
$(SIM65) $(SIM65FLAGS) $@ > $(WORKDIR)/limits.out $(SIM65) $(SIM65FLAGS) $@ > $(WORKDIR)/limits.out
$(DIFF) $(WORKDIR)/limits.out limits.ref $(DIFF) $(WORKDIR)/limits.out limits.ref
# the rest are tests that fail currently for one reason or another # the rest are tests that fail currently for one reason or another
$(WORKDIR)/fields%prg: fields.c $(WORKDIR)/fields%prg: fields.c
@echo "FIXME: " $@ "will currently fail" @echo "FIXME: " $@ "currently will fail."
$(CL65) $(CC65FLAGS) $< -o $@ $(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@
-$(SIM65) $(SIM65FLAGS) $@ -$(SIM65) $(SIM65FLAGS) $@
$(WORKDIR)/sitest%prg: sitest.c $(WORKDIR)/sitest%prg: sitest.c
@echo "FIXME: " $@ "will currently fail" @echo "FIXME: " $@ "currently will fail."
-$(CL65) $(CC65FLAGS) $< -o $@ -$(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@
-$(SIM65) $(SIM65FLAGS) $@ # -$(SIM65) $(SIM65FLAGS) $@
clean: clean:
@$(RM) $(TESTS) @$(RM) $(TESTS)
@$(RM) $(SOURCES:%.c=$(WORKDIR)/%.o) @$(RM) $(SOURCES:.c=.o)
@$(RM) $(SOURCES:%.c=$(WORKDIR)/%.out) @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.out)

View File

@ -3,11 +3,11 @@
# compared with reference output # compared with reference output
ifneq ($(shell echo),) ifneq ($(shell echo),)
CMD_EXE = 1 CMD_EXE := 1
endif endif
CC65FLAGS = -t sim6502 CC65FLAGS := -t sim6502
SIM65FLAGS = -x 200000000 SIM65FLAGS := -x 200000000
CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65) CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
SIM65 := $(if $(wildcard ../../bin/sim65*),../../bin/sim65,sim65) SIM65 := $(if $(wildcard ../../bin/sim65*),../../bin/sim65,sim65)
@ -18,7 +18,7 @@ else
RM := rm -f RM := rm -f
endif endif
WORKDIR := ./../../testwrk WORKDIR := ../../testwrk
DIFF := $(WORKDIR)/bdiff DIFF := $(WORKDIR)/bdiff
@ -26,17 +26,9 @@ CFLAGS := -O2 -Wall -W -Wextra -fwrapv -fno-strict-overflow
.PHONY: all clean .PHONY: all clean
REFS := $(patsubst %.c,$(WORKDIR)/%.ref,$(wildcard *.c))
SOURCES := $(wildcard *.c) SOURCES := $(wildcard *.c)
TESTS := $(SOURCES:%.c=$(WORKDIR)/%.prg) REFS := $(SOURCES:%.c=$(WORKDIR)/%.ref)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.o.prg) TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c=$(WORKDIR)/%$(option)prg))
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.os.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osi.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osir.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oi.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oir.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.or.prg)
all: $(REFS) $(TESTS) all: $(REFS) $(TESTS)
@ -86,7 +78,7 @@ $(WORKDIR)/%.or.prg: %.c $(WORKDIR)/%.ref
clean: clean:
@$(RM) $(TESTS) @$(RM) $(TESTS)
@$(RM) $(SOURCES:%.c=$(WORKDIR)/%.o) @$(RM) $(SOURCES:.c=.o)
@$(RM) $(SOURCES:%.c=$(WORKDIR)/%.out) @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.out)
@$(RM) $(SOURCES:%.c=$(WORKDIR)/%.ref) @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.ref)
@$(RM) $(SOURCES:%.c=$(WORKDIR)/%.host) @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.host)

View File

@ -2,11 +2,11 @@
# makefile for the regression tests that return an error code on failure # makefile for the regression tests that return an error code on failure
ifneq ($(shell echo),) ifneq ($(shell echo),)
CMD_EXE = 1 CMD_EXE := 1
endif endif
CC65FLAGS = -t sim6502 CC65FLAGS := -t sim6502
SIM65FLAGS = -x 200000000 SIM65FLAGS := -x 200000000
CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65) CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
SIM65 := $(if $(wildcard ../../bin/sim65*),../../bin/sim65,sim65) SIM65 := $(if $(wildcard ../../bin/sim65*),../../bin/sim65,sim65)
@ -17,19 +17,12 @@ else
RM := rm -f RM := rm -f
endif endif
WORKDIR := ./../../testwrk WORKDIR := ../../testwrk
.PHONY: all clean .PHONY: all clean
SOURCES := $(wildcard *.c) SOURCES := $(wildcard *.c)
TESTS := $(SOURCES:%.c=$(WORKDIR)/%.prg) TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c=$(WORKDIR)/%$(option)prg))
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.o.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.os.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osi.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osir.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oi.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oir.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.or.prg)
all: $(TESTS) all: $(TESTS)
@ -67,4 +60,4 @@ $(WORKDIR)/%.or.prg: %.c
clean: clean:
@$(RM) $(TESTS) @$(RM) $(TESTS)
@$(RM) $(SOURCES:%.c=$(WORKDIR)/%.o) @$(RM) $(SOURCES:.c=.o)