Chapter 10: Using Implicit Rules 115
Texinfo and Info
n.dvi is made from n.texinfo, n.texi, or n.txinfo, with the recipe
‘$(TEXI2DVI) $(TEXI2DVI_FLAGS)’. n.info is made from n.texinfo, n.texi,
or n.txinfo, with the recipe ‘$(MAKEINFO) $(MAKEINFO_FLAGS)’.
RCS Any file n is extracted if necessary from an RCS file named either n,v or
RCS/n,v. The precise recipe used is ‘$(CO) $(COFLAGS)’. n will not be ex-
tracted from RCS if it already exists, even if the RCS file is newer. The
rules for RCS are terminal (see Section 10.5.5 [Match-Anything Pattern Rules],
page 123), so RCS files cannot be generated from another source; they must
actually exist.
SCCS Any file n is extracted if necessary from an SCCS file named either s.n or
SCCS/s.n. The precise recipe used is ‘$(GET) $(GFLAGS)’. The rules for SCCS
are terminal (see Section 10.5.5 [Match-Anything Pattern Rules], page 123), so
SCCS files cannot be generated from another source; they must actually exist.
For the benefit of SCCS, a file n is copied from n.sh and made executable
(by everyone). This is for shell scripts that are checked into SCCS. Since RCS
preserves the execution permission of a file, you do not need to use this feature
with RCS.
We recommend that you avoid using of SCCS. RCS is widely held to be superior,
and is also free. By choosing free software in place of comparable (or inferior)
proprietary software, you support the free software movement.
Usually, you want to change only the variables listed in the table above, which are
documented in the following section.
However, the recipes in built-in implicit rules actually use variables such as COMPILE.c,
LINK.p, and PREPROCESS.S, whose values contain the recipes listed above.
make follows the convention that the rule to compile a .x source file uses the variable
COMPILE.x. Similarly, the rule to produce an executable from a .x file uses LINK.x; and
the rule to preprocess a .x file uses PREPROCESS.x.
Every rule that produces an object file uses the variable OUTPUT_OPTION. make defines
this variable either to contain ‘-o $@’, or to be empty, depending on a compile-time option.
You need the ‘-o’ option to ensure that the output goes into the right file when the source
file is in a different directory, as when using VPATH (see Section 4.4 [Directory Search],
page 25). However, compilers on some systems do not accept a ‘-o’ switch for object files.
If you use such a system, and use VPATH, some compilations will put their output in the
wrong place. A possible workaround for this problem is to give OUTPUT_OPTION the value
‘; mv $*.o $@’.
10.3 Variables Used by Implicit Rules
The recipes in built-in implicit rules make liberal use of certain predefined variables. You
can alter the values of these variables in the makefile, with arguments to make, or in the en-
vironment to alter how the implicit rules work without redefining the rules themselves. You
can cancel all variables used by implicit rules with the ‘-R’ or ‘--no-builtin-variables’
option.
Comentarios a estos manuales