The following example of a conditional tells make to use one set of libraries if the CC variable is gcc , and a different set of libraries otherwise. It works by controlling which of two command lines will be used as the command for a rule. The ifeq directive begins the conditional, and specifies the condition. It contains two arguments, separated by a comma and surrounded by parentheses.
Variable substitution is performed on both arguments and then they are compared.
The else directive causes the following lines to be obeyed if the previous conditional failed. In the example above, this means that the second alternative linking command is used whenever the first alternative is not used. It is optional to have an else in a conditional. The endif directive ends the conditional. Every conditional must end with an endif .