Copyright © tutorialspoint.com
There are numerious directives available in different forms. You make program may not support all the directives. So please check if your make supports the directives we are explaining here. GNU make supports these directives Conditional DirectivesThere are conditional directives
Syntax of Conditionals DirectivesThe syntax of a simple conditional with no else is as follows:,/p>
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:
If the condition is true, text-if-true is used; otherwise, text-if-false is used instead. The 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. There are four different directives that test different conditions. Here is a table of them:
Opposite directives of the above conditions are are follows
Example of Conditionals Directives
The include directiveThe include directive tells make to suspend reading the current makefile and read one or more other makefiles before continuing. The directive is a line in the makefile that looks like this:
filenames can contain shell file name patterns.Extra spaces are allowed and ignored at the beginning of the line, but a tab is not allowed.For example, if you have three `.mk' files, `a.mk', `b.mk', and `c.mk', and $(bar) expands to bish bash, then the following expression.
When make processes an include directive, it suspends reading of the containing makefile and reads from each listed file in turn. When that is finished, make resumes reading the makefile in which the directive appears. The override DirectiveIf a variable has been set with a command argument then ordinary assignments in the makefile are ignored. If you want to set the variable in the makefile even though it was set with a command argument, you can use an override directive, which is a line that looks like this:
|
Copyright © tutorialspoint.com