Index
CBM User Guide Scripts rwsetup rwinstal/a>

genmake

USAGE:  genmake [-d] [-i<workspace dir>] [-l] -t<build type number> 
             [-u] [-w] <part dir>[/target]

Command line options are:

-d	No argument. Generate makefiles for creating shared or DLL libraries.
-i	Path to the root of the workspace directory.
-l	Export C++ library source to workspace.
-t	Numeric build type
-w	No argument. Distinguishes an executable build from a C++
          library build.
-u	No argument. Forces makefile generation recursively for all 
          subdirectories of the part directory (last argument).
          If no target is specified, this is the default behavior.

Note: Do not put spaces between the argument flags and their associated values.

The script genmake coordinates the selection and customization of makefile templates. If the last argument does not specify an individual target, genmake creates makefiles comprehensively, visiting each etc directory that is a subdirectory of the part directory specified. Otherwise, only the etc directory that is an immediate subdirectory of the part directory is visited. genmake finds the makefile template makefile.in (or Imakefile.in) of greatest specficity in the RWOSFAMILY/RWOS/RWCOMPILER directory hierarchy in the etc directory. The makefile template is then customized through a series of editing operations.

In the first pass, data acquired from config.dat in <workspace>/rw is used to modify the template. (For Imakefile.in, this step is delayed until after rwgm is invoked.) If a gcustom script is located in the same directory as the selected makefile.in or Imakefile.in, this script is executed to modify the template. Then the CBM script rwgm is applied. This script contains makefile modifications that are platform-conditional and that are universally applicable to CBM makefile templates.

After applying the rwgm script, genmake executes a modify script if one is present in the etc directory. A modify script contains makefile modifications that are platform-conditional but specific to the particular makefile; that is, they are not universally applicable. A modify script can also perform other specialized actions such as customization of source prior to compilation. In cases where a question and answer session is used, the modify script sources the mechanism's answer file and uses the data to customize makefiles or to control other specialized actions. Answer files are written to <workspace>/config.

The -w flag is required to distinguish C++ application builds from C++ library builds. Conditional execution paths within the script depend on correct use of this flag.

When the -l flag is set for a C++ library build, the customized makefile(s) written to <workspace>/buildloc/<part> are set to look for source in this same workspace location and not in the product tree. The subsequent execution of rwinstal copies the library source to the workspace prior to the build step.

Before genmake replaces a makefile in the product tree, it runs the equivalent of diff to determine if the file will change. If it will not change, the existing makefile is left in place and its timestamp is unaffected. Makefiles can thus refer to themselves as a dependency to determine when object files need replacement. This mechanism is commonly used in Rogue Wave library generation makefiles. Note that the copying of makefiles to the workspace for executable builds always occurs; it is not dependent on a comparison.

CBM User Guide Scripts rwsetup rwinstal
Index