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 you can import then into the wizard by clicking the "Collect Capturing Files" button on the capturing wizard page. The next pages work just like the other wizards. You select root directories and then assign them to modules.