1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 06:31:31 +00:00

scan sources just once

This commit is contained in:
mrdudz 2014-11-26 19:32:54 +01:00
parent 0387b8cf1d
commit 92ed5fd64b
4 changed files with 44 additions and 40 deletions

View File

@ -19,14 +19,15 @@ WORKDIR := ./../../testwrk
.PHONY: all clean .PHONY: all clean
TESTS := $(patsubst %.c,$(WORKDIR)/%.prg,$(wildcard *.c)) SOURCES := $(wildcard *.c)
TESTS += $(patsubst %.c,$(WORKDIR)/%.o.prg,$(wildcard *.c)) TESTS := $(SOURCES:%.c=$(WORKDIR)/%.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.os.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.o.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.osi.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.os.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.osir.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osi.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.oi.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osir.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.oir.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oi.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.or.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oir.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.or.prg)
all: $(TESTS) all: $(TESTS)
@ -48,4 +49,4 @@ $(WORKDIR)/%.or.prg: %.c
! $(CL65) -Or $(CC65FLAGS) $< -o $@ ! $(CL65) -Or $(CC65FLAGS) $< -o $@
clean: clean:
@$(RM) $(TESTS) @$(RM) $(TESTS)
@$(RM) $(patsubst %.c,$(WORKDIR)/%.o,$(wildcard *.c)) @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.o)

View File

@ -23,14 +23,15 @@ DIFF := $(WORKDIR)/bdiff
.PHONY: all clean .PHONY: all clean
TESTS := $(patsubst %.c,$(WORKDIR)/%.prg,$(wildcard *.c)) SOURCES := $(wildcard *.c)
TESTS += $(patsubst %.c,$(WORKDIR)/%.o.prg,$(wildcard *.c)) TESTS := $(SOURCES:%.c=$(WORKDIR)/%.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.os.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.o.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.osi.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.os.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.osir.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osi.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.oi.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osir.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.oir.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oi.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.or.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oir.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.or.prg)
# FIXME: actually use/build differently optimized programs here # FIXME: actually use/build differently optimized programs here
@ -60,7 +61,7 @@ $(WORKDIR)/sitest%prg: sitest.c
clean: clean:
@$(RM) $(TESTS) @$(RM) $(TESTS)
@$(RM) $(patsubst %.c,$(WORKDIR)/%.o,$(wildcard *.c)) @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.o)
@$(RM) $(patsubst %.c,$(WORKDIR)/%.out,$(wildcard *.c)) @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.out)

View File

@ -28,14 +28,15 @@ CFLAGS := -O2 -Wall -W -Wextra -fwrapv -fno-strict-overflow
REFS := $(patsubst %.c,$(WORKDIR)/%.ref,$(wildcard *.c)) REFS := $(patsubst %.c,$(WORKDIR)/%.ref,$(wildcard *.c))
TESTS := $(patsubst %.c,$(WORKDIR)/%.prg,$(wildcard *.c)) SOURCES := $(wildcard *.c)
TESTS += $(patsubst %.c,$(WORKDIR)/%.o.prg,$(wildcard *.c)) TESTS := $(SOURCES:%.c=$(WORKDIR)/%.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.os.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.o.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.osi.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.os.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.osir.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osi.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.oi.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osir.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.oir.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oi.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.or.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oir.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.or.prg)
all: $(REFS) $(TESTS) all: $(REFS) $(TESTS)
@ -85,7 +86,7 @@ $(WORKDIR)/%.or.prg: %.c $(WORKDIR)/%.ref
clean: clean:
@$(RM) $(TESTS) @$(RM) $(TESTS)
@$(RM) $(patsubst %.c,$(WORKDIR)/%.o,$(wildcard *.c)) @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.o)
@$(RM) $(patsubst %.c,$(WORKDIR)/%.out,$(wildcard *.c)) @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.out)
@$(RM) $(patsubst %.c,$(WORKDIR)/%.ref,$(wildcard *.c)) @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.ref)
@$(RM) $(patsubst %.c,$(WORKDIR)/%.host,$(wildcard *.c)) @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.host)

View File

@ -21,14 +21,15 @@ WORKDIR := ./../../testwrk
.PHONY: all clean .PHONY: all clean
TESTS := $(patsubst %.c,$(WORKDIR)/%.prg,$(wildcard *.c)) SOURCES := $(wildcard *.c)
TESTS += $(patsubst %.c,$(WORKDIR)/%.o.prg,$(wildcard *.c)) TESTS := $(SOURCES:%.c=$(WORKDIR)/%.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.os.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.o.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.osi.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.os.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.osir.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osi.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.oi.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.osir.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.oir.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oi.prg)
TESTS += $(patsubst %.c,$(WORKDIR)/%.or.prg,$(wildcard *.c)) TESTS += $(SOURCES:%.c=$(WORKDIR)/%.oir.prg)
TESTS += $(SOURCES:%.c=$(WORKDIR)/%.or.prg)
all: $(TESTS) all: $(TESTS)
@ -66,4 +67,4 @@ $(WORKDIR)/%.or.prg: %.c
clean: clean:
@$(RM) $(TESTS) @$(RM) $(TESTS)
@$(RM) $(patsubst %.c,$(WORKDIR)/%.o,$(wildcard *.c)) @$(RM) $(SOURCES:%.c=$(WORKDIR)/%.o)