]> git.sur5r.net Git - cc65/blobdiff - test/val/Makefile
Shortenned the code that creates the TESTS make variable.
[cc65] / test / val / Makefile
index 2dc4796e6de594677824845b8a0a7f4cd6cc9641..2efcbd0dee13334c757ec0d31aa1ef4f6ba6b0fc 100644 (file)
@@ -2,11 +2,11 @@
 # makefile for the regression tests that return an error code on failure
 
 ifneq ($(shell echo),)
-  CMD_EXE = 1
+  CMD_EXE := 1
 endif
 
-CC65FLAGS = -t sim6502
-SIM65FLAGS = -x 200000000
+CC65FLAGS := -t sim6502
+SIM65FLAGS := -x 200000000
 
 CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
 SIM65 := $(if $(wildcard ../../bin/sim65*),../../bin/sim65,sim65)
@@ -17,18 +17,12 @@ else
 RM := rm -f
 endif
 
-WORKDIR := ./../../testwrk
+WORKDIR := ../../testwrk
 
 .PHONY: all clean
 
-TESTS := $(patsubst %.c,$(WORKDIR)/%.prg,$(wildcard *.c))
-TESTS += $(patsubst %.c,$(WORKDIR)/%.o.prg,$(wildcard *.c))
-TESTS += $(patsubst %.c,$(WORKDIR)/%.os.prg,$(wildcard *.c))
-TESTS += $(patsubst %.c,$(WORKDIR)/%.osi.prg,$(wildcard *.c))
-TESTS += $(patsubst %.c,$(WORKDIR)/%.osir.prg,$(wildcard *.c))
-TESTS += $(patsubst %.c,$(WORKDIR)/%.oi.prg,$(wildcard *.c))
-TESTS += $(patsubst %.c,$(WORKDIR)/%.oir.prg,$(wildcard *.c))
-TESTS += $(patsubst %.c,$(WORKDIR)/%.or.prg,$(wildcard *.c))
+SOURCES := $(wildcard *.c)
+TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c=$(WORKDIR)/%$(option)prg))
 
 all: $(TESTS)
 
@@ -66,4 +60,4 @@ $(WORKDIR)/%.or.prg: %.c
 
 clean:
        @$(RM) $(TESTS)
-       @$(RM) $(patsubst %.c,$(WORKDIR)/%.o,$(wildcard *.c))
+       @$(RM) $(SOURCES:.c=.o)