Roland Ver. 4.5 Technical Information Seite 30

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 212
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 29
20 GNU make
tively. In the third they will have values foo.1, foo.1 bar.1 foo.2 bar.2, and foo.1
bar.1 foo.2 bar.2 foo.1 foo.1 bar.1 foo.1 bar.1 respectively.
Rules undergo secondary expansion in makefile order, except that the rule with the
recipe is always evaluated last.
The variables $$? and $$* are not available and expand to the empty string.
Secondary Expansion of Static Pattern Rules
Rules for secondary expansion of static pattern rules are identical to those for explicit rules,
above, with one exception: for static pattern rules the $$* variable is set to the pattern
stem. As with explicit rules, $$? is not available and expands to the empty string.
Secondary Expansion of Implicit Rules
As make searches for an implicit rule, it substitutes the stem and then performs secondary
expansion for every rule with a matching target pattern. The value of the automatic vari-
ables is derived in the same fashion as for static pattern rules. As an example:
.SECONDEXPANSION:
foo: bar
foo foz: fo%: bo%
%oo: $$< $$^ $$+ $$*
When the implicit rule is tried for target foo, $$< expands to bar, $$^ expands to bar
boo, $$+ also expands to bar boo, and $$* expands to f.
Note that the directory prefix (D), as described in Section 10.8 [Implicit Rule Search
Algorithm], page 127, is appended (after expansion) to all the patterns in the prerequisites
list. As an example:
.SECONDEXPANSION:
/tmp/foo.o:
%.o: $$(addsuffix /%.c,foo bar) foo.h
@echo $^
The prerequisite list printed, after the secondary expansion and directory prefix recon-
struction, will be /tmp/foo/foo.c /tmp/bar/foo.c foo.h. If you are not interested in this
reconstruction, you can use $$* instead of % in the prerequisites list.
Seitenansicht 29
1 2 ... 25 26 27 28 29 30 31 32 33 34 35 ... 211 212

Kommentare zu diesen Handbüchern

Keine Kommentare