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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Another method of indicating which files should be used as<br />

makefiles is to use the .MAKEFILES special target in the startup.mk<br />

file. Consider<br />

.MAKEFILES: $(PWD:f).mk<br />

This tells make to look in the current directory for the makefile, with<br />

the name of the makefile the same as the current directory name (that<br />

is if in src/make, look for make.mk). Adding dependencies using<br />

.MAKEFILES does not override the standard makefile lookup<br />

behavior; it just adds new file names for make to consider as<br />

makefiles. By default, make looks for the file makefile. On UNIX<br />

versions, make also looks for Makefile.<br />

Example: Creating Prologs and Epilogs<br />

With make, you can formulate recipes so that certain processes always<br />

happen before a recipe is run, or after the recipe has completed. This<br />

capability is controlled with the .PROLOG and .EPILOG attributes, and<br />

with the .GROUPPROLOG and .GROUPEPILOG special targets. Consider<br />

the makefile<br />

all: GroupWithProlog GroupWithEpilog<br />

GroupWithBoth NonGroupRecipe<br />

GroupWithProlog .PROLOG .SILENT:<br />

[<br />

echo In prolog group recipe<br />

echo<br />

]<br />

GroupWithEpilog .EPILOG .SILENT:<br />

[<br />

echo In epilog group recipe<br />

]<br />

GroupWithBoth .PROLOG .EPILOG .SILENT:<br />

[<br />

echo In prolog/epilog group recipe<br />

]<br />

.GROUPPROLOG:<br />

echo Running prolog<br />

.GROUPEPILOG:<br />

echo Running epilog<br />

echo<br />

NonGroupRecipe .PROLOG .EPILOG .SILENT:<br />

echo In non group recipe with .PROLOG and .EPILOG<br />

attributes set<br />

280 <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!