From: Greg King Date: Thu, 18 Dec 2014 19:15:24 +0000 (-0500) Subject: Shortenned the code that creates the TESTS make variable. X-Git-Tag: V2.15~27^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=244eeedcfc82c2582e057a46c61d58a5e9b6e631;p=cc65 Shortenned the code that creates the TESTS make variable. And, fixed the variable-substitution that creates the CC65 optimization option. --- diff --git a/test/err/Makefile b/test/err/Makefile index 29c47ef3e..4e12323fd 100644 --- a/test/err/Makefile +++ b/test/err/Makefile @@ -20,15 +20,7 @@ WORKDIR := ../../testwrk .PHONY: all clean SOURCES := $(wildcard *.c) - -TESTS := $(SOURCES:%.c=$(WORKDIR)/%.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) +TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c=$(WORKDIR)/%$(option)prg)) all: $(TESTS) diff --git a/test/misc/Makefile b/test/misc/Makefile index c473f5f85..b04321c33 100644 --- a/test/misc/Makefile +++ b/test/misc/Makefile @@ -24,38 +24,30 @@ DIFF := $(WORKDIR)/bdiff .PHONY: all clean SOURCES := $(wildcard *.c) - -TESTS := $(SOURCES:%.c=$(WORKDIR)/%.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) +TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c=$(WORKDIR)/%$(option)prg)) all: $(TESTS) # should compile, but then hangs in an endless loop $(WORKDIR)/endless%prg: endless.c - $(CL65) $(subst .,,($*:.o%=-O%)) $(CC65FLAGS) $< -o $@ + $(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@ ! $(SIM65) $(SIM65FLAGS) $@ # these need reference data that can't be generated by a host-compiled program, # in a useful way $(WORKDIR)/limits%prg: limits.c - $(CL65) $(subst .,,($*:.o%=-O%)) $(CC65FLAGS) $< -o $@ + $(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@ $(SIM65) $(SIM65FLAGS) $@ > $(WORKDIR)/limits.out $(DIFF) $(WORKDIR)/limits.out limits.ref # the rest are tests that fail currently for one reason or another $(WORKDIR)/fields%prg: fields.c @echo "FIXME: " $@ "currently will fail." - $(CL65) $(subst .,,($*:.o%=-O%)) $(CC65FLAGS) $< -o $@ + $(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@ -$(SIM65) $(SIM65FLAGS) $@ $(WORKDIR)/sitest%prg: sitest.c @echo "FIXME: " $@ "currently will fail." - -$(CL65) $(subst .,,($*:.o%=-O%)) $(CC65FLAGS) $< -o $@ + -$(CL65) $(subst .,,$(*:.o%=-O%)) $(CC65FLAGS) $< -o $@ # -$(SIM65) $(SIM65FLAGS) $@ clean: diff --git a/test/ref/Makefile b/test/ref/Makefile index 66ff94e28..3e7a5ad6c 100644 --- a/test/ref/Makefile +++ b/test/ref/Makefile @@ -27,17 +27,8 @@ CFLAGS := -O2 -Wall -W -Wextra -fwrapv -fno-strict-overflow .PHONY: all clean SOURCES := $(wildcard *.c) - REFS := $(SOURCES:%.c=$(WORKDIR)/%.ref) - -TESTS := $(SOURCES:%.c=$(WORKDIR)/%.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) +TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c=$(WORKDIR)/%$(option)prg)) all: $(REFS) $(TESTS) diff --git a/test/val/Makefile b/test/val/Makefile index bd88797e5..2efcbd0de 100644 --- a/test/val/Makefile +++ b/test/val/Makefile @@ -22,15 +22,7 @@ WORKDIR := ../../testwrk .PHONY: all clean SOURCES := $(wildcard *.c) - -TESTS := $(SOURCES:%.c=$(WORKDIR)/%.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) +TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c=$(WORKDIR)/%$(option)prg)) all: $(TESTS)