Proper way to determine place of system sources in makefile?

Ian Lepore freebsd at damnhippie.dyndns.org
Sun Jan 6 18:32:18 UTC 2013


On Sun, 2013-01-06 at 22:17 +0400, Lev Serebryakov wrote:
> Hello, Hackers.
> 
>  I'm  writing  some code, which is built outside of system sources but
> depends on them.
> 
>  I'm using FreeBSD mk infrastructure.
> 
>  When code is kernel module (uses <bsd.kmod.mk>) here is SYSDIR
> variable.
> 
>   But which is proper way to refer to system sources when makefile is
> prepared for shared library (<bsd.lib.mk>) or program (<bsd.prog.mk>)?
> 

That may depend on what you mean by "system sources."  In particular,
some header files which are generated during the build don't live
under /usr/src/sys, they're in $OBJDIR/sys/<kernconf>/.  I was
struggling with how to include such a file (in a non-hacky way) while
building a bootloader from sys/boot/arm the other day, and I never did
come up with a clean answer.  (I do understand why -- the header files I
wanted have content that changes based on KERNCONF=, and sys/boot is
built during buildworld, not buildkernel.)

-- Ian




More information about the freebsd-hackers mailing list