The mkmk tool uses portable description files, independently of both the host and target systems. High-level mkmk rules are included in .bf, .df and .mf portable description files for a component, and are then processed to create Makefiles and .dp dependency files for the builds.
The mkmk command uses three types of build description files, suffixed by .df, .bf, and .mf, to produce Makefiles and generate all .dp dependencies. With mkmk, you create a .mf file for each host. In this way the mkmk tool ensures portability during cross compilation and so ensures the portability of hosts and targets.
The .bf suffix denotes build file.
The .bf files are a subset of Imakefiles. They contain link directives , and you can have several .bf files per directory. The mkmk tool concatenates the .bf files inside the Makefile product. The .bf file is preprocessed by the macro processor m4(1).
Table 4-7 lists the macros used in a .bf file. The Actor
, ConfigurableActor
, Library
and BigObject
macros use getExport, either directly or
indirectly, to get the list of object files. The getExport
command computes the list of object files to use when creating a link.
Macro |
Description |
---|---|
|
Build actor using libs |
|
Build actor using libs |
|
Build lib |
|
Build a relocatable object file |
|
Copy file into dir |
|
Copy file into dir |
|
Build actor using libs |
|
Build actor using libs |
|
Build lib |
|
Build a relocatable object file |
|
Copy file into dir |
|
Copy file into dir |
|
Build a pre-built actor and its finalized makefile using libs and local_libs. |
The .df suffix denotes definitions file.
The .df files are used as shell scripts that are launched when the Makefile is created to adjust variables before they are written into the Makefile. The .df files define the following variables:
The cpp symbols
The header file directories
The list of subdirectories
The .df files have similar properties to the Project.tmpl files of the imake tool. They affect the building of the Makefiles for all the subdirectories. With mkmk, you can have several .df files in each directory of the source tree. This contrasts with the imake tool, which has only one Project.tmpl file per component.
The inheritance mechanism of the mkmk tool is different from that of the imake tool. With mkmk, every Makefile is dependent on the Makefile present in the parent directory. However, with imake, every Makefile is dependent on the Project.tmpl file present in the top-level directory of the component and on the few variables inherited from the parent directory. The variables and macros are defined in the production tools. Table 4-8 lists those you must not modify and Table 4-9 lists those you can modify.
Table 4-8 Variables for the .df Files that must not Change
Variable |
Description |
---|---|
DTL | (DEVTOOLS_DIR)/host/bin/ |
GROOT | ../../ (the relative path to the root component) |
BDIR | build_dir |
BNAME | Name of current directory |
HOST | Type of host |
FAMILY | Type of target |
COMPILER | Type of compiler |
MPATH |
Pathname of current directory relative to the component root |
BFILES | List of .bf files found in your work directory |
MFILES | List of .lf and .mf files found in your work directory |
DFILES | List of .df files in your work directory |
Table 4-9 Variables in the .df Files hat can Change
Variable |
Description |
---|---|
DEFINES | List of macro definitions to use in every compilation rule |
INCLUDES | List of directories to search for header files |
VARIABLES | The list of user defined variables to export in Makefiles produced in subdirectories |
SUB_DIRS | The list of directories to use when compiling; these are usually the subdirectories of your build directory |
EXTRA_DIRS | A list of directories to use, in addition to SUB_DIRS, when creating libraries or linking actors (usually empty) |
MODULES | The name of the module to which the object in your build directory (and subdirectories) belong; this is only useful in configurable actors |
FARROP |
Application profiling |
FEXCEPTION | (ON/OFF): Compile with exception support |
FPU | (ON/OFF): Compile with FPU support |
FOPTIM | (ON/OFF): Compile with optimization |
FPROF | (ON/OFF): Support for profiling |
FREMOTEDEB | (ON/OFF): Compile with debug options, to enable source level debugging |
FVERBOSE | (ON/OFF): Verbose compilations |
FWARN | (STRICT/ON/OFF): Enable production of warnings during compilation; with STRICT, warnings are treated as errors. The NUCLEUS component uses STRICT |
FASSERT |
(ON/OFF): Enable or disable assertions |
FGCOV |
(ON/OFF): Enable or disable code coverage testing with gcov |
FPIC |
(ON/OFF): Enable or disable compilation for inclusion in shared libraries |
FVEC |
(ON/OFF): Enable or disable generation/build options to use or not use a unit vector |
The .mf suffix denotes make file.
The .mf files contain lists of source files. The .mf files are used during make sources when the binary file to be built uses many subdirectories, each subdirectory containing a variable number of files to be compiled.
Another form of .mf files are .lf files. The variables and macros used in the .mf and .lf files are listed in Table 4-10.
Table 4-10 Variables and Macros used in .mf and .lf Files
Variable |
Description |
---|---|
C++SRCS | C++ source files |
C_SRCS | C source files |
AS_SRCS | Assembly code source files |
M4_SRCS | M4 source files (assembly code source files preprocessed with m4). |
OF_SRCS | C++ source files used to produce offset files |