[Scons-users] Let directory depend on file? (auto generated sources)

Jean Duthon duthon.jean at gmail.com
Wed Nov 26 07:47:07 EST 2014


Hi Stijn,

Did you tried to debug a bit (cf man scons debug && tree options) to see
what is going on.

IMO your env.Depends(autogen,'etc/mst.odl') is useless since you already
wrote that dep in autogen = env.Command(Dir('autogen'), 'etc/mst.odl',
'tools/build/installModel.sh with some args')

I created a really simple test :

env = Environment()

test = env.Command("output.txt","useless.txt","dir > $TARGET")

Everytime I change useless.txt, the command is executed.

So I guess there is something wrong with etc/mst.odl, are you sure the file
is modified?

Regards,
Jean.

2014-11-26 12:25 GMT+01:00 Stijn De Ruyck <Stijn.DeRuyck at onsemi.com>:

>  Hi,
>
>  Consider following situation:
> - directory "autogen" containing .cc files generated by installModel.sh
> script.
> - file "mst.odl" is used by installModel.sh to generate the autogen files.
> - contents of autogen can vary depending on mst.odl (in other words,
> resulting sources in autogen are not known in advance)
> - if scons sees a change in mst.odl, it must first call installModel.sh to
> repopulate the autogen directory, then continue with figuring out
> dependencies and building what's needed. (Other sources depend largely on
> the autogen files. So if autogen is modified, scons should automatically
> trigger a (near) complete rebuild anyway.)
>
>  In other words, the autogen directory depends on mst.odl.
>
>  How do I configure this?
>
>  What I had was this (not at the office right now, so code not 100%
> accurate):
>
>  SConstruct file:
> (...)
> autogen = env.Command(Dir('autogen'), 'etc/mst.odl',
> 'tools/build/installModel.sh with some args')
> sources.extend(Glob('autogen/*', strings=True))
> #variant dir call to SConscript, exporting env & sources
> (...)
>
>  SConscript file:
> (...)
> env.Program(some-exe, sources)
>
>  But changing mst.odl didn't call installModel...
> I tried adding
>
>  env.Depends(autogen, 'etc/mst.odl')
>
>  but that didn't help.
>
>  Does anyone have a suggestion for how to tackle this problem?
>
>  Thank you,
>
>  Stijn De Ruyck
>
>
>
>
>
> _______________________________________________
> 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/20141126/ee162090/attachment.html>


More information about the Scons-users mailing list