Builds a C source file given a lex (.l)
or yacc (.y) input file.
The suffix specified by the &cv-link-CFILESUFFIX; construction variable
(.c by default)
is automatically added to the target
if it is not already present.
Example:
# builds foo.c
env.CFile(target = 'foo.c', source = 'foo.l')
# builds bar.c
env.CFile(target = 'bar', source = 'bar.y')
Builds a C++ source file given a lex (.ll)
or yacc (.yy)
input file.
The suffix specified by the &cv-link-CXXFILESUFFIX; construction variable
(.cc by default)
is automatically added to the target
if it is not already present.
Example:
# builds foo.cc
env.CXXFile(target = 'foo.cc', source = 'foo.ll')
# builds bar.cc
env.CXXFile(target = 'bar', source = 'bar.yy')
A synonym for the
&b-StaticLibrary;
builder method.
On most systems,
this is the same as
&b-SharedLibrary;.
On Mac OS X (Darwin) platforms,
this creates a loadable module bundle.
A synonym for the
&b-StaticObject;
builder method.
Builds an executable given one or more object files
or C, C++, D, or Fortran source files.
If any C, C++, D or Fortran source files are specified,
then they will be automatically
compiled to object files using the
&b-Object;
builder method;
see that builder method's description for
a list of legal source file suffixes
and how they are interpreted.
The target executable file prefix
(specified by the &cv-link-PROGPREFIX; construction variable; nothing by default)
and suffix
(specified by the &cv-link-PROGSUFFIX; construction variable;
by default, .exe on Windows systems,
nothing on POSIX systems)
are automatically added to the target if not already present.
Example:
env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f'])
Builds a shared library
(.so on a POSIX system,
.dll on Windows)
given one or more object files
or C, C++, D or Fortran source files.
If any source files are given,
then they will be automatically
compiled to object files.
The static library prefix and suffix (if any)
are automatically added to the target.
The target library file prefix
(specified by the &cv-link-SHLIBPREFIX; construction variable;
by default, lib on POSIX systems,
nothing on Windows systems)
and suffix
(specified by the &cv-link-SHLIBSUFFIX; construction variable;
by default, .dll on Windows systems,
.so on POSIX systems)
are automatically added to the target if not already present.
Example:
env.SharedLibrary(target = 'bar', source = ['bar.c', 'foo.o'])
On Windows systems, the
&b-SharedLibrary;
builder method will always build an import
(.lib) library
in addition to the shared (.dll) library,
adding a .lib library with the same basename
if there is not already a .lib file explicitly
listed in the targets.
Any object files listed in the
source
must have been built for a shared library
(that is, using the
&b-SharedObject;
builder method).
&scons;
will raise an error if there is any mismatch.
On Windows systems, specifying
register=1
will cause the .dll to be
registered after it is built using REGSVR32.
The command that is run
("regsvr32" by default) is determined by &cv-link-REGSVR; construction
variable, and the flags passed are determined by &cv-link-REGSVRFLAGS;. By
default, &cv-link-REGSVRFLAGS; includes the option,
to prevent dialogs from popping
up and requiring user attention when it is run. If you change
&cv-link-REGSVRFLAGS;, be sure to include the option.
For example,
env.SharedLibrary(target = 'bar',
source = ['bar.cxx', 'foo.obj'],
register=1)
will register bar.dll as a COM object
when it is done linking it.
Builds an object file for
inclusion in a shared library.
Source files must have one of the same set of extensions
specified above for the
&b-StaticObject;
builder method.
On some platforms building a shared object requires additional
compiler option
(e.g. for gcc)
in addition to those needed to build a
normal (static) object, but on some platforms there is no difference between a
shared object and a normal (static) one. When there is a difference, SCons
will only allow shared objects to be linked into a shared library, and will
use a different suffix for shared objects. On platforms where there is no
difference, SCons will allow both normal (static)
and shared objects to be linked into a
shared library, and will use the same suffix for shared and normal
(static) objects.
The target object file prefix
(specified by the &cv-link-SHOBJPREFIX; construction variable;
by default, the same as &cv-link-OBJPREFIX;)
and suffix
(specified by the &cv-link-SHOBJSUFFIX; construction variable)
are automatically added to the target if not already present.
Examples:
env.SharedObject(target = 'ddd', source = 'ddd.c')
env.SharedObject(target = 'eee.o', source = 'eee.cpp')
env.SharedObject(target = 'fff.obj', source = 'fff.for')
Note that the source files will be scanned
according to the suffix mappings in the
SourceFileScanner
object.
See the section "Scanner Objects,"
below, for a more information.
Builds a static library given one or more object files
or C, C++, D or Fortran source files.
If any source files are given,
then they will be automatically
compiled to object files.
The static library prefix and suffix (if any)
are automatically added to the target.
The target library file prefix
(specified by the &cv-link-LIBPREFIX; construction variable;
by default, lib on POSIX systems,
nothing on Windows systems)
and suffix
(specified by the &cv-link-LIBSUFFIX; construction variable;
by default, .lib on Windows systems,
.a on POSIX systems)
are automatically added to the target if not already present.
Example:
env.StaticLibrary(target = 'bar', source = ['bar.c', 'foo.o'])
Any object files listed in the
source
must have been built for a static library
(that is, using the
&b-StaticObject;
builder method).
&scons;
will raise an error if there is any mismatch.
Builds a static object file
from one or more C, C++, D, or Fortran source files.
Source files must have one of the following extensions:
.asm assembly language file
.ASM assembly language file
.c C file
.C Windows: C file
POSIX: C++ file
.cc C++ file
.cpp C++ file
.cxx C++ file
.cxx C++ file
.c++ C++ file
.C++ C++ file
.d D file
.f Fortran file
.F Windows: Fortran file
POSIX: Fortran file + C pre-processor
.for Fortran file
.FOR Fortran file
.fpp Fortran file + C pre-processor
.FPP Fortran file + C pre-processor
.m Object C file
.mm Object C++ file
.s assembly language file
.S Windows: assembly language file
POSIX: assembly language file + C pre-processor
.spp assembly language file + C pre-processor
.SPP assembly language file + C pre-processor
The target object file prefix
(specified by the &cv-link-OBJPREFIX; construction variable; nothing by default)
and suffix
(specified by the &cv-link-OBJSUFFIX; construction variable;
.obj on Windows systems,
.o on POSIX systems)
are automatically added to the target if not already present.
Examples:
env.StaticObject(target = 'aaa', source = 'aaa.c')
env.StaticObject(target = 'bbb.o', source = 'bbb.c++')
env.StaticObject(target = 'ccc.obj', source = 'ccc.f')
Note that the source files will be scanned
according to the suffix mappings in
SourceFileScanner
object.
See the section "Scanner Objects,"
below, for a more information.
The version number of the C compiler.
This may or may not be set,
depending on the specific C compiler being used.
The suffix for C source files.
This is used by the internal CFile builder
when generating C files from Lex (.l) or YACC (.y) input files.
The default suffix, of course, is
.c
(lower case).
On case-insensitive systems (like Windows),
SCons also treats
.C
(upper case) files
as C files.
The version number of the C++ compiler.
This may or may not be set,
depending on the specific C++ compiler being used.
The suffix for C++ source files.
This is used by the internal CXXFile builder
when generating C++ files from Lex (.ll) or YACC (.yy) input files.
The default suffix is
.cc.
SCons also treats files with the suffixes
.cpp,
.cxx,
.c++,
and
.C++
as C++ files,
and files with
.mm
suffixes as Objective C++ files.
On case-sensitive systems (Linux, UNIX, and other POSIX-alikes),
SCons also treats
.C
(upper case) files
as C++ files.