The following sections describe how to build the ViewKit ObjectPak application examples.
Copying the Example Code Source Tree
Before you build the examples you will want to copy the source tree into a location that is writable by you. For example, to build the examples in /usr/src/viewkit:
-
% cd <$INSTALLTREE>/examples
% tar cf - . | (cd /usr/src/viewkit; tar xvf -)
where <$INSTALLTREE> is the directory where you installed ViewKit ObjectPak.
Building the Examples
All examples may be built using the imake tool or by modifying and using the supplied Makefile.noimake.
Using Imake
Note: You must install imake support for ViewKit ObjectPak to use imake.
Using Imake
To use Imake, perform the following steps:
-
Change to the directory that contains your copy of the examples source code tree:
- % cd examples
- Use xmkmf to create the top-level Makefile:
-
Build the remaining Makefiles.
- % make Makefiles
- Build the examples tree:
Imakefiles and Makefiles
Included with the examples are a set of Imakefiles that enable you to create Makefiles customized to your system. These files are provided for your convenience. You may need to modify several flags in the Makefiles, Imakefiles, or imake configuration files in order to build the demos correctly on your system. For further information on Imakefiles, refer to the X11R5 man pages on imake.
Using Makefile.noimake
If you did not install the ViewKit ObjectPak imake configuration files, or if your system does not have imake fully configured, you may want to use the Makefile.noimake files supplied in each of the example subdirectories. These Makefiles will need to be customized for your build environment before building any of the examples.
Customizing Makefiles
To customize the Makefiles, perform the following steps:
-
Go to the directory which contains the example you want to build, for example, the PhoneBook demo application.
- cd examples/Applications/PhoneBook
-
Copy Makefile.noimake to Makefile.
- % cp Makefile.noimake Makefile
- Edit Makefile by changing the definitions for the following:
LOCAL_LIBRARIES contains the libraries to link the application against. You might require additional libraries depending on your platform. CXXEXTRA_INCLUDES contains any include directives required to build the application. By default, it contains only a directive for the ViewKit include files. Your platform might need additional include directives.