Table of Contents
This chapter describes tools provided along the Massiv that can be used to build projects based on the Massiv and to compile Doxygen and DocBook documentation. While you will have to use some of them (such as the IDL processor factgen.pl), using most tools described in this chapter is not required by highly recommended.
Building application based on the Massiv (and the Massiv Core itself) is not a simple task. Many soure that are required to compile and link the application are automatically generated, mostly from the IDL. If you wanted to use your favorite build tool, you would have to teach it how to call external tools to generate the files. You could write complex makefiles that accomplish that, or generate the files manually and then use less sophisticated build tools.
It's highly recommended to use tools described in this section that do all the hard work almost automatically.
The following text tries to describe the whole build process of a Massiv project, assuming Massiv build tools are used exclusively.
Massiv build tools work with projects. A project is either a library (static or shared) or a program. The programmer usually has to write the following files for each project:
C++ sources containing implementation of both standard C++ and Massiv managed classes.
IDL descriptions of all managed classes.
idl.list - this files contains list of all IDL files and some additional information. Syntax of the file is described in Section D.2, “The idl.list File”.
makefile.gen - a file that descibes how to build the project The mkgen.pl tool reads this file and generates makefiles for selected target platform.
For example, the Massiv Demo client application contains many C++ sources stored in several directories and no IDL files. It depends on three library projects - the Massiv Core library, and shared and client-side demo libraries. Even though it does not conain any IDL files, it depends on libraries with IDL files and its sources include several generated files from those libraries, therefore it must contain an idl.list file too.
To be able to build a Massiv project, makefiles must be generated first. This phase is usually called configuration. The most simple configuration consists of two steps illustrated by this figure:
Generate makefile_idl.gen files from idl.list files. This step is performed by the genmkgen.pl tool. It determines information about dependencies between C++ sources and IDL files written by the programmer and the generated sources, and writes the information to file that must be included from makefile.gen in the same directory.
Generate makefiles. This step is performed by the mkgen.pl tool. It reads all makefile.gen files and generates makefiles for specified target platform.
You can use scripts in the massiv source root directory to perform the configuration step. On Windows, run the configure.cmd command, on Linux (and other supported Unixish systems), run the configure script.
You can various arguments to the configure script - you can specify which compiler should be used, where development libraries are located, which compilation and linking options should be used, directories where the binaries and libraries should be installed, and more. Run configure --help for detailed help. The script first checks if local environment - if correct compiler version is present, if development versions of all required libraries are properly installed, etc. Then it generates several files required by the build and installation process and runs genmkgen.pl and mkgen.pl.
The Win32 script is much more simple - it just runs the two tools. Several files automatically generated by the unixish script must be edited manually. For each such file, a file with thesame name and .example extension appended exists. It contains default settings and documentation of the settings. The files that must be edited manually are:
mkgen/config/msvc.config
src/demo/client/config.h
src/demo/server/config.h
src/demo/service/config.h
The configuration phase must be perfomed when any makefile.gen or idl.list is changed, when new sources are added to a project or sources are removed from a project or when source dependencies change.
After the configuration phase, makefiles for all specified target platforms will be created in each project directory. The makefiles can correctly generate sources from IDL as required, compile the sources and build the projects as illustrated by the following figure. All utilities mentioned in the figures are described later in this chapter. The utilities are automatically called from the makefiles, you never have to call them manually.
The makefiles define several targets:
all (default target) - build all projects specified in makefile.gen in current directory. You can define multiple projects in single makefile.gen, but it's not recommended.
generate - generate all sources of local projects.
degenerate - remove all generated sources.
library_FOO - build library FOO. It must be either local library project, or a library local project depends on.
program_FOO - build local program project FOO.
FOO_obj - compile object FOO.obj. The object must belong to a local project. The FOO should be only the file name without extension; if the corresponding source is located in a subdirectory, the name of the directory should not be specified.
![]() | Note |
---|---|
There is no clean target. The degenerate target deletes generated sources and no objects, libraries or programs. However, those are stored in completely seprate tree in .bin directory in the Massiv source root, so you can easily remove them manually. |
The following pages briefly describe all Massiv commands. Most of them all called automatically from the generated makefiles, so they only basic description is provided. All the tools are written in Perl and contain standard perldoc documentation - run perldoc FOO to display documentation of the FOO command.