Scroll to navigation

MPC(1) General Commands Manual MPC(1)

NAME

mpc-ace, mwc-ace — generate project and workspace files

SYNOPSIS

mpc-ace [OPTION ...] [FILE ...]

mwc-ace [OPTION ...] [FILE ...]

DESCRIPTION

mpc-ace and mwc-ace, the Makefile, Project and Workspace Creator generate platform and compiler specific files to automate the compilation process (e.g. GNUmakefile and Makefile.am).

The most common way to use the Make Project Creator is to run the workspace generator (mwc-ace). This script will generate projects and a single workspace that contains the generated projects. If no input FILE (.mwc file) is specified, it will recurse into the directory in which the script was started. It looks for .mpc files and generates a project or projects for each one found.

Most of what is stated about mwc-ace applies to mpc-ace except that it only generates projects. If an input FILE (.mpc file) is not provided, the project creator will attempt to create a default project in the directory from which the script was started.

specifies the global input file. Values stored within this file are applied to all projects. If not specified, defaults to config/global.mpb
specifies a directory to search when looking for base projects, template input files and templates. This option can be used multiple times to add directories. Two include directories are used by default (config and templates)

recurse from the current directory and generate from all found input files.

specifies the template input file (with no extension) for the specific type, e.g. -ti dll_exe:vc8exe. Each project creator has a default template input file for each type of project (dll_exe, lib_exe, dll, lib). You can override the default template input file name with the -ti option. The file must have a mpt extension and must reside within the include search directories. NOTE: the lib and the lib_exe template input files are only used when MPC is generating static projects

generate a workspace in a hierarchical fashion. Forces the generation of a hierarchical workspace at each directory level in between the toplevel directory and the location of the .mpc file that is being processed. This is the default for make based workspace creators. NOTE: This option has no effect when when used with mpc-ace
specifies the template name (with no extension). file should have a .mpd extension and sit in one of the include search directories. NOTE: The -template option overrides the template file for all types specified

any $() variable in an mpc file that is matched to name is replaced by var only if var can be made into a relative path based on the current working directory

add project as a base project to each generated project file. Do not provide a file extension, the .mpb extension will be tried first; if that fails the .mpc extension will be tried

do not place comments in the generated files

do not try to generate default relative definitions for *_ROOT, which come from environment variables

do not generate the top level target file. Files are still processed, but no top level file is created. For mwc-ace, it says process all projects for a workspace, but do not generate the top level workspace file. For mpc-ace, it says process the .mpc files, but do not generate the project files

specifies that only static projects are generated. By default, only dynamic projects will be generated. This parameter was previously -static_only. Currently, mpc-ace only supports generating dynamic projects or static projects, but not both during the same run. To generate them both you must run mpc-ace twice, once with the -static option and once without. Additionally, the vc6, em3, vc7, vc71 and vc8 project names will no longer automatically have _Static appended to the project name when generating static projects. This can still be achieved by using the -name_modifier option.

When generating static projects, inter-project dependencies will not be generated for libraries within vc6, em3, vc7, and vc71 workspaces. The reason is due to the fact that each static library that depended upon another would be combined at the library creation stage, resulting in extremely large libraries. Dependencies are handled correctly by vc8 and later. This behavior can be modified by setting the MPC_DEPENDENCY_COMBINED_STATIC_LIBRARY environment variable. It will force mpc-ace to generate inter-project dependencies for libraries within a single workspace

generate .ins files after processing each project that can be used in conjunction with the prj_install.pl script to install different parts of the project (such as header files) into an alternate location

use environment variables for all uses of $() instead of the relative replacement values

this option allows modification of a template input name pair. Use += to add val to the name's value. Use -= to subtract and = to override the value. If a template variable value will contain spaces, it is best to enclose the whole setting in double quotes and use single quotes within the value to retain spaces (if it is necessary)

this option allows modification of a project variable assignment. Use += to add val to the name's value. Use -= to subtract and = to override the value. This can be used to introduce new name value pairs to a project. However, it must be a valid project assignment

if multiple make based project types are generated, they will be named such that they can coexist

specifies the features file to read before processing. These feature names can be anything, but they should correspond to values used for the requires and avoids keywords. If a feature is required and is not enabled then the project will not be created. If a feature is to be avoided and it is enabled then the project will not be created. The default feature file is default.features under the config directory

perform direct expansion, instead of performing relative replacement with either -use_env or -relative options

specifies the feature list to set before processing. Values specified by this option overwrite values from features files, e.g. -features "qos=1,ssl=0"
generate .dot files for use with Graphvis. This option, which is only useful with mwc-ace, will result in the generation of .dot files for each workspace processed. Each .dot file will contain information that can be fed to Graphvis to display the dependency information for the various projects found within the workspace.

use this option to exclude directories or files when searching for input files. NOTE: This option has no effect when used with mpc-ace
modify generated workspace or project names. The pattern passed to this parameter will have the * portion replaced with the actual output name. For example -name_modifier '*_Static' will result in all workspace and project names ending in _Static, e.g. FOO_Static.dsw and FOO_Static.dsp
when used in conjunction with -name_modifier, it applies the name modifier to the project name also. NOTE: this option has no effect without the -name_modifier option

Specifies number of child processes to use to generate projects.

The directory for storing temporary output files from the child processes. The default is '/tmp/mpc' If neither -workers_dir nor -workers_port is used, -workers_dir is assumed.

The port number for the parent listener.

print the MPC version and exit

place all output files in a mirrored directory structure starting at directory
specifies the global feature file. The default value is global.features under the config directory

specify the language preference. The default is cplusplus
specifies the type of project file to generate. This option can be used multiple times to generate multiple types. There is no longer a default. NOTE: The -ti option overrides the template input file for all types specified

MPC Codebase Configuration File

This configuration file can be used to specify alternate locations for the MPC Configuration File. If a base.cfg is found underneath the 'config' directory where MPC is executed, it will be read to determine the location of MPC.cfg based on the directory in which MPC was started.

For example, if $MPC_ROOT/mwc-ace is run under /foo/bar_root/src and $MPC_ROOT/config/base.cfg contained:

/foo/bar_root = /foo/bar_root/MPC/config

MPC would attempt to open and read /foo/bar_root/MPC/config/MPC.cfg as the MPC Configuration File. If the base configuration file is not present, MPC will try to use $MPC_ROOT/config/MPC.cfg as the MPC Configuration File.

You may reference environment variables, accessed by $NAME, on either side of the equals sign.

MPC Configuration File

In an effort to move away from the use of environment variables, a configuration file has been introduced. The configuration file (MPC.cfg) can contain settings to provide command line options, control logging and direct MPC to dynamic project types.

The following keywords are allowed in the configuration file, which will be read from the 'config' directory of MPC.

provide additional command line options to MPC. The value of this setting will be prepended to the options passed to mwc-ace or mpc-ace
provide a single project type (as specified by the -type option) as the default project type

this comma separated list points to directories in which MPC will search for Perl modules to implement additional MPC project types, base projects or template files. This setting can be used to augment or replace functionality in MPC. For each suitable directory found, it will add a modules include path for Perl to find modules, add a config include path to locate base projects and a template include path to find MPC templates.

similar to the -include command line option, it adds the list of comma separated paths to the MPC include search paths.

if this setting contains info=1, informational messages will be printed. If it contains warn=1, warning messages will be printed. If it contains diag=1, diagnostic messages will be printed. If it contains debug=1, debug messages will be printed. And lastly, if it contains detail=1, detail messages will be printed. If it contains none of these, mpc-ace will not print out any information or warnings when processing projects or workspaces. Errors are always printed if any are encountered.

if this is set, mwc-ace will warn the user about references to projects in the after keyword that have not been processed

ENVIRONMENT VARIABLES

The following environment variable could affect mwc-ace and mpc-ace:

see the help on -static parameter above

this environment variable is only meaningful when generating the ghs project files. By default, the ghs type assumes that it is for Windows. If this is not the case, set this environment variable prior to running MPC