A command block is the set of commands that must be executed in order to build a target. These commands usually consist of compile statements or file processing commands (such as executing tool commands, file manipulation, directory changes, or system commands). All lines following a target/dependency statement that start with a space are executed as commands. A command can also be specified on the target/dependency statement line, if preceded by a semi-colon (;). The format is the following:

targets...  :  dependents; command
or
{paths;...}targets  :  {paths;...} dependents; commands

Example:

{\program\objs; \objects}program.obj : {\source} program.c \
program.h;icc /c program.c /Foprogram.obj
   @echo Build Finished

The first line following the target/dependency statement that does not begin with a blank or a comment indicator (#) is taken as the beginning of a new target/dependency or macro.

If a command does not fit on one line, it can be continued on the following line by using the line continuation character (\) at the end of the line. The remainder of the line can be typed on the following line. Whenever a backslash character is found, it is deleted and the following line appended to the current line.

always:
    @echo This command line will always execute and will \
                         continue on the next line!

#  And this line is just a comment line


[Back] [Next]