Next: Directory Search Prev: Rule Syntax Up: Rules
Using Wildcard Characters in File Names
A single file name can specify many files using "wildcard
characters". The wildcard characters in `make' are `*', `?' and
`[...]', the same as in the Bourne shell. For example, `*.c' specifies
a list of all the files (in the working directory) whose names end in
The character `~' at the beginning of a file name also has special
significance. If alone, or followed by a slash, it represents your home
directory. For example `~/bin' expands to `/home/you/bin'. If the `~'
is followed by a word, the string represents the home directory of the
user named by that word. For example `~john/bin' expands to
Wildcard expansion happens automatically in targets, in dependencies,
and in commands (where the shell does the expansion). In other
contexts, wildcard expansion happens only if you request it explicitly
with the `wildcard' function.
The special significance of a wildcard character can be turned off by
preceding it with a backslash. Thus, `foo\*bar' would refer to a
specific file whose name consists of `foo', an asterisk, and `bar'.
- Wildcard Examples
- Several examples
- Wildcard Pitfall
- Problems to avoid.
- Wildcard Function
- How to cause wildcard expansion where
it does not normally take place.
automatically generated by info2www