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

Stijn De Ruyck Stijn.DeRuyck at onsemi.com
Wed Nov 26 06:25:00 EST 2014


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




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20141126/b2442843/attachment.html>


More information about the Scons-users mailing list