[Scons-users] update dependency and signatures.dblite after biilding
Mats Wichmann
mats at wichmann.us
Fri Jun 6 10:47:23 EDT 2025
On 6/6/25 08:29, 于 wrote:
> Hi Bill,
>
> As what you said, ParseDepends Function will lead to unnecessary
> recompilations.
> I have use ParseDepends Function to parse dependencies, and then, I need
> two times to trace all the denpendencies.
> I want trace all the dependencies with one building. I think that serval
> steps can do it, but I don't know how to do it. So I ask for help form
> community.
> 1. build source files to .o;
> 2. parse dependencies from .d;
> 3. update dependencies of source files manuly;
> 4. build elf;
> I don't know how to implement the step 3, please experts help
> me, thsnks.
Do you have a setup which produces the .d files? Not sure where you are
in this process.
ParseDepends() isn't very smart, and what it does under the covers ends
up being just issuing as many Depends() calls as necessary - another
function we usually advise against using, because you're forcing the
issue rather than letting SCons build up its own dependency tree. This
is what happens in ParseDepends after it's done with the parsing part:
for target, depends in tdlist:
self.Depends(target, depends)
> My question is that could I update dependency and database manually
> after building?
The signature database is in a format that can't be edited, as it
consists of pickled internal objects. All you can do is include
Depends() calls in your build to instruct SCons - or make the scanner
work correctly for your use case.
Sorry for not quite understanding - what is the actual problem you're
trying to solve?
More information about the Scons-users
mailing list