MPC(1)

πŸ’… MPC(1) ✨ General Commands Manual πŸŽ€

🌸 NAME 🌸

mpc-ace, mwc-ace β€” generate project and workspace files 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

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

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

✨ DESCRIPTION ✨

okay so bestie, sit down, hydrate, because this one is the whole vibe. mpc-ace and mwc-ace β€” aka the Makefile, Project and Workspace Creator β€” generate platform and compiler specific files to automate the compilation process (like GNUmakefile and Makefile.am). it's giving "I will write your build system so you don't have to" and honestly? iconic. πŸ‘‘

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 too, 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. lowkey convenient. πŸ“


🧚 the option menu (no skips, we read ALL of them) πŸ’…

  • -global file β€” specifies the global input file. Values stored within this file are applied to all projects. If not specified, defaults to config/global.mpb
  • -include directory β€” 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 β€” recurse from the current directory and generate from all found input files.
  • -ti dll | lib | dll_exe | lib_exe:file β€” 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 πŸ’€
  • -hierarchy β€” 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
  • -template file β€” 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
  • -relative name=var β€” 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
  • -base project β€” 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
  • -nocomments β€” do not place comments in the generated files
  • -noreldefs β€” do not try to generate default relative definitions for *_ROOT, which come from environment variables
  • -notoplevel β€” 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
  • -static β€” 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

  • -genins β€” 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_env β€” use environment variables for all uses of $() instead of the relative replacement values
  • -value_template name+=val | name=val | name-=val β€” 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)
  • -value_project name+=val | name=val | name-=val β€” 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
  • -make_coexistence β€” if multiple make based project types are generated, they will be named such that they can coexist
  • -feature_file file β€” 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
  • -expand_vars β€” perform direct expansion, instead of performing relative replacement with either -use_env or -relative options
  • -features features β€” 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"
  • -gendot β€” 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.
  • -exclude directories β€” use this option to exclude directories or files when searching for input files.
NOTE: This option has no effect when used with mpc-ace
  • -name_modifier pattern β€” 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
  • -apply_project β€” 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
  • -workers β€” Specifies number of child processes to use to generate projects.
  • -workers_dir β€” 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.
  • -workers_port β€” The port number for the parent listener.
  • -version β€” print the MPC version and exit
  • -into directory β€” place all output files in a mirrored directory structure starting at directory
  • -gfeature_file file β€” specifies the global feature file. The default value is global.features under the config directory
  • -language cplusplus | csharp | java | vb β€” specify the language preference. The default is cplusplus
  • -type automake | bcb2007 | bcb2009 | bds4 | bmake | cc | em3 | ghs | html | make | nmake | sle | vc6 | vc7 | vc71 | vc8 | vc9 | vc10 | wb26 β€” 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 πŸŽ€

Okay so listen, bestie πŸ’– β€” the old way of doing things was all environment variables, and honestly? Not it. So they introduced a whole configuration file. Enter MPC.cfg, and she is serving. This file can hold settings that hand command line options to MPC, control logging, and point MPC at dynamic project types.

She lives in the config directory of MPC, iykyk. Here are the keywords you're allowed to use in there πŸ‘‡

  • command_line β€” this is how you feed extra command line options to MPC. Whatever value you put here gets prepended to the options that get passed along to mwc-ace or mpc-ace. Lowkey powerful.
  • default_type β€” drop a single project type in here (the kind you'd normally specify with the -type option) and it becomes your default project type. No more typing it every single time. Periodt.
  • dynamic_types β€” a comma separated list of directories where MPC goes hunting for Perl modules that implement extra MPC project types, base projects, or template files. This one can augment or replace functionality in MPC, which is giving main character energy fr. For every suitable directory it finds, it adds a modules include path so Perl can find the modules, adds a config include path so base projects get located, and adds a template include path so MPC templates get found. Three for one, we love that.
  • includes β€” basically the -include command line option's sibling. It takes a comma separated list of paths and adds them to the MPC include search paths.
  • logging β€” the vibe control for your output. Here's the breakdown:
    • contains info=1 β†’ informational messages get printed
    • contains warn=1 β†’ warning messages get printed
    • contains diag=1 β†’ diagnostic messages get printed
    • contains debug=1 β†’ debug messages get printed
    • contains detail=1 β†’ detail messages get printed

And if it contains none of these? mpc-ace will not print out any information or warnings when it's processing projects or workspaces. Silence. 🀫 But heads up β€” errors are always printed if any are encountered. No hiding those, bestie, they will find you.

  • verbose_ordering β€” set this and mwc-ace will warn you about references to projects in the after keyword that haven't been processed yet. Your little accountability buddy 🫢

✨ ENVIRONMENT VARIABLES ✨

These two can affect mwc-ace and mpc-ace, so pay attention πŸ‘‘

  • MPC_DEPENDENCY_COMBINED_STATIC_LIBRARY β€” see the help on the -static parameter above. That's the whole assignment, go read it πŸ’…
  • MPC_GHS_UNIX β€” this one only matters when you're generating ghs project files. By default, the ghs type just assumes it's for Windows. Which, rude, but okay. If that's not your situation, set this environment variable before running MPC. Timing is everything, bestie ⏰
Not me reminding you again that env vars are the old way β€” the config file is right there, she's cute, she's organized, she's waiting. But these two are still real and still do things, so no cap.

Okay that's the whole page, bestie 🌸 You just read the <rainbow>MPC(1)</rainbow> manual β€” source MPC, with whatever version and date stamp your local install is carrying (go peek at the bottom of your own copy if you need the exact numbers, I'm not about to make them up πŸ™ˆ). Now go configure something iconic. πŸ’œ