[Scons-users] Dividing SConstruct code into set of aliases; no code called by default

Faheem Mitha faheem at faheem.info
Tue Oct 21 09:07:30 EDT 2014


Hi Dirk,

On Tue, 21 Oct 2014, Dirk Bächle wrote:

> from what you wrote here, I understand that you want to know how the
> "SCons way" of expressing this kind of build looks. So, the way the
> framework is designed and implemented you usually don't care about
> wrapping builders into blocks, that you then try to control
> yourself. You leave the decision about which sources changed, and
> therefore which targets need to be rebuilt, to SCons (after all,
> that's why you use a build system and don't write shell scripts,
> right?). You do this by simply specifying which environments and
> builders should get used for creating all your targets. And *all*
> means all here...

> Then, from this kind of "forest of target trees", you select the
> concrete outputs that you want to get compiled/created in this run
> by specifying their names as arguments on the command-line.

> If no dependencies have changed, SCons will detect that they're
> up-to-date...so they don't get rebuilt.

I see, so what I want to do is possibly not supported.

Ok. It seems I don't really gain anything from wrapping up collections
of builders info functions, so I've settled for having everything in
"global" namespace, and just pointing an Alias to a suitable
collection of objects, like so.

One question: is there a way to have scons default to help. so just
typing `scons` has the same result as `scons -h`?

Thanks.

                                                  Regards, Faheem Mitha

###################################################################################################
[...]
boost_python_env.Program(target='simann_ex', source=common+["simann_ex.cc"])
boost_python_env.SharedLibrary(target='corrmodel/cpplib', source=common+pif)
boost_python_env.SharedLibrary(target='score_test', source=["score_test.cc", "cpparr_conv_pif.cc"])
boost_python_env.Program(target="pval_test", source=["pval_test.cc"]+common+pif)
boost_python_env.Program(target="pval_stat", source=["pval_stat.cc"]+common+pif)
boost_python_env.Alias('bp', ['simann_ex', 'corrmodel/cpplib.so', 'pval_test', 'pval_stat'])

env = Environment()
env.Command(target="MANUAL.pdf", source="MANUAL", action="pandoc MANUAL -o MANUAL.pdf")
env.Alias('man', ['MANUAL.pdf'])
###################################################################################################


More information about the Scons-users mailing list