aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorRene Ladan <rene@FreeBSD.org>2017-02-14 05:48:12 +0800
committerRene Ladan <rene@FreeBSD.org>2017-02-14 05:48:12 +0800
commit9089de1bb11f1a534d5b5130861ab863f4098730 (patch)
treee7e01a77c4c9dca41e4df28dfdfae8429b36efb2 /Mk
parent2e9e2e47698e03b1aa0dae20d3e8bd3fbe211cad (diff)
downloadfreebsd-ports-gnome-9089de1bb11f1a534d5b5130861ab863f4098730.tar.gz
freebsd-ports-gnome-9089de1bb11f1a534d5b5130861ab863f4098730.tar.zst
freebsd-ports-gnome-9089de1bb11f1a534d5b5130861ab863f4098730.zip
Automatically generate @dir entries for package list if :debug is used.
Tested with a modified sysutils/biosfont in which the :debug option was added, a file was installed into ${KERN_DEBUGDIR}/${KMODDIR} and that file was added to pkg-plist. PR: 216879 (inspired by) Submitted by: Sergey Kozlov (kozlov.sergey.404@gmail.com)
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/kmod.mk23
1 files changed, 21 insertions, 2 deletions
diff --git a/Mk/Uses/kmod.mk b/Mk/Uses/kmod.mk
index e0afbb66f01a..b8f3563bb40d 100644
--- a/Mk/Uses/kmod.mk
+++ b/Mk/Uses/kmod.mk
@@ -33,6 +33,25 @@ KMODDIR?= /boot/modules
.if ${KMODDIR} == /boot/kernel
KMODDIR= /boot/modules
.endif
+
+_DEBUG_KMOD_SH= \
+${ECHO_CMD} -n "\"@dir /%%KERN_DEBUGDIR%%/%%KMODDIR%%\"" ; \
+skd=`${ECHO_CMD} ${KMODDIR} | ${SED} "s,/, ,g"` ; \
+l=`${ECHO_CMD} $$skd | wc -w` ; \
+while [ $$l -gt 0 ] ; do \
+ c=0 ; \
+ r="" ; \
+ for p in $$skd ; do \
+ c=$$(($$c+1)) ; \
+ if [ $$c -eq $$l ] ; then \
+ break ; \
+ fi ; \
+ r="$$r/$$p" ; \
+ done ; \
+ ${ECHO_CMD} -n " \"@dir /%%KERN_DEBUGDIR%%$$r\"" ; \
+ l=$$(($$l-1)) ; \
+done
+
PLIST_SUB+= KMODDIR="${KMODDIR:C,^/,,}"
MAKE_ENV+= KMODDIR="${KMODDIR}" SYSDIR="${SRC_BASE}/sys" NO_XREF=yes
PLIST_FILES+= "@kld ${KMODDIR}"
@@ -42,8 +61,8 @@ STRIP_CMD+= --strip-debug # do not strip kernel symbols
KERN_DEBUGDIR?= ${DEBUGDIR}
PLIST_SUB+= KERN_DEBUGDIR="${KERN_DEBUGDIR:C,^/,,}"
MAKE_ENV+= KERN_DEBUGDIR="${KERN_DEBUGDIR}"
-#XXX (rene): it would be nice to automatically add @dir entries here,
-# they are somehow needed according to 'make makeplist'
+_KMOD_DIRS!= ${_DEBUG_KMOD_SH}
+PLIST_FILES+= ${_KMOD_DIRS}
.endif
.endif