You can also use the Glob
function to find all files matching a
certain template, using the standard shell pattern matching
characters *
(to match everything),
?
(to match a single character)
and [abc]
to match any of
a
, b
or c
.
[!abc]
is also supported,
to match any character except
a
, b
or c
.
This makes many multi-source-file builds quite easy:
Program('program', Glob('*.c'))
Glob
has powerful capabilities - it matches even if the
file does not exist, but SCons can determine that it would
exist after a build.
You will meet it again reading about
variant directories
(see Chapter 15, Separating Source and Build Trees: Variant Directories)
and repositories
(see Chapter 16, Building From Code Repositories).