Makefile project to build it. This tutorial describes how to configure
make targets for a Makefile project.
Configuring make targets using Create Make Target or Build Make Target
If further build targets are required, they can be configured using the
Create Make Target or Build Make Target dialog boxes
can be used by themselves or with the Make Targets view, which is discussed in more
detail in the next section. To launch the dialog boxes.
Right-click the appropriate build directory in the Projects or
Navigator view.
Select Project > Create Make Target, or from the pop-up menu select
Create Make Target.
The Create Make Target dialog box appears.
Give your target a name, set the make target, which is the argument(s) passed to make,
and set the appropriate build command.
Note: do not set a build directory here as you have already
determined which directory the build command will be run in when opening the dialog box.
Select Create to finish creating the make target.
Open Build Make Target. This lists all of the make targets you have created
for the selected build directory. Any of the standard make targets set using the project
properties are not displayed.
To build with the new make target, select it and click Build.
This method of configuring targets is ideal where a project has multiple target configurations
available (for a range of platforms, for example). Where targets exist across various
directories within the project, it is probably easier to manage these using the Make
Targets view.
Configuring make targets using the Make Targets view
The Make Targets view is a dedicated STWorkbench view. In the default
C/C++ perspective, the Make Targets view is in the right-hand pane with the
Outline view. Select Window > Show View > Make Targets to open it.
All standard make projects in your workspace are listed, with their directory
structure and any make targets that have already been created using this view or the
Create Make Target facility. None of the standard targets defined in the
project properties are displayed.
To add a new make target, right-click the desired build directory in the Make
Targets view and select Add Make Target from the pop-up menu. This launches the
Create Make Target dialog box.
To edit an existing make target, right-click it and select Edit Make Target.
Create Make Target is launched with the existing settings.
To build using one of your targets, either double-click it or right-click it, select
Build Make Target, select it and click the
button in the top right of the view.
If you have a project with a complex directory structure, the Hide Empty Folders button
in the top right of the view clears the view of all directories which do not have any associated
make targets.
This facility, particularly when used with the Hide Empty Folders button, is
the best way to manage multiple make targets across multiple directories.