From owner-freebsd-hackers@freebsd.org Wed Apr 26 17:01:45 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6C3BD51884 for ; Wed, 26 Apr 2017 17:01:45 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B5A39BC for ; Wed, 26 Apr 2017 17:01:45 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: ea88ebfc-2aa1-11e7-8c46-c35e37f62db1 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id ea88ebfc-2aa1-11e7-8c46-c35e37f62db1; Wed, 26 Apr 2017 17:00:57 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v3QH1bZQ001541; Wed, 26 Apr 2017 11:01:37 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1493226097.1195.1.camel@freebsd.org> Subject: Re: Generating sources during buildworld From: Ian Lepore To: Eric McCorkle , "freebsd-hackers@freebsd.org" Date: Wed, 26 Apr 2017 11:01:37 -0600 In-Reply-To: <3f63e99c-9241-380d-2e3a-12ef6a5a2758@metricspace.net> References: <3f63e99c-9241-380d-2e3a-12ef6a5a2758@metricspace.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Apr 2017 17:01:45 -0000 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