Next: , Previous: Tree Files, Up: Reducing the Size of Ada Executables with gnatelim


21.4 Preparing Tree and Bind Files for gnatelim

A set of tree files covering the program to be analyzed with gnatelim and the bind file for the main subprogram does not have to be in the current directory. '-T' gnatelim option may be used to provide the search path for tree files, and '-b' option may be used to point to the bind file to process (see Running gnatelim)

If you do not have the appropriate set of tree files and the right bind file, you may create them in the current directory using the following procedure.

Let Main_Prog be the name of a main subprogram, and suppose this subprogram is in a file named main_prog.adb.

To create a bind file for gnatelim, run gnatbind for the main subprogram. gnatelim can work with both Ada and C bind files; when both are present, it uses the Ada bind file. The following commands will build the program and create the bind file:

     $ gnatmake -c Main_Prog
     $ gnatbind main_prog

To create a minimal set of tree files covering the whole program, call gnatmake for this program as follows:

     $ gnatmake -f -c -gnatc -gnatt Main_Prog

The -c gnatmake option turns off the bind and link steps, that are useless anyway because the sources are compiled with -gnatc option which turns off code generation.

The -f gnatmake option forces recompilation of all the needed sources.

This sequence of actions will create all the data needed by gnatelim from scratch and therefore guarantee its consistency. If you would like to use some existing set of files as gnatelim output, you must make sure that the set of files is complete and consistent. You can use the -m switch to check if there are missed tree files

Note, that gnatelim needs neither object nor ALI files.