[Scons-users] dep defintions

Bill Deegan bill at baddogconsulting.com
Sat Jun 13 17:16:22 EDT 2020


So you want to run make and have scons know about the sources and targets
it uses/creates?
Or something else?

really a small reproducer is the best way to show what you're trying todo.

On Sat, Jun 13, 2020 at 12:48 PM daggs <daggs at gmx.com> wrote:

> I think I've found my issue, $T/consts/asm-code/consts.asm is created by a
> binary, that binary is created by a custom make builder I wrote.
> from what can see, the exeucution of the binary isn't called nor it's
> creation.
> what is the proper way to preform the build, execution and attachment to
> an existing target as dep?
>
>
> *Sent:* Saturday, June 13, 2020 at 12:10 AM
> *From:* "daggs" <daggs at gmx.com>
> *To:* scons-users at scons.org
> *Cc:* "SCons users mailing list" <scons-users at scons.org>
> *Subject:* Re: [Scons-users] dep defintions
> I'll try to provide a reproduction example
>
>
> *Sent:* Friday, June 12, 2020 at 11:57 PM
> *From:* "Bill Deegan" <bill at baddogconsulting.com>
> *To:* "SCons users mailing list" <scons-users at scons.org>
> *Subject:* Re: [Scons-users] dep defintions
> It would really be ideal if you could provide a small reproducer.
>
> That said if the syntax is "include xyz.asm", writing a scanner would be
> trivial.
> If you build a proper builder (which could also be trivial), then your
> need for depends (and possibly symlink) could be negated.
>
> -Bill
>
> On Fri, Jun 12, 2020 at 1:42 PM daggs <daggs at gmx.com> wrote:
>
>> Greetings,
>>
>> when I run the build, I see the symlink print for code.asm, I do not
>> however see the symlink print of const.asm.
>> as you can see in the tree snippet below, there are two entries for
>> output/debug/build/asm-code/consts.asm, one standalone and another under
>> output/debug/build/asm-code/code.asm. is that expected?
>>
>> I welcome critique in order to improve my code.
>> $T/consts/asm-code/consts.asm is generated by a bin called before the
>> symlink, I can see the excution print before, it runs the script and
>> creates a file named .defs_generated in the same path.
>>
>> the tree below tells the same story, output/debug/target/consts/.defs_generated
>> and output/debug/target/consts/asm-code/consts.asm are deps of
>> output/debug/build/asm-code/consts.asm
>>
>> not sure how the compiler is relevant to the links part, also, can you
>> explain what you mean by saying "carefully placing include directives"
>>
>> Thanks.
>>
>> *Sent:* Friday, June 12, 2020 at 11:23 PM
>> *From:* "Hans-Christian Wild" <hchr.wild at gmail.com>
>> *To:* "SCons users mailing list" <scons-users at scons.org>
>> *Subject:* Re: [Scons-users] dep defintions
>> Hi, in parallel to all general constructive critique about your approach,
>> the provided code sample should work, given that you tell scons where the
>> following can be picked from:
>>
>> '$T/consts/asm-code/consts.asm'
>>
>> SCons tells you that it is not there and that it does not know how to
>> produce it. Given that I assume that the problem does not reside within the
>> code snippet that you have provided...
>>
>> Looking a bit deeper, I would be curious to learn what your compiler is
>> and why you can't resolve your "symlink" problem by carefully placing
>> include directives.
>>
>> On Fri, Jun 12, 2020 at 8:42 PM daggs <daggs at gmx.com> wrote:
>>
>>> include consts.asm
>>>
>>> I'd figured it would be better than have a placeholder in the from of
>>> %%PATH%%/consts.asm and then use cat code.asm | sed 's/%%PATH%%/g' >
>>> output/debug/build/asm-code/code.asm
>>>
>>>
>>> *Sent:* Friday, June 12, 2020 at 9:34 PM
>>> *From:* "Bill Deegan" <bill at baddogconsulting.com>
>>> *To:* "SCons users mailing list" <scons-users at scons.org>
>>> *Subject:* Re: [Scons-users] dep defintions
>>> You really need to create a scanner then..
>>> That'd be the best way to go about this.
>>>
>>> What's the include statement look like?
>>>
>>> -Bill
>>>
>>> On Fri, Jun 12, 2020 at 11:11 AM daggs <daggs at gmx.com> wrote:
>>>
>>>> Greetings Bill.
>>>>
>>>> I think my original explenation was too implicit, I'll elaborate,
>>>> code.asm includes consts.asm, this means that if code.asm or consts.asm
>>>> doesn't exists in $O/asm-code at the time code.bin is generated, the
>>>> StaticObject call will fail.
>>>>
>>>> that is why I've tried to use depends as I didn't know how to make sure
>>>> that the link will exist prior to code.bin's generation.
>>>> that is what I'm trying to do (unsuccessfully)
>>>>
>>>> T is defined at that point, no need to worry about it,
>>>>
>>>> *Sent:* Friday, June 12, 2020 at 6:57 PM
>>>> *From:* "Bill Deegan" <bill at baddogconsulting.com>
>>>> *To:* "SCons users mailing list" <scons-users at scons.org>
>>>> *Subject:* Re: [Scons-users] dep defintions
>>>> asm_work_dir = '$O/asm-code'
>>>> asm_src_link = env.Command('$O/asm-code/code.asm',
>>>> '#/asm-code/code.asm', symlink)
>>>> asm_const_link = env.Command('$O/asm-code/consts.asm',
>>>> '$T/consts/asm-code/consts.asm', symlink)
>>>>
>>>> # Why do this at all? The command above should do this
>>>> x=env.Depends(asm_const_link, '$T/consts/asm-code/consts.asm')
>>>>
>>>> # not sure what you're trying to accomplish here?  would y =
>>>> asm_const_link?
>>>> env.Depends(asm_src_link, y)
>>>>
>>>> # is T defined by this point? if so
>>>> # My mantra is if you have to use Depends() a good chance either you
>>>> don't understand something or your doing something wrong (or both).
>>>>
>>>> env.StaticObject('$T/code.bin', asm_src_link)
>>>>
>>>> Remove the depends. see if it does the right thing and check the
>>>> --tree=prune
>>>>
>>>>
>>>> On Fri, Jun 12, 2020 at 6:27 AM daggs <daggs at gmx.com> wrote:
>>>>
>>>>> Greetings,
>>>>>
>>>>> I'm trying to create a static object based on links but for some
>>>>> reason one of the links fails to get created, here is the code:
>>>>>
>>>>> asm_work_dir = env['O'] + '/asm-code'
>>>>> asm_src_link = env.Command(asm_work_dir + '/code.asm',
>>>>> '#/asm-code/code.asm', symlink)
>>>>> asm_const_link = env.Command(asm_work_dir + '/consts.asm', env['T'] +
>>>>> '/consts/asm-code/consts.asm', symlink)
>>>>> env.Depends(asm_src_link, env.Depends(asm_const_link, env['T'] +
>>>>> '/consts/asm-code/consts.asm'))
>>>>>
>>>>> env.StaticObject(env['T'] + '/code.bin', asm_src_link)
>>>>>
>>>>> when I run it, I get this error:
>>>>> scons: *** [output/debug/build/asm-code/consts.asm] Source
>>>>> `output/debug/target/consts/asm-code/consts.asm' not found, needed by
>>>>> target `output/debug/build/asm-code/consts.asm'.
>>>>>
>>>>> adding --tree=prune produces this tree:
>>>>> |   | +-output/debug/build/asm-code
>>>>> |   | | +-output/debug/build/asm-code/code.asm
>>>>> |   | | | +-asm-code/code.asm
>>>>> |   | | | +-output/debug/build/asm-code/consts.asm
>>>>> |   | | |   +-output/debug/target/consts/asm-code/consts.asm
>>>>> |   | | |   +-output/debug/target/consts/.defs_generated
>>>>> |   | | +-[output/debug/build/asm-code/consts.asm]
>>>>>
>>>>> what I want to do is to create both links and then run te static
>>>>> object.
>>>>>
>>>>> what am I doing wrong?
>>>>>
>>>>> Thanks.
>>>>> _______________________________________________
>>>>> Scons-users mailing list
>>>>> Scons-users at scons.org
>>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>
>>>> _______________________________________________ Scons-users mailing
>>>> list Scons-users at scons.org
>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>> _______________________________________________
>>>> Scons-users mailing list
>>>> Scons-users at scons.org
>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>> _______________________________________________ Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>> _______________________________________________ Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
> _______________________________________________ Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
> _______________________________________________ Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
> _______________________________________________
> 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/20200613/9abc2db3/attachment.html>


More information about the Scons-users mailing list