02.05.2013 Views

The Source Integrity Professional Edition User Guide - MKS

The Source Integrity Professional Edition User Guide - MKS

The Source Integrity Professional Edition User Guide - MKS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Using the <strong>MKS</strong> Make Utility<br />

Try some experiments on small makefiles, using make with the -v<br />

option, to see suffix rules work.<br />

More About Executing Recipes<br />

Regular<br />

Recipes<br />

Note Because <strong>MKS</strong> Make searches met-rules first, you should specify<br />

the -r option on the command line to disable the default met-rules when<br />

experimenting with suffix rules.<br />

To update a target, <strong>MKS</strong> Make expands and executes a recipe. <strong>The</strong><br />

expansion process replaces all macros and text diversions within the<br />

recipe, then either executes the commands directly, or passes them to<br />

a shell or command interpreter, depending on the occurrence of shell<br />

metacharacters in the recipe.<br />

When <strong>MKS</strong> Make calls a regular recipe, it executes each line of the<br />

recipe separately. This means that the effect of some commands may<br />

not carry over from one recipe line to the next.<br />

For example, a change directory request (cd) in a recipe line changes<br />

the current directory only for that recipe line. <strong>The</strong> next recipe line<br />

reverts to the previous current directory.<br />

<strong>The</strong> value of the control macro SHELLMETAS determines whether<br />

<strong>MKS</strong> Make uses a shell to execute a command. If it finds any<br />

character in SHELLMETAS in the expanded recipe line, it passes the<br />

command to the shell for execution; otherwise, it executes the<br />

command directly.<br />

Note If the makefile contains the .POSIX special target, <strong>MKS</strong> Make<br />

always uses the shell to execute recipe lines.<br />

To force the use of a shell, you can add characters from SHELLMETAS to<br />

the recipe line, as in the example<br />

rule 1<br />

# the next lines contains shell metacharacters<br />

command_one > file_one<br />

command_two | command_three<br />

…<br />

288 <strong>Source</strong> <strong>Integrity</strong> <strong>Professional</strong> <strong>Edition</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!