From 9b82c6647431b4973ba4aa61f07927d586617ac1 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 6 Aug 2019 23:22:25 +0000 Subject: [PATCH] Fix LOCAL_MODULES and improve the make output. The exists() check guarding the invocation of ls was not working correctly as it was expanding '$L' to determine the path of the local modules directory. Fix by using {} around the variable name. Inline some of the logic from bsd.subdir.mk when invoking local module builds. This gives output in 'make buildkernel' the same as if there was a Makefile in /usr/local/sys/modules with SUBDIR = ${LOCAL_MODULES}. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D20991 --- sys/conf/kern.post.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index 010aef20919b..ff10daf1a0a5 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -61,7 +61,7 @@ LOCAL_MODULES_DIR?= ${LOCALBASE}/sys/modules # Default to installing all modules installed by ports unless overridden # by the user. -.if !defined(LOCAL_MODULES) && exists($LOCAL_MODULES_DIR) +.if !defined(LOCAL_MODULES) && exists(${LOCAL_MODULES_DIR}) LOCAL_MODULES!= ls ${LOCAL_MODULES_DIR} .endif .endif @@ -77,7 +77,9 @@ modules-${target}: ${target:S/^reinstall$/install/:S/^clobber$/cleandir/} .endif .for module in ${LOCAL_MODULES} - cd ${LOCAL_MODULES_DIR}/${module}; ${MKMODULESENV} ${MAKE} \ + @${ECHODIR} "===> ${module} (${target:S/^reinstall$/install/:S/^clobber$/cleandir/})" + @cd ${LOCAL_MODULES_DIR}/${module}; ${MKMODULESENV} ${MAKE} \ + DIRPRFX="${module}/" \ ${target:S/^reinstall$/install/:S/^clobber$/cleandir/} .endfor .endif