Percent escapes are used when constructing various shell commands which are run by maketool at various times. The command strings are scanned for the escape sequences described below, which are replaced with their expanded text as described below.
The various context in which escapes are expanded are:
The make program is being run to build a target. This happens when a menu item from the Build menu is selected or the Build All tool or Clean tool is clicked.
The make program is being run to generate the list of available targets in the current directory. This happens automatically when maketool starts or when the current directory is changed using the Change Directory menu item or the Previous Directories menu item.
The make program is being run to emit text describing itself, e.g. copyright and version messages. This happens the first time the About GNU make dialog is opened, and subsequently after the make program is changed in the Programs pane.
A source file is being edited. This happens when an error or warning line in the Log window is double-clicked, the Edit Makefile, Edit Error, Edit Next Error, Edit Prev Error, or Edit Next File Error menu items are selected, or the Edit Next Error tool or the Edit File Next Error tool are clicked.
The Makefile in the current directory is out of date and the make program is being run to rebuild it. This happens automatically before any target is built if the Build Makefile from Imakefile or Makefile.in option is enabled.
A build has just finished and the command specified in the On finishing each build item is being run to inform the user.
The help browser is started to view either a local HTML help file or the maketool web page. Note that the table below, "!help" means every context except this one.
The available percent escapes are:
Table 1. Percent Escapes
Escape | Context | Meaning |
---|---|---|
%D | !help | maketool's data directory, e.g. /usr/local/share/maketool. |
%M | !help | the make program currently selected in the Programs pane, e.g. gmake |
%S | !help | the name of the makefile system automatically detected when maketool is started or the current directory is changed, e.g. automake. |
%V | !help | the flags which cause make to print its version to stdout or stderr and exit, e.g. --version. |
%f | edit source | the source file name |
%k | !help | the flag which causes make to keep on building targets when targets fail, e.g. -k. |
%l | edit source | the source line number |
%m | !help | if a makefile is defined in the General pane, expands to the make flags necessary to use that makefile, e.g. -f /my/makefile. |
%n | !help | flags which cause make to print the commands it would run instead of running them, e.g. -n. |
%p | !help | to the flags which implement the parallelism policy controlled by the Make runs commands options, e.g. -j8 |
%q | !help | the flags which cause make to dump its internal database to stdout or stderr, e.g. -n -p. Useful only for listing available targets. |
%t | build target | target to be built |
%t | list targets | the string _no_such_target_ |
%t | finished build | target which has just been built |
%t | build makefile | filename of the makefile to be built |
%u | help | A URL pointing to either a local help HTML file or the maketool web page. |
%v | !help | set of make arguments of the form VAR=VALUE for all the variables of type Make in the Variables pane, e.g. CC=cc. Values have whitespace and shell metacharacters protected with quoting, but see Metacharacters for why shell metacharacters should be avoided. |
%{x:+y} | !help | if the simple expansion %x has a non-empty value, expands to the expansion of y, otherwise expands to an empty string. For example, %{l:+-line %l} expands to -line 23 if %l is 23, and expands to the empty string if %l is not defined. Note that while y may contain other simple % escapes the %{x:+y} compound escape cannot be nested. |