6.2.2.  Importing C++ Modules Using Make Command Capturing Files

Select "New""Module""C/C++ Modules from Make command capturing files"

You will have to do a complete rebuild of your system while passing a special shell to the 'make' command. The special shell will create raw files named 'h2m-capture.txt' for each 'Makefile' that executes compile commands during the make process. These files contain a complete list of the compile commands and are used to extract the right options for the C/C++ parser. Sonargraph will then translate these files into files named 'h2m-capture-rel.txt' Do not delete the translated capturing files, instead add them to your version control system. They are used each time Sonargraph opens your system. If you change options or add or remove files from your build you have to repeat the capturing process. Please note, that your top level 'Makefile' must be either in the same directory as the Sonargraph system or in a sub-directory of that directory. Here are the commands you need to execute on the level of your top-level 'Makefile':

Example 6.1. Command Capturing Process
        SG_DIR=<replace with Sonargraph installation directory>
        $SG_DIR/bin/h2mcs clean
        make clean
        make <optional-targets> SHELL=$SG_DIR/bin/h2mcs

After executing those commands you should find 'h2m-capture.txt' files in the relevant project directories. 'make clean' can be replaced with another command you use to force a complete rebuild of your system. On Windows platforms the capturing process currently only works in combination with Cygwin.

Once the 'h2m-capture.txt' files have been generated you can choose which of them you want to use to create the modules.

Choosing C++ modules to import from capturing files
Figure 6.6. Choosing C++ Modules to Import from Capturing Files

If you want, you can change the name and configuration for each of the modules by editing the corresponding fields.

Renaming and configuring C++ modules to import from capturing files
Figure 6.7. Renaming and Configuring C++ Modules to Import from Capturing Files