Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



How to write an extension makefile template

A makefile can be defined as a collection of instructions (build steps) that are needed to build a program. The Symbian OS build process generates the required makefiles from project (.mmp) files, and these makefiles cater to all the usual build steps. There might be few build steps which are specific to your project, and are not catered for by the generated makefiles. These build steps are addressed by separate set of makefiles called extension makefiles. The need for extension makefiles purely depend on requirements of the project you are working with.

Since Symbian OS v9.3 the functionality and data for extension makefiles are kept separate. That is, extension makefiles with similar functionality can be generalised into a template makefile, which contains only the basic functionality. The same template can be used for various use cases by passing appropriate parameters (data). The parameters can be passed using the prj_extensions and prj_testextensions call mechanism in the bld.inf file, which deprecates the old approach of referring to the extension makefiles using the makefile or gnumakefile directive.

This template makefile approach reduces the number of makefiles, as the extension makefiles with similar functionality are generalized into a single template.

The following provides an overview of designing an extension makefile template. Details of the syntax are given in the reference topic Template extension makefiles.

  1. Define the input variables used by the template. The values for these variables are passed through a component's bld.inf file. If necessary, assign the default values for these variables in the corresponding meta file (see Meta files).

  2. Specify the set of targets that the makefile should respond to. An extension makefile responds to a few mandatory targets, apart from the project-specific targets. For more information on mandatory targets, refer to Extension makefile targets.

  3. Specify the build steps to create/update the target. These build steps can include basic shell operations, called through platform independent variables, such as CP to copy a file, and RM to delete a file. Other than calling these basic shell commands, the makefile can call other tools required to complete the build step, such as calling a Perl program.

For more information on the syntax of template extension makefiles and variables, refer to Template extension makefiles.