Commands

The command for any rule is just a piece of Tcl code. The command must be on the line immediately after a command, and must be indented by at least one space or tab. The command ends at the first blank line or line that has a character at the start of the line.

If a line starts with the character "@," then the command starting on that line will not be echoed to the console. (Note that @ can be used only at the top-level of a command.)

The command will have any make-variables substituted into it. (There is no reason you cannot have the code also set and read regular Tcl variables, but you should be careful with this, as the order in which commands are executed is difficult to predict.) The command will also have the following special variables substituted:

$@
The name of the target that is being updated. In the tclIndex example, this variable will be "tclIndex."
$!
The name of the target that is being updated that caused this target to be updated. This is like going "up the call stack," and is used only in very special circumstances (see Recursive tclmakes). This variable is unique to tclmake.
$<
The name of the first dependency. In the tclIndex example, this variable will be the first file in TCL_SRCS.
$?
The names of the dependencies that are newer than the target. In the tclIndex example, this variable will be the files in TCL_SRCS that are newer than tclIndex. (What about phony dependencies?)
$^
$+
The names of all dependencies. In the tclIndex example, this variable will be the value of TCL_SRCS.
$*
The stem of a pattern-match rule -- that is, the part of the file name that matched the "%" symbol.