NASD Programmer's Documentation
Compiling NASD

The compilation environment

The compilation environment of the NASD tree itself uses imake. To generate Makefiles, run the itomf script at the top of the NASD tree. On some platforms, this may require platform-specific arguments. Additional arguments may be specified to instruct the system that it should also build portions of the tree which are not built by default.

After the Makefiles are generated, a make depend from the top of the tree will create all automatically-generated source files, and add dependencies to all of the Makefiles.

Finally, make from the top of the tree will build all default components, and whatever non-default components were specified to itomf as well.

At any time, make Makefile in a directory will regenerate the Makefile from its corresponding Imakefile. Note that this new Makefile will not include dependencies; another make depend is necessary for that. make Makefiles will regenerate Makefiles in all subdirectories of the current directory, but not in the directory itself. make depend will regenerate dependencies for all subdirectories as well as the current directory.

The make clean production will remove any generated objects and executables, most editor backup files, and locally-generated source files in the current directory and all subdirectories. The make sterile production will remove all generated files (including Makefiles) in the current directory and all subdirectories, along with most editor backup files.

The README file at the top of the NASD tree contains up-to-date instructions for compiling the tree on various platforms. Here is a detailed description of some of these procedures:

Compiling on Digital Unix

Compilation on Digital Unix is relatively straightforward. When itomf is invoked, it must be given the name of a directory containing a valid include tree for the system. If you are compiling against an existing kernel object tree, you should provide the include tree in the obj/alpha/kernel subdirectory of this tree. If you do not have such a tree, you can use the system default tree in /usr. In any case, the name of the directory you provide must be the parent directory of the system include/ directory. This directory is specified by either setting the environment variable PDL_KDIR to its absolute path, or providing that path after the -k argument to itomf. If both are provided, the command-line will override the environment variable.
Examples:

% ./itomf -k /usr

% setenv PDL_KDIR /usr/src/osf/obj/alpha/kernel
% ./itomf

Compiling on Linux

The supported Linux platform is currently RedHat 5.1. NASD is likely to work on other Linux configurations, but is unlikely to work on installs that predate glibc. The build process is nearly identical to that for Digital Unix, but the -k flag (and PDL_KDIR environment variable) are not necessary or supported.

Configuring the compilation environment for your system

Names, locations, and arguments of system-local executables are specified in config/NASD_site.def. For instance, if your platform has located sed in a nonstandard location, the path to find it is specified by setting the SED variable in this file. All system-specific compilation options should be handled here, such as compiler flags, locations of executables, library paths, extra libraries to link against, et cetera. Modifications to this file will not take effect until the relevant Makefiles are regenerated (see above).
<--- ---> ^<br>|<br>|
Structure of the NASD tree Compiling NASD into the dux kernel NASD Programmer's Documentation