Generating sources during buildworld

Ian Lepore ian at freebsd.org
Wed Apr 26 17:01:45 UTC 2017


On Wed, 2017-04-26 at 11:40 -0400, Eric McCorkle wrote:
> I'm looking for some help with the build system, specifically how to
> generate sources for a library that will then be used to build the
> library.
> 
> Basically, I want to have a tool which collects public key
> certificates,
> then converts them into .c files which are used to build both loader
> and
> the kernel.
> 
> Knowing how LLVM works, it seems that this is possible; however, I've
> been unable to find documentation on how to write a makefile that
> accomplishes this.  Can someone point me to documentation or examples
> on
> how to do this?
> 
> 

There's a program named bin2c in contrib/binutils, but nothing seems to
use it.

There is also firmware(9) and the code in sys/conf/kmod.mk to convert
firmware blobs to loadable modules -- not exactly the problem you're
solving, but maybe close enough to cobble some ideas from.  Search for
occurrances of FIRMWS in kmod.mk.

-- Ian



More information about the freebsd-hackers mailing list