From d5432ca0df38f7be136140a58696a900d0f5ea61 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Thu, 15 May 2025 18:19:08 -0500 Subject: [PATCH] make: Adopted simpler filter-out pattern for finding source files So: $(filter-out %.t.c %.b.c %.a.c,$(wildcard bd/*.c)) Instead of: $(filter-out $(wildcard bd/*.t.* bd/*.b.*),$(wildcard bd/*.c)) The main benefit is we no longer need to explicitly specify all subdirectories, though the single wildcard is a bit less flexible if test.py/bench.py ever end up with other non-C artifacts. Unfortunately only a single wildcard is supported in filter-out. --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c9e108f0..7095bbea 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ endif # find source files -SRC ?= $(filter-out $(wildcard *.t.* *.b.*),$(wildcard *.c)) +SRC ?= $(filter-out %.t.c %.b.c %.a.c,$(wildcard *.c)) OBJ := $(SRC:%.c=$(BUILDDIR)/%.o) DEP := $(SRC:%.c=$(BUILDDIR)/%.d) ASM := $(SRC:%.c=$(BUILDDIR)/%.s) @@ -19,7 +19,7 @@ GCDA := $(SRC:%.c=$(BUILDDIR)/%.t.a.gcda) TESTS ?= $(wildcard tests/*.toml) TEST_SRC ?= \ $(SRC) \ - $(filter-out $(wildcard bd/*.t.* bd/*.b.*),$(wildcard bd/*.c)) \ + $(filter-out %.t.c %.b.c %.a.c,$(wildcard bd/*.c)) \ runners/test_runner.c TEST_RUNNER ?= $(BUILDDIR)/runners/test_runner TEST_C := \ @@ -38,7 +38,7 @@ TEST_CSV := $(TEST_RUNNER:%=%.csv) BENCHES ?= $(wildcard benches/*.toml) BENCH_SRC ?= \ $(SRC) \ - $(filter-out $(wildcard bd/*.t.* bd/*.b.*),$(wildcard bd/*.c)) \ + $(filter-out %.t.c %.b.c %.a.c,$(wildcard bd/*.c)) \ runners/bench_runner.c BENCH_RUNNER ?= $(BUILDDIR)/runners/bench_runner BENCH_C := \