[Scons-users] Storing object files in different directory

Christopher Dimech dimech.christopher at gmail.com
Sat Oct 11 10:16:43 EDT 2014


Have tried the following but getting the same problem

scons -D -f botoh.sc

I know about variantDir, however I am unsure how to use it
for my case.

VariantDir('build', 'src')


I rather not use SConstruct at top level and have a build
directory.

On 11 October 2014 13:47, Christopher Dimech <dimech.christopher at gmail.com>
wrote:

> I have the following scons file
>
>
> path = ['/bin', '/usr/bin', '/home/cdim/Local/gcc-4.9.0/bin']
>
> env = Environment(
>          ENV = {'PATH' : path},
>          tools=['default','gfortran'],
>          FORTRANFLAGS='-ffree-form -g',
>          LINK='gfortran',
>          LINKFLAGS='-g'
>       )
>
> sources = ['../../lib/endian.f', '../../utils/botoh.f', ]
>
> allobjs = env.Object(sources)
>
> # Get rid of the .mod names
> objs = filter(lambda o: str(o)[-4:] != '.mod', allobjs)
>
> env.Program('botoh.x', objs)
>
>
> The .o files are being created at the location of the .f files.
>
> ../../lib/endian.o   and   ../../utils/botoh.o
>
>
> The .mod file for the fortran module ../../lib/endian.f
> and the executable botoh.x are being created in the
> directory where scons is being run
>
> This it the tree structure
>
> vik/build/sc/botoh.sc
> vik/lib/endian.f
> vik/utils/botoh.f
>
>
> This is how I run scons
>
> cd vik/build/sc
> scons -f botoh.sc
>
>
> I want that the object files are put in   *vik/build*   as well
>
> vik/build/
>
>
>
> --
> Christopher Dimech
>



-- 
Christopher Dimech
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20141011/858b310a/attachment.html>


More information about the Scons-users mailing list