svn commit: r434056 - head/Mk/Uses

Rene Ladan rene at FreeBSD.org
Mon Feb 13 21:48:13 UTC 2017


Author: rene
Date: Mon Feb 13 21:48:12 2017
New Revision: 434056
URL: https://svnweb.freebsd.org/changeset/ports/434056

Log:
  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 at gmail.com)

Modified:
  head/Mk/Uses/kmod.mk

Modified: head/Mk/Uses/kmod.mk
==============================================================================
--- head/Mk/Uses/kmod.mk	Mon Feb 13 21:28:45 2017	(r434055)
+++ head/Mk/Uses/kmod.mk	Mon Feb 13 21:48:12 2017	(r434056)
@@ -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
 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


More information about the svn-ports-all mailing list