Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Feb 2017 21:48:12 +0000 (UTC)
From:      Rene Ladan <rene@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r434056 - head/Mk/Uses
Message-ID:  <201702132148.v1DLmCT9066713@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702132148.v1DLmCT9066713>