Roland Ver. 4.5 Informations techniques Page 141

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 212
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 140
Chapter 11: Using make to Update Archive Files 131
(see Section 11.2 [Archive Update], page 129). But they are retained for compatibility with
other makes.
To write a suffix rule for archives, you simply write a suffix rule using the target suffix
.a (the usual suffix for archive files). For example, here is the old-fashioned suffix rule to
update a library archive from C source files:
.c.a:
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $*.o
$(AR) r $@ $*.o
$(RM) $*.o
This works just as if you had written the pattern rule:
(%.o): %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $*.o
$(AR) r $@ $*.o
$(RM) $*.o
In fact, this is just what make does when it sees a suffix rule with .a as the target
suffix. Any double-suffix rule .x.a is converted to a pattern rule with the target pattern
(%.o) and a prerequisite pattern of %.x’.
Since you might want to use .a as the suffix for some other kind of file, make also
converts archive suffix rules to pattern rules in the normal way (see Section 10.7 [Suffix
Rules], page 125). Thus a double-suffix rule .x.a produces two pattern rules: (%.o):
%.x and %.a: %.x’.
Vue de la page 140
1 2 ... 136 137 138 139 140 141 142 143 144 145 146 ... 211 212

Commentaires sur ces manuels

Pas de commentaire