AMake understands all of the following rule syntaxes:
<targets> ... : <dependencies> [; <commands>]
[<commands>]
do a target when out of date in regard to its dependencies; at most one such definition can have commands; dependencies are cummulative
<targets> ... ! <dependencies> [; <commands>]
[<commands>]
always redo the targets whatever the dependencies; at most one such definition can have commands; dependencies are cummulative
<targets> ... :: <dependencies> [; <commands>]
[<commands>]
redo targets which have at least one of its specific dependencies out of date; each instance is distinct (therefore dependencies are not cumulative)
<targets> ... <operator> <easy pattern> : <dependencies>
[; <commands>]
[<commands>]
redo the targets which match the <easy pattern> and if at least one of its specific dependencies is out of date; the <operator> can be any of the previous operators (':', '!' or '::')
<easy pattern> : <dependencies> [; <commands>]
[<commands>]
when AMake doesn't know how to build a target, it searches the list of the available dynamic rules; if the target name matches an <easy pattern> it gets its dependencies (including the attributes) and uses its commands; an <easy pattern> is a filename which includes exactly one percent (%) sign as a wildcard; the percent sign will match at least one character
<easy patterns> ... : <dependencies> [; <commands>]
[<commands>]
this is similar to a dynamic rule as the described above; yet, it also tells AMake that all the specified targets will be built at once when the commands are executed; only the first target needs to include a percent (%) sign
<suffixes> : <attributes> [; <commands>]
[<commands>]
the <suffixes> must be defined as .<suffix>.<suffix> (as in .c.o); this type of rule will be used only if the first suffix is defined on the .SUFFIXES target; it is similar to the dynamic rule above in that it will be used to know how to build a target if no specific commands where defined; it is prefered to use the dynamic rules instead; no dependencies can be defined with suffixes, yet attributes (special targets) can be used
Commands are evaluated right before to be executed. That's when we will know whether each command starts with a meaningful character which could therefore come from a macro. The following is a list of these additional options:
Character | Comment |
---|---|
@ |
don't display this line before to execute it; this is similar to the .SILENT attribute |
- |
don't check if an error is generated when this line was executed |
-<min><space> |
ignore error codes smaller than <min> |
-<min>.<max><space> |
ignore error codes defined between <min> and
<max> |
+ |
always execute this line, even in touch (--touch) or in no execution (--noexecution) modes; this is similar to the .RECURSIVE attribute |
! |
repeat the command(s) which use the $(.OODATE) or $(.ALLSRC) variables
(this is not implemented yet) |
AMake will rebuild the targets defined in a makefile script if those are defined as follow:
1. | the target(s) given on the command line (always - except if flagged as .NOTMAIN) |
2. | the target(s) given on the .MAIN target (always) |
3. | the target(s) given on the .DEFAULT target (always, yet only in AMake and OldAMake modes) | 4. | the first target appearing in the makefile script (when no other main target was defined) |