Program builder is only one of
many builders (also called a builder method)
that SCons provides to build different types of files.
Another is the
Object builder method,
which tells SCons to build an object file
from the specified source file:
Now when you run the scons command to build the program,
it will build just the
hello.o object file on a POSIX system:
sconsscons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... cc -o hello.o -c hello.c scons: done building targets.
And just the
hello.obj object file
on a Windows system (with the Microsoft Visual C++ compiler):
sconsscons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... cl /Fohello.obj /c hello.c /nologo scons: done building targets.
(Note that this guide will not continue to provide duplicate side-by-side POSIX and Windows output for all of the examples. Just keep in mind that, unless otherwise specified, any of the examples should work equally well on both types of systems.)