Usage
For every
project myprojname { }
in mpc files, the
WB30 project type
generates a corresponding "workbench project" directory of the form
wb_myprojname. The WB30 Project Type
uses Eclipse's
linked resource feature to work around
Eclipse's usual requirement that source files reside inside the Eclipse
project directory. However, the linked resource feature also comes with
restrictions; see
the note for details.
Generic workflow
Presuming .mpc files already exist:
- Generate projects using -type wb30.
- Import projects into a Workbench workspace. From within Workbench
(preferably an otherwise-empty workspace) select
File->Import... and perform the following actions:
- Choose General->Existing Projects Into
Workspace and click Next
- In "Select Root Directory:" text field, enter the full path
to the MPC workspace.
- Workbench will scan all the subdirectories looking for existing
projects.
- Be sure that the checkbox next to Copy projects
into workspace is UNchecked.
Copying projects into the workspace unnecessarily duplicates
files, plus we have found that Workbench can get confused with file
paths sometimes (though sometimes it will work).
- Click Finish to proceed with the import.
Building A Project
To build a project or set of projects, select the project (or
projects) in the
Project pane, then select
Project->Build Project.
Platforms and Buildspecs
The default platform for WB30 is called "Native" and corresponds to creating
a project in Workbench using File -> New -> Native Application Project.
Although this method doesn't have (in workbench) any direct support for
building shared libraries, MPC does generate projects that pass the correct
compiler and linker flags to create shared (dynamic) libraries. Selecting
static or shared libraries with WB30 works the same as with any other MPC
project type.
The alternative platform, "VxWorks" can be selected by passing the option
-value_template platform=VxWorks
on the mwc.pl command line.
Currently the VxWorks support is inherited from the existing
-type wb26
template, so it may need some more work before it is
production-ready. Note that the wb26 template supported only DKM projects for
VxWorks (Downloadable Kernel Modules).
Each platform includes a list of supported buildspecs, and a single default
buildspec. For the "Native" platform, the list of supported buildspecs is:
- Linux_gnu_native_3.x_4.x
- Windows_gnu_native_3.x_4.x
Users can select the list of buildspecs by passing the option
-value_template buildspecs=<specs>
on the mwc.pl command
line, where <specs> is replaced by the buildspec value or values.
Multiple values are separated by spaces (with the entire specs string
enclosed in quotes). Similarly, the default buildspec can be selected with
-value_template default_buildspec=<spec>
.
New buildspecs (or even platforms) can be added by either editing the file
$MPC_ROOT/templates/wb30dll.mpt
(if the modification will be
submitted back to the public MPC repository), or creating a file named
user_wb30dll.mpt
anywhere on the MPC -include search path.
Within either of these files, create a scope for the platform/buildspec and
use assignment statements within that scope to set the various template
variables. The existing buildspecs serve as the best examples.