[Scons-users] Storing object files in different directory

Gary Oberbrunner garyo at oberbrunner.com
Sun Oct 12 12:24:34 EDT 2014


Glad you got it working!

On Sun, Oct 12, 2014 at 12:14 PM, Christopher Dimech
<dimech.christopher at gmail.com> wrote:
> Here is an SConstruct file that works with VariantDir
> to create the object files in a build directory. Main program
> is being built successfully.
>
>
> 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'
>       )
> env.VariantDir (variant_dir = 'build/lib', src_dir = 'lib', duplicate = 0)
> env.VariantDir (variant_dir = 'build/utils', src_dir = 'utils', duplicate =
> 0)
>
> sources = ['build/lib/endian.f', 'build/utils/botoh.f']
>
> # Constructs object files without the .mod
> allobjs = env.Object (sources)
> objs = filter(lambda o: str(o)[-4:] != '.mod', allobjs)
>
> env.Program (target = 'bin/botoh.x', source = objs)
>
>
>
> On 12 October 2014 13:19, Dirk Bächle <tshortik at gmx.de> wrote:
>>
>> On 12.10.2014 13:08, Christopher Dimech wrote:
>>>
>>> Have been trying to use a single SConstruct file
>>>
>>> Here is the code, can't understand what is going wrong
>>>
>> While waiting for the understanding to finally set in, you might want to
>> fill some time by reading the UserGuide and by looking at real build
>> examples...either at http://scons.org/wiki/SconsRecipes or
>> http://www.scons.org/wiki/SconsProjects . ;)
>>
>>
>> Dirk
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
>
>
> --
> Christopher Dimech
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>



-- 
Gary


More information about the Scons-users mailing list