From: Paul Smith Date: Sat, 30 Oct 2021 23:15:14 GMT Subject: Re: [PATCH] Makefile: replace most hardcoded object lists with $(wildcard) Message-ID: In-Reply-To: On Sun, 2021-10-31 at 00:32 +0200, Ævar Arnfjörð Bjarmason wrote: > +LIB_OBJS += $(patsubst %.c,%.o,$(foreach dir,$(LIB_OBJS_DIRS),$(wildcard $(dir)/*.c))) Another way to write this would be: LIB_OBJS += $(patsubst %.c,%.o,$(wildcard $(addsuffix /*.c,$(LIB_OBJS_DIRS))) I don't know that there's any reason to choose one over the other. I don't think there's any real performance difference although one could imagine this version to be VERY SLIGHTLY faster. Also this one is a little more "Lisp-ish"... that might be a pro or a con depending :). Just kibitzing while waiting for dinner to arrive...