The Reverse
Engineering window requires
you to provide the list of files to reverse engineer. In addition,
the Advanced Options window allows you to specify
other settings for reverse engineering, such as include paths. To
facilitate the entry of this information, if you have a makefile for
your project, you can provide IBM® Rational® Rhapsody® with
the location of the makefile and it will analyze the makefile in order
to retrieve the list of source files and any other settings that are
relevant for reverse engineering.
About this task
To have Rational Rhapsody analyze
a makefile:
Procedure
- Open the Reverse
Engineering window
(choose ).
- In the Select Files area, select the Makefiles radio
button.
- Use the Browse button
at the top of the window to locate the root directory to use for reverse
engineering. The file list area then lists any makefiles located in
this directory (based on the value of the <lang>_ReverseEngineering:Main:MakefileExtension property).
- Select the check box next to the
filename
of the makefile in the file list that appears in the Select
Folders area.
- Use
the Environment list
to choose the correct environment.
- Click the Analyze Makefile button.
Results
After the analysis is complete,
the source
files referenced in the makefile will be displayed in the Select
Files area of the window. If you go to the Reverse
Engineering Advanced Options window, you will see that Rational Rhapsody has
also brought in the other relevant settings from the makefile.
When using this feature, keep in mind the following
points:
- While the makefile analysis feature
allows you
to bring in the settings from the makefile and review them in the Reverse
Engineering window (and its Advanced Options window),
you can also use the settings from the makefile for reverse engineering
without performing the analysis step: simply select the appropriate
makefile, and click the Start button to begin
reverse engineering.
- When analyzing makefiles, Rational Rhapsody does
not actually parse the makefile. Rather, it opens the makefile and
then analyzes the output. Therefore, in order for this feature to
work properly, you have to make sure that the value of the InvokeMake property
is correct.
- Since the syntax of makefiles varies
between environments, Rational Rhapsody uses
a set of environment-level properties in order to analyze makefiles.
These properties can be found under <lang>_ReverseEngineering::Makefile<environment
name>, and they are used to define the syntax for
standard makefile commands. The values of these properties can be
customized for different environments. This set of properties includes:
- MakeCommand
- IncludeSwitch
- DefineSwitch
- UndefineSwitch
- CompileNoLinkSwitch
- CompileCommands
- LinkCommands
- ChangeDirectoryCommand
- ChangeDirectorySwitch