[Scons-users] Code generation in SCons

Bill Deegan bill at baddogconsulting.com
Thu Apr 23 14:59:57 EDT 2020


Erik,

Please take a look at the yacc builder.

It has similar functionality in that it reads a source file and spits out
.c and .h files.
SCons is fully capable of "doing the right thing" in such cases if the
builder is properly constructed.

-Bill

On Thu, Apr 23, 2020 at 7:42 AM Mats Wichmann <mats at wichmann.us> wrote:

> Someone else will hopefully help... this is the sort of thing I *believe*
> Depends() was intended for. And emitters. Also, there's a protobuf builder
> or two floating around somewhere if that helps (see the wiki)
>
> On April 23, 2020 7:49:05 AM MDT, Erik Kazandjian <
> erik.kazandjian at gmail.com> wrote:
>>
>> I start from a YANG file. From that file I create proto fiels for Google
>> protobuf and heade files. These files are than given to 'standard' builders
>> who generate libraries out of them. But as said before because these proto
>> files and C files (both .c and .h) get generated SCons can not pick them up
>> the first time as they are not there, the second time he considers them to
>> have changed only the thirds time Scons sees that the files are
>> identical and doesn't build them any longer. Is there a way to recalculate
>> the md5 database after building ?
>>
>> On Thu, 23 Apr 2020 at 15:14, Mats Wichmann <mats at wichmann.us> wrote:
>>
>>> On 4/23/20 2:21 AM, Erik Kazandjian wrote:
>>> > Hi,
>>> >
>>> > I've created a builder that generates C code nad header files from a
>>> > yang file. The problem I'm having is the first I build these c and h
>>> > files are not there so scons rebuilds them , but than the second time
>>> > when I build scons decides that the C and header files have changes and
>>> > so it rebuilds again generating the exact same c and h file, do only
>>> the
>>> > third time it builds it decide bot to rebuild anything. Is there a way
>>> > in scons to get around this or do I have to write a custom decider
>>> myself ?
>>>
>>> Since there's existing practice (lex, swig and yacc included with SCons
>>> itself as well as external efforts), there should be a way to get it to
>>> work. Perhaps if you share what you're doing?  There is a bit of
>>> plumbing to get hooked up.
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20200423/099bec67/attachment.html>


More information about the Scons-users mailing list