Date: Mon, 21 Jul 2003 01:08:36 -0700 From: John-Mark Gurney <gurney_j@efn.org> To: arch@FreeBSD.org Subject: module opt_* building Message-ID: <20030721080836.GF917@funkthat.com>
next in thread | raw e-mail | index | archive | help
--dDRMvlgZJXvWKvBx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I recently realized that for kernel module building, we can simply create a symlink pointing to the opt_*.h file created by config. (See attached patch.) This only is part of the work. The problem is that the modules/Makefile's define a target, which needs to be overriden in the case of being built as part of the kernel, and left intact when building standalone. The only thing I can think of is to add a opt_xxx.h_def or something similar to the target in the modules/Makefile, and then add a dependancy on that target in the standalone case. I have thought about a way to automate building of these options. It'd require setting up a file with defaults to build from. Extending options files? Yet another place to list options doesn't seem like a good idea. Comments? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." --dDRMvlgZJXvWKvBx Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="conf.diff" Index: kern.pre.mk =================================================================== RCS file: /home/ncvs/src/sys/conf/kern.pre.mk,v retrieving revision 1.27 diff -u -r1.27 kern.pre.mk --- kern.pre.mk 2003/07/11 07:13:42 1.27 +++ kern.pre.mk 2003/07/21 08:01:25 @@ -87,7 +87,8 @@ # MKMODULESENV is set here so that port makefiles can augment # them. -MKMODULESENV= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR} +MKMODULESENV= MAKEOBJDIRPREFIX=${.OBJDIR}/modules MAKEOBJDIR=${.OBJDIR} \ + KMODDIR=${KODIR} .if (${KERN_IDENT} == LINT) MKMODULESENV+= ALL_MODULES=LINT .endif Index: kmod.mk =================================================================== RCS file: /home/ncvs/src/sys/conf/kmod.mk,v retrieving revision 1.137 diff -u -r1.137 kmod.mk --- kmod.mk 2003/03/03 22:51:22 1.137 +++ kmod.mk 2003/07/21 08:01:25 @@ -240,9 +240,15 @@ .for _src in ${SRCS:Mopt_*.h} CLEANFILES+= ${_src} +.if defined(MAKEOBJDIR) +${_src}: + rm ${.TARGET} && ln -s ${MAKEOBJDIR}/${.TARGET} +.else .if !target(${_src}) +# add code to generate opt_ file from conf. ${_src}: touch ${.TARGET} +.endif .endif .endfor --dDRMvlgZJXvWKvBx--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030721080836.GF917>