Difference between revisions of "Using SCons"

From VDrift
Jump to: navigation, search
m (4 revisions: Import from old wiki (on 15 May 2012))
 
m (Update categories)
 
Line 1: Line 1:
{{update}}
 
 
 
[http://scons.org/ SCons] is a replacement for autotools written in Python.
 
[http://scons.org/ SCons] is a replacement for autotools written in Python.
  
Line 34: Line 32:
  
 
[[Category:Development]]
 
[[Category:Development]]
[[Category:Update]]
 

Latest revision as of 03:09, 1 September 2012

SCons is a replacement for autotools written in Python.

Note: Throughout the scons command will be used; if you are using scons-local that is distributed with VDrift you'll need to replace every instance of scons with ./scons.py.

Compile

To compile VDrift, simply run SCons. It reads the root level SCons configuration file, SConstruct, as well as the configuration files in subdirectories (called SConscript), when it is run to see what to do.

scons

SCons starts by checking your system for available libraries. If things go well, this will look something like this:

you@yourcomputer:~/games/vdrift$ scons
scons: Reading SConscript files ...
Checking for main() in C library GL... yes
Checking for main() in C library GLU... yes
Checking for main() in C library openal... yes
Checking for C++ header file SDL/SDL.h... yes
Checking for C++ header file SDL/SDL_image.h... yes
Checking for C++ header file SDL/SDL_net.h... yes
scons: done reading SConscript files.

Now, SCons will begin compiling VDrift, one file at a time, starting with the Vamos files and ending with linking the main executable. When changes to the source files are made, scons must be run again to update the build.

Clean

When building a project it is sometimes necessary to "clean" a build (remove all files produced by the build). This can be done with the -c flag:

scons -c

All the object and binary executable files will be removed. Then when you run scons again, all the files will be rebuilt.

Help

If you wish to list the options available at build time you may do so by executing scons -h. This will show all the available options, their default values, and their current values.

Quiet

If you want SCons to give less verbose output when compiling use the -Q option.