Roland Ver. 4.5 Informations techniques Page 88

  • 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 87
78 GNU make
libs_for_gcc = -lgnu
normal_libs =
ifeq ($(CC),gcc)
libs=$(libs_for_gcc)
else
libs=$(normal_libs)
endif
foo: $(objects)
$(CC) -o foo $(objects) $(libs)
7.2 Syntax of Conditionals
The syntax of a simple conditional with no else is as follows:
conditional-directive
text-if-true
endif
The text-if-true may be any lines of text, to be considered as part of the makefile if the
condition is true. If the condition is false, no text is used instead.
The syntax of a complex conditional is as follows:
conditional-directive
text-if-true
else
text-if-false
endif
or:
conditional-directive-one
text-if-one-is-true
else conditional-directive-two
text-if-two-is-true
else
text-if-one-and-two-are-false
endif
There can be as many else conditional-directive clauses as necessary. Once a given
condition is true, text-if-true is used and no other clause is used; if no condition is true then
text-if-false is used. The text-if-true and text-if-false can be any number of lines of text.
The syntax of the conditional-directive is the same whether the conditional is simple
or complex; after an else or not. There are four different directives that test different
conditions. Here is a table of them:
Vue de la page 87
1 2 ... 83 84 85 86 87 88 89 90 91 92 93 ... 211 212

Commentaires sur ces manuels

Pas de commentaire