Skip to content Skip to sidebar Skip to footer

How To Force Scons To Generate Binary File With .bin Extension?

I have the following sconstruct import glob import os for file in glob.glob('*.cpp'): Program([file]) I am using this on a *nix platform so scons automatically generate execut

Solution 1:

The extension that gets appended to each created program is stored in the environment variable "PROGSUFFIX". You can override the default setting of "" under Posix systems with:

env = Environment()
env['PROGSUFFIX'] = '.bin'    # or env.Replace(PROGSUFFIX='.bin')
for file in Glob('*.cpp'):
    env.Program([file])

Note, how I don't use the Python glob.glob() here, but the SCons version Glob(). The latter has the advantage that it will find generated CPP files too, which might not exist yet physically.


Post a Comment for "How To Force Scons To Generate Binary File With .bin Extension?"