This section details Makefile make targets discussed in the Makefile section above.
The clean target removes all the build directories from the work directory.
The dist target produces a binary version of each component. Each component can implement a <component>.dist rule in the component's Makefile.src.
The reconfigure target adds parameters, using the NEWCONF macro, to the original configure command.
The all target is the first target in the Makefile and so when the make command is run without an argument make all is run.
The root target copies files from components into the root directory.
Each component implements the <component>.all rule, which is defined in the component's Makefile.bin file. This rule tells you what other components this component is dependent upon. The <component>.all rule in the Makefile.src implements the rule, building the component in its own build directory. If this first component depends on a second component, the dependency rule
<component1>.all :: <component2>.allis expressed in the Makefile.bin file of the first component.
If the dependency is valid only for the build process, the dependency rule is expressed in the Makefile.src file.
Verify that you have installed the EXAMPLES component. This source component, which contains a number of small applications, is built on top of the os and nucleus levels (See Table 1-1 for further details of component hierarchy).
The reconfigure target adds components to the initial configuration. Add the EXAMPLES component to your initial work directory, and build it as follows:
host% make reconfigure NEWCONF='-s <src_dir>/opt/examples' host% make
The root target lets you copy files from components into the root directory.
As the EXAMPLES component contains binary files that the target must see, use the make root command to copy the binary files of the EXAMPLES component into the root directory as follows:
host% make root
The root directory now contains the binary files of the EXAMPLES component. You can run this component on a target system where this root directory can be NFS mounted.
To build a binary distribution of the EXAMPLES component, run the following command:
host% make EXAMPLES.dist
This command creates a new directory in your work directory, called dist-EXAMPLES, containing the binary files of the EXAMPLES component.
You can move the component's binary files to any directory as follows:
host% mv dist-EXAMPLES ../Use these binary files instead of the source files by using the binary option of the configure command.
To use the EXAMPLES component's binary files, you must remove the current configuration of the component. There is no specific command to achieve this. Follow these four steps:
Edit the reconfigure rule at the end of the top-level Makefile by removing the following line in the source file
-s <src_dir>/opt/examples
Remove the component's build directory and run make reconfigure as shown here:
host% rm -rf build-EXAMPLES/ host% make reconfigure
Add the application's binary files:
host% make reconfigure NEWCONF='-b dist-EXAMPLES'
Run the make command and notice the output as make rebuilds files in the conf directory.
Usually, compilations of an mkmk or imake component are not verbose. If you want to get the whole trace of the build, just add 'SILENT=' to the Paths file:
host% echo 'SILENT=' >> Paths
To test this modification, compile the EXAMPLES component by configuring the source files:
host% make reconfigure NEWCONF='-s /<src_dir>/opt/examples/'
The previous command has produced another Paths files, so if you add "SILENT=" again and run the make command, you will see a more verbose output.
host% echo 'SILENT=' >> Paths host% make
As the application binary files are already configured, the configure command will skip the binary files and choose to use the source files.
To debug a component, you may need to recompile it with special compilation options. To achieve this for the EXAMPLES component: