]> git.sur5r.net Git - cc65/commitdiff
scan sources just once 141/head
authormrdudz <mrdudz@users.noreply.github.com>
Wed, 26 Nov 2014 18:32:54 +0000 (19:32 +0100)
committermrdudz <mrdudz@users.noreply.github.com>
Wed, 26 Nov 2014 18:32:54 +0000 (19:32 +0100)
test/err/Makefile
test/misc/Makefile
test/ref/Makefile
test/val/Makefile

index f0fcf34863bade0d975d4c70e8a32e8b2543f10e..40ccfcb593bda6bc64141054c8d978deae728246 100644 (file)
@@ -19,14 +19,15 @@ 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 := $(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)
 
 all: $(TESTS)
 
@@ -48,4 +49,4 @@ $(WORKDIR)/%.or.prg: %.c
        ! $(CL65) -Or $(CC65FLAGS) $< -o $@
 clean:
        @$(RM) $(TESTS)
-       @$(RM) $(patsubst %.c,$(WORKDIR)/%.o,$(wildcard *.c))
+       @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.o)
index 0fa550d3fc7019d216331c468f8610ee5977f779..b18d9165eea916f7fea5d95bcabccbce18e0dc1a 100644 (file)
@@ -23,14 +23,15 @@ DIFF := $(WORKDIR)/bdiff
 
 .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 := $(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)
 
 # FIXME: actually use/build differently optimized programs here
 
@@ -60,7 +61,7 @@ $(WORKDIR)/sitest%prg: sitest.c
 
 clean:
        @$(RM) $(TESTS)
-       @$(RM) $(patsubst %.c,$(WORKDIR)/%.o,$(wildcard *.c))
-       @$(RM) $(patsubst %.c,$(WORKDIR)/%.out,$(wildcard *.c))
+       @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.o)
+       @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.out)
 
 
index 2a465b5004ddd7f2815031e7ec6e95996304d0e4..b752adc1dec1717e6e2a4552277308ec8e0d341b 100644 (file)
@@ -28,14 +28,15 @@ CFLAGS := -O2 -Wall -W -Wextra -fwrapv -fno-strict-overflow
 
 REFS := $(patsubst %.c,$(WORKDIR)/%.ref,$(wildcard *.c))
 
-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 := $(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)
 
 all: $(REFS) $(TESTS)
 
@@ -85,7 +86,7 @@ $(WORKDIR)/%.or.prg: %.c $(WORKDIR)/%.ref
 
 clean:
        @$(RM) $(TESTS)
-       @$(RM) $(patsubst %.c,$(WORKDIR)/%.o,$(wildcard *.c))
-       @$(RM) $(patsubst %.c,$(WORKDIR)/%.out,$(wildcard *.c))
-       @$(RM) $(patsubst %.c,$(WORKDIR)/%.ref,$(wildcard *.c))
-       @$(RM) $(patsubst %.c,$(WORKDIR)/%.host,$(wildcard *.c))
+       @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.o)
+       @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.out)
+       @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.ref)
+       @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.host)
index 2dc4796e6de594677824845b8a0a7f4cd6cc9641..2e0aca2781bd48b64555a61d2672419410587789 100644 (file)
@@ -21,14 +21,15 @@ 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 := $(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)
 
 all: $(TESTS)
 
@@ -66,4 +67,4 @@ $(WORKDIR)/%.or.prg: %.c
 
 clean:
        @$(RM) $(TESTS)
-       @$(RM) $(patsubst %.c,$(WORKDIR)/%.o,$(wildcard *.c))
+       @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.o)