git: 5ae6cc00111c - main - test-includes: Simplify $OBJDIR requirements

From: Warner Losh <imp_at_FreeBSD.org>
Date: Wed, 09 Feb 2022 00:24:19 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=5ae6cc00111c9a9bc70f6fc9db25bd191c069433

commit 5ae6cc00111c9a9bc70f6fc9db25bd191c069433
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-02-09 00:23:31 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-02-09 00:23:43 +0000

    test-includes: Simplify $OBJDIR requirements
    
    s=/=_=g in tested names so that all the objects live in $OBJDIR. This is
    more robust than depending on side effects of auto OBJDIR features and
    should fix buildworld issues some people have seen.
    
    Suggested by:   sjg@
    Sponsored by:   Netflix
---
 tools/build/test-includes/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/build/test-includes/Makefile b/tools/build/test-includes/Makefile
index 3ae39a2cb61f..707ab6f4ca47 100644
--- a/tools/build/test-includes/Makefile
+++ b/tools/build/test-includes/Makefile
@@ -24,11 +24,11 @@ CFLAGS.event.c=	-D_WANT_KEVENT32 -D_WANT_FREEBSD11_KEVENT
 
 .include "badfiles.inc"
 
-.for h in ${HDRS}
+.for h c in ${HDRS:@x@$x ${x:S,/,_,g:R}.c@}
 .if !${BADHDRS:M${h}}
-SRCS+=	${h:R}.c
-CLEANFILES+=${h:R}.c
-${h:R}.c:
+SRCS+= $c
+CLEANFILES+=$c
+$c:
 	echo "#include <$h>" > ${.TARGET}
 .endif
 .endfor