Roland Ver. 4.5 Informações Técnicas Página 122

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 212
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 121
112 GNU make
files are supposed to exist. See Section 10.2 [Catalogue of Built-In Rules], page 112, for a
catalogue of all the predefined implicit rules.
Above, we said an implicit rule applies if the required prerequisites “exist or can be
made”. A file “can be made” if it is mentioned explicitly in the makefile as a target or a
prerequisite, or if an implicit rule can be recursively found for how to make it. When an
implicit prerequisite is the result of another implicit rule, we say that chaining is occurring.
See Section 10.4 [Chains of Implicit Rules], page 117.
In general, make searches for an implicit rule for each target, and for each double-colon
rule, that has no recipe. A file that is mentioned only as a prerequisite is considered a
target whose rule specifies nothing, so implicit rule search happens for it. See Section 10.8
[Implicit Rule Search Algorithm], page 127, for the details of how the search is done.
Note that explicit prerequisites do not influence implicit rule search. For example, con-
sider this explicit rule:
foo.o: foo.p
The prerequisite on foo.p does not necessarily mean that make will remake foo.o according
to the implicit rule to make an object file, a .o file, from a Pascal source file, a .p file. For
example, if foo.c also exists, the implicit rule to make an object file from a C source file
is used instead, because it appears before the Pascal rule in the list of predefined implicit
rules (see Section 10.2 [Catalogue of Built-In Rules], page 112).
If you do not want an implicit rule to be used for a target that has no recipe, you can
give that target an empty recipe by writing a semicolon (see Section 5.9 [Defining Empty
Recipes], page 57).
10.2 Catalogue of Built-In Rules
Here is a catalogue of predefined implicit rules which are always available unless the
makefile explicitly overrides or cancels them. See Section 10.5.6 [Canceling Implicit
Rules], page 124, for information on canceling or overriding an implicit rule. The -r or
--no-builtin-rules option cancels all predefined rules.
This manual only documents the default rules available on POSIX-based operating sys-
tems. Other operating systems, such as VMS, Windows, OS/2, etc. may have different sets
of default rules. To see the full list of default rules and variables available in your version
of GNU make, run make -p in a directory with no makefile.
Not all of these rules will always be defined, even when the -r option is not given.
Many of the predefined implicit rules are implemented in make as suffix rules, so which
ones will be defined depends on the suffix list (the list of prerequisites of the special target
.SUFFIXES). The default suffix list is: .out, .a, .ln, .o, .c, .cc, .C, .cpp, .p, .f, .F, .m,
.r, .y, .l, .ym, .lm, .s, .S, .mod, .sym, .def, .h, .info, .dvi, .tex, .texinfo, .texi,
.txinfo, .w, .ch .web, .sh, .elc, .el. All of the implicit rules described below whose
prerequisites have one of these suffixes are actually suffix rules. If you modify the suffix list,
the only predefined suffix rules in effect will be those named by one or two of the suffixes
that are on the list you specify; rules whose suffixes fail to be on the list are disabled. See
Section 10.7 [Old-Fashioned Suffix Rules], page 125, for full details on suffix rules.
Compiling C programs
n.o is made automatically from n.c with a recipe of the form $(CC)
$(CPPFLAGS) $(CFLAGS) -c’.
Vista de página 121
1 2 ... 117 118 119 120 121 122 123 124 125 126 127 ... 211 212

Comentários a estes Manuais

Sem comentários