Generating sources during buildworld

Brooks Davis brooks at freebsd.org
Wed Apr 26 15:51:56 UTC 2017


On Wed, Apr 26, 2017 at 11:40:10AM -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?

It the tool is a script then take a look at usr.bin/getaddrinfo/Makefile
(make sure it's from the tip of head, the initial version had rather
poor style.)

If the tool is a compiled program, then things get more complicated.  An
example of this is usr.bin/fortune/strfile/ and
usr.bin/fortune/datfiles/.  For a new program, you'd need to make your
tool a bootstrap tool in Makefile.inc1.

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20170426/158ea5c2/attachment.sig>


More information about the freebsd-hackers mailing list