Comments requested on adding ports modules to kernel build

M. Warner Losh imp at bsdimp.com
Mon Nov 8 11:39:00 PST 2004


I've been using the following for a while to automatically rebuild and
install a kernel module on one of my machines.  I think this is
useful in general and would like to commit it.

Comments?

Warner



diff --exclude CVS -I\$Revision -I\$Id -I\$Header -I \$FreeBSD -ur /shadow/imp/F
reeBSD/src/sys/conf/kern.post.mk /shadow/imp/p4/src/sys/conf/kern.post.mk
--- /shadow/imp/FreeBSD/src/sys/conf/kern.post.mk       Thu Oct  7 23:46:20 2004
+++ /shadow/imp/p4/src/sys/conf/kern.post.mk    Sat Nov  6 12:29:02 2004
@@ -26,6 +26,19 @@
 	    ${target:S/^reinstall$/install/:S/^clobber$/cleandir/}
 .endif
 .endfor
+# Handle out of tree ports
+.if defined(PORTS_MODULES)
+.if defined(SYSDIR)
+PORTSMODULESENV=SYSDIR=${SYSDIR}
+.endif
+.for target in all install clean
+${target}: ports-${target}
+ports-${target}:
+.for __i in ${PORTS_MODULES}
+       cd /usr/ports/${__i}; ${PORTSMODULESENV} ${MAKE} ${target}
+.endfor
+.endfor
+.endif
 
 .ORDER: kernel-install modules-install
 


More information about the freebsd-arch mailing list