3.1 Multimodule Program Example

In this chapter, you'll learn to set up a multimodule project in PWB by building COUNT.EXE, a three-module program. The COUNT program analyzes text files and produces a statistical profile of the text.

The following modules make up COUNT.EXE:

Module Function

COUNT.C Program driver; contains main and calls all other routines.
COUNTBUF.C Analyzes text in the input buffer.
COUNTCH.C Analyzes a character.

The program also contains a common header file COUNT.H in addition to these three source modules. Figure 3.1 shows the components of COUNT and how they combine to build the executable file. Later in the tutorial, you will add the SETARGV.OBJ object file.

To build COUNT.EXE, you need to compile the three source files and link the correct libraries. You also need to specify various options, such as the target operating environment. All this information is contained in the COUNT project.