3.3. Making a list of files with `Glob`
Prev | Chapter 3. Less Simple Things to Do With Builds | Next

## 3.3. Making a list of files with `Glob`

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 currently 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).

Prev | Up | Next
3.2. Compiling Multiple Source Files | Home | 3.4. Specifying Single Files Vs. Lists of Files