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

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 212
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 131
122 GNU make
Of the variables listed above, four have values that are single file names, and three have
values that are lists of file names. These seven have variants that get just the file’s directory
name or just the file name within the directory. The variant variables’ names are formed
by appending D or F’, respectively. These variants are semi-obsolete in GNU make since
the functions dir and notdir can be used to get a similar effect (see Section 8.3 [Functions
for File Names], page 87). Note, however, that the D variants all omit the trailing slash
which always appears in the output of the dir function. Here is a table of the variants:
$(@D) The directory part of the file name of the target, with the trailing slash removed.
If the value of $@’ is dir/foo.o then ‘$(@D)’ is dir. This value is . if ‘$@’ does
not contain a slash.
$(@F) The file-within-directory part of the file name of the target. If the value of $@
is dir/foo.o then $(@F) is foo.o. $(@F) is equivalent to $(notdir $@)’.
$(*D)
$(*F) The directory part and the file-within-directory part of the stem; dir and foo
in this example.
$(%D)
$(%F) The directory part and the file-within-directory part of the target archive mem-
ber name. This makes sense only for archive member targets of the form
archive(member) and is useful only when member may contain a directory
name. (See Section 11.1 [Archive Members as Targets], page 129.)
$(<D)
$(<F) The directory part and the file-within-directory part of the first prerequisite.
$(^D)
$(^F) Lists of the directory parts and the file-within-directory parts of all prerequi-
sites.
$(+D)
$(+F) Lists of the directory parts and the file-within-directory parts of all prerequi-
sites, including multiple instances of duplicated prerequisites.
$(?D)
$(?F) Lists of the directory parts and the file-within-directory parts of all prerequisites
that are newer than the target.
Note that we use a special stylistic convention when we talk about these automatic
variables; we write “the value of $<’”, rather than “the variable < as we would write
for ordinary variables such as objects and CFLAGS. We think this convention looks more
natural in this special case. Please do not assume it has a deep significance; $< refers to
the variable named < just as $(CFLAGS) refers to the variable named CFLAGS. You could
just as well use $(<) in place of $<’.
10.5.4 How Patterns Match
A target pattern is composed of a % between a prefix and a suffix, either or both of which
may be empty. The pattern matches a file name only if the file name starts with the prefix
and ends with the suffix, without overlap. The text between the prefix and the suffix is
called the stem. Thus, when the pattern %.o matches the file name test.o, the stem is
Vista de página 131
1 2 ... 127 128 129 130 131 132 133 134 135 136 137 ... 211 212

Comentários a estes Manuais

Sem comentários