When no explicit rule is defined for a target, the Make program must use other means to determine how to make the target up-to-date. Rules of inference are defined by pattern rules. An example of a double pattern rule is:
%.o: %.c $(CC) -c $(CFLAGS) -o $@ $<
The above suffix rule defines how to make any target with a filename ending in .o if there is a corresponding dependent filename that ends in .c. The commands associated with a pattern rule are executed if the dependent file is newer than the target file, which matches the pattern. The % character matches any number of characters in the target name. Only one such wildcard character may exist per name.
There may be only one dependent in a pattern rule (extra dependents given on the line are ignored). The % character in the dependency pattern is replaced with the stem (the sequence of characters which were matched by the %) from the target name.
A single pattern rule of the form:
%.Z: compress $*
is the same as a double pattern rule, except that there is no dependency pattern. As a result, the automatic variable $< is not defined in the scope of a single suffix rule. Since there are no dependencies, any target matching a single suffix rule will always be remade; the commands will always be executed.
There may be more than one pattern rule applicable per target name. The first matching pattern rule will have priority. If several pattern rules are defined with the same target pattern, then the pattern rule that was defined earlier will have priority over all later definitions. Thus, pattern rules with the same target but different dependencies can be defined in natural prioritized order; the first one defined will be the first one applied to inference rules.
However, if a new definition is given that exactly duplicates both the target pattern and the dependency pattern then the new definition will replace the old pattern rule.