|
|||
Tutorial: A Little Help With Alcatel-Lucent nmake[Table of Contents] [Previous Section] [Next Section] 5. The PackageThe nmake command is part of a large package that can be installed anywhere on your system. If nmake is in your PATH and you're running ksh then
dirname `dirname \`whence nmake\``
will show you how to get to the root of the package. A few of the components you'll find there are shown in the following picture:
The picture is simplified - we only included nmake, the man page directory, and the four files we'll talk about briefly in this section. 5.1 cppIt's a bit surprising at first, but the nmake package comes with its own C preprocessor. It's required because nmake needs precise control over where cpp finds include files, but the preprocessor your compiler uses may have a mind of its own. For example, there are situations where the native cpp could include the wrong file (i.e., not the one nmake wanted) if it finds something like,
#include "b.h"
while it's reading /tmp/include/a.h and always insists on first looking for b.h in the directory of the including file: in this case it would first try file /tmp/include/b.h. nmake's cpp recognizes special options, like -I-, that gives nmake the control it needs over include files. 5.2 The License FileWalk down the tree to lib/license/make and you've found your license file. You get a license when you buy nmake or renew an existing contract. nmake checks the license file every time it runs and complains if it's missing. When your license expires all nmake will do for you is print an error message that points at the invalid license; you will have to renew your license and install the new copy here. 5.3 Makerules.mkThe file lib/make/Makerules.mk is called the base rules file. It's used [15] every time nmake runs and it controls much of nmake's behavior. Even though Makerules.mk is just another makefile, it is over 2000 lines of difficult reading, and you have to be fluent in nmake before you can make much of a dent in it. Still, it's important to know about Makerules.mk. It can be a convenient source of examples, even if most of the file is a complete mystery. As you get better you'll find it can be a big help when you're debugging problems or when you want to change nmake's behavior slightly. Eventually, you may even be able to go directly to Makerules.mk and answer many of your own questions. But perhaps the most important reason for mentioning Makerules.mk is that it helps put the existing documentation in the proper perspective. Even though everything's presented on pretty much an equal footing, much of what's discussed in the manual is needed in Makerules.mk and nowhere else. Keep that in mind and you'll be a more discriminating reader when you do go back to the manual. 5.4 Scanrules.mkWe mentioned nmake's built-in dependency scanner when we talked about implicit prerequisites early in the paper. The scanner is programmable and the default behavior is controlled by the rules in file lib/make/Scanrules.mk. We're not going to teach you how to program the scanner. If you're interested you'll find the details described in Appendix G of the nmake manual, and if you ever need custom scan rules use Scanrules.mk as a good source of examples. FOOTNOTES:
[Table of Contents] [Previous Section] [Next Section] Last Update: Wednesday,20-Dec-06 13:22:14 CST
|
|||