defs-dirs.mk: Filter out non-existing ordered subdirs

SUBDIRS combines $(ORDERED_SUBDIRS) with the subdirectories found on disk.
An $(ORDERED_SUBDIRS) entry that does not exist in the tree is still passed
to the recursive make loop, which then errors out over the missing
directory.

Filter the ordered subdirectories through the wildcard of their Makefile
paths, keeping only the ones that are actually there.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-09-03 13:19:54 +02:00
commit 51c42f7dda
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -5,6 +5,6 @@ SUBDIRS_TO_ITERATE = $(filter-out $(IGNORE_SUBDIRS),$(SUBDIRS))
EXTRA_SUBDIR_TARGETS ?=
ALLOWED_SUBDIR_TARGETS ?= all install clean distclean test link-in $(EXTRA_SUBDIR_TARGETS)
SUBDIRS ?= $(ORDERED_SUBDIRS) $(filter-out $(ORDERED_SUBDIRS),$(FIND_SUBDIRS))
SUBDIRS ?= $(dir $(wildcard $(addsuffix /Makefile,$(ORDERED_SUBDIRS)))) $(filter-out $(ORDERED_SUBDIRS),$(FIND_SUBDIRS))
#SUBDIRS ?= $(filter-out $(ORDERED_SUBDIRS),$(FIND_SUBDIRS))
#SUBDIRS ?= $(FIND_SUBDIRS)