[Scons-users] Storing object files in different directory

Christopher Dimech dimech.christopher at gmail.com
Sat Oct 11 08:47:04 EDT 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20141011/c1ce3ef3/attachment.html>


More information about the Scons-users mailing list