From 1a2249ff0bd3ce88c50bf64a573874fbe75d6026 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Wed, 19 Apr 2023 16:58:06 +0100 Subject: include: add a check-ldirs target This target ensures all LDIRS, LSUBDIRS, and LSUBSUBDIRS actually exist. Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D39006 --- include/Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/Makefile b/include/Makefile index 24f2ed6c2a64..20d735394d9d 100644 --- a/include/Makefile +++ b/include/Makefile @@ -486,3 +486,16 @@ HOST_MACHINE_ARCH!= uname -p MACHINE:= ${HOST_MACHINE} MACHINE_ARCH:= ${HOST_MACHINE_ARCH} .endif + +check-ldirs: + missing_dirs=""; \ + for dir in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS}; do \ + if [ ! -d ${SRCTOP}/sys/$$dir ]; then \ + echo "${SRCTOP}/sys/$$dir"; \ + missing_dirs="$$missing_dirs $$dir"; \ + fi; \ + done; \ + if [ -n "$$missing_dirs" ]; then \ + echo "Nonexistant directories:" $$missing_dirs; \ + false; \ + fi -- cgit v1.2.3