[Scons-users] Storing object files in different directory

Gary Oberbrunner garyo at oberbrunner.com
Sat Oct 11 12:10:37 EDT 2014


On Sat, Oct 11, 2014 at 11:02 AM, Christopher Dimech
<dimech.christopher at gmail.com> wrote:
> The problem I have is that I have two source directories,
> lib and utils. The directory utils is where the main program
> resides, lib is where the other fortran files exist. Where should
> the SConscript file reside?

Above both of those (i.e. vik/SConstruct)

>> I can use an SConscript file, however I want to name it
>> as I wish.

That's fine.  In the SConscript() call in your SConstruct, you can
call the SConscript any name you like.  Typically you'd have one
SConscript per sub-project or dir, like lib/SConscript and
utils/SConscript (but lib/lib.sc and utils.utils.sc would also be OK,
just use the right name when you call SConscript()).

Your SConstruct could look something like this:

  env=Environment(...)
  Export('env')
  SConscript('lib/lib.sc', build_dir = 'build/lib')
  SConscript('utils/utils.sc', build_dir='build/utils')

Then your SConscripts can look like:
  Import('env')
  prog1=env.Program(...)
  env.Install('#', prog1) # install prog1 at top level

-- 
Gary


More information about the Scons-users mailing list