107 |
bj |
1 |
Running the Workspace Generator
|
|
|
2 |
-------------------------------
|
|
|
3 |
|
|
|
4 |
The most common way to use the Make Project Creator is to run the
|
|
|
5 |
workspace generator (mwc.pl). This script will generate projects and a
|
|
|
6 |
single workspace that contains the generated projects. If no input file
|
|
|
7 |
(.mwc file) is specified, it will recurse into the directory in which the
|
|
|
8 |
script was started. It looks for .mpc files and generates a project or
|
|
|
9 |
projects for each one found.
|
|
|
10 |
|
|
|
11 |
|
|
|
12 |
Usage: mwc.pl [-global <file>] [-include <directory>] [-recurse]
|
|
|
13 |
[-ti <dll | lib | dll_exe | lib_exe>:<file>] [-hierarchy]
|
|
|
14 |
[-template <file>] [-relative NAME=VAR] [-base <project>]
|
|
|
15 |
[-noreldefs] [-notoplevel] [-static] [-genins] [-use_env]
|
|
|
16 |
[-value_template <NAME+=VAL | NAME=VAL | NAME-=VAL>]
|
|
|
17 |
[-value_project <NAME+=VAL | NAME=VAL | NAME-=VAL>]
|
|
|
18 |
[-make_coexistence] [-feature_file <file name>]
|
|
|
19 |
[-expand_vars] [-features <feature definitions>]
|
|
|
20 |
[-exclude <directories>] [-name_modifier <pattern>]
|
|
|
21 |
[-apply_project] [-version] [-into <directory>]
|
|
|
22 |
[-language <cplusplus | csharp | java | vb>]
|
|
|
23 |
[-type <automake | bmake | cbx | em3 | ghs | html |
|
|
|
24 |
make | nmake | sle | vc6 | vc7 | vc71 |
|
|
|
25 |
vc8>]
|
|
|
26 |
[files]
|
|
|
27 |
|
|
|
28 |
-base Add <project> as a base project to each generated
|
|
|
29 |
project file. Do not provide a file extension, the
|
|
|
30 |
.mpb extension will be tried first; if that fails the
|
|
|
31 |
.mpc extension will be tried.
|
|
|
32 |
-exclude Use this option to exclude directories when searching
|
|
|
33 |
for input files.
|
|
|
34 |
-expand_vars Perform direct expansion, instead of performing relative
|
|
|
35 |
replacement with either -use_env or -relative options.
|
|
|
36 |
-feature_file Specifies the feature file to read before processing.
|
|
|
37 |
The default feature file is default.features under the
|
|
|
38 |
config directory.
|
|
|
39 |
-features Specifies the feature list to set before processing.
|
|
|
40 |
-genins Generate .ins files for use with prj_install.pl.
|
|
|
41 |
-global Specifies the global input file. Values stored
|
|
|
42 |
within this file are applied to all projects.
|
|
|
43 |
-hierarchy Generate a workspace in a hierarchical fashion.
|
|
|
44 |
-include Specifies a directory to search when looking for base
|
|
|
45 |
projects, template input files and templates. This
|
|
|
46 |
option can be used multiple times to add directories.
|
|
|
47 |
-into Place all output files in a mirrored directory
|
|
|
48 |
structure starting at <directory>.
|
|
|
49 |
-language Specify the language preference. The default is
|
|
|
50 |
cplusplus.
|
|
|
51 |
-make_coexistence If multiple 'make' based project types are
|
|
|
52 |
generated, they will be named such that they can coexist.
|
|
|
53 |
-name_modifier Modify output names. The pattern passed to this
|
|
|
54 |
parameter will have the '*' portion replaced with the
|
|
|
55 |
actual output name. Ex. *_Static
|
|
|
56 |
-apply_project When used in conjunction with -name_modifier, it applies
|
|
|
57 |
the name modifier to the project name also.
|
|
|
58 |
-noreldefs Do not try to generate default relative definitions.
|
|
|
59 |
-notoplevel Do not generate the top level target file. Files
|
|
|
60 |
are still process, but no top level file is created.
|
|
|
61 |
-recurse Recurse from the current directory and generate from
|
|
|
62 |
all found input files.
|
|
|
63 |
-relative Any $() variable in an mpc file that is matched to NAME
|
|
|
64 |
is replaced by VAR only if VAR can be made into a
|
|
|
65 |
relative path based on the current working directory.
|
|
|
66 |
-static Specifies that only static projects will be generated.
|
|
|
67 |
By default, only dynamic projects are generated.
|
|
|
68 |
-ti Specifies the template input file (with no extension)
|
|
|
69 |
for the specific type (ex. -ti dll_exe:vc8exe).
|
|
|
70 |
-template Specifies the template name (with no extension).
|
|
|
71 |
-type Specifies the type of project file to generate. This
|
|
|
72 |
option can be used multiple times to generate multiple
|
|
|
73 |
types. If -type is not used, it defaults to 'make'.
|
|
|
74 |
-use_env Use environment variables for all uses of $() instead
|
|
|
75 |
of the relative replacement values.
|
|
|
76 |
-value_project This option allows modification of a project variable
|
|
|
77 |
assignment . Use += to add VAL to the NAME's value.
|
|
|
78 |
Use -= to subtract and = to override the value.
|
|
|
79 |
This can be used to introduce new name value pairs to
|
|
|
80 |
a project. However, it must be a valid project
|
|
|
81 |
assignment.
|
|
|
82 |
-value_template This option allows modification of a template input
|
|
|
83 |
name value pair. Use += to add VAL to the NAME's
|
|
|
84 |
value. Use -= to subtract and = to override the value.
|
|
|
85 |
-version Print the MPC version and exit.
|
|
|
86 |
|
|
|
87 |
The default global input file (config/global.mpb) is used if -global
|
|
|
88 |
is not specified on the command line.
|
|
|
89 |
|
|
|
90 |
Two include directories are used by default (config and templates).
|
|
|
91 |
|
|
|
92 |
Each project creator has a default template input file for each type of
|
|
|
93 |
project (dll_exe, lib_exe, dll, lib). You can override the default template
|
|
|
94 |
input file name with the -ti option. The file must have a 'mpt' extension
|
|
|
95 |
and must reside within the include search directories. NOTE: the 'lib' and
|
|
|
96 |
the 'lib_exe' template input files are only used if the project creator makes
|
|
|
97 |
a separate project file for dynamic libraries and static libraries.
|
|
|
98 |
|
|
|
99 |
The -exclude option is used to exclude directories when searching for input
|
|
|
100 |
files. NOTE: This option has no effect when used with mpc.pl.
|
|
|
101 |
|
|
|
102 |
The -genins option will cause MPC to generate an "install" file after
|
|
|
103 |
processing each project that can be used in conjunction with the
|
|
|
104 |
prj_install.pl script to install different parts of the project (such as
|
|
|
105 |
header files) into an alternate location.
|
|
|
106 |
|
|
|
107 |
The -hierarchy option is used to force the generation of a hierarchical
|
|
|
108 |
workspace at each directory level in between the toplevel directory and the
|
|
|
109 |
location of the mpc file that is being processed. This is the default for
|
|
|
110 |
"make" based workspace creators. NOTE: This option only has an effect when
|
|
|
111 |
passed to mwc.pl.
|
|
|
112 |
|
|
|
113 |
The -template option is used to override the default template name. This
|
|
|
114 |
file should have a .mpd extension and sit in one of the include search
|
|
|
115 |
directories. NOTE: The -template option overrides the template file for all
|
|
|
116 |
types specified.
|
|
|
117 |
|
|
|
118 |
The -static option can be used to generate only static project files.
|
|
|
119 |
|
|
|
120 |
The -static_only option has been replaced by the -static option. Currently,
|
|
|
121 |
MPC only supports generating dynamic projects or static projects, but not
|
|
|
122 |
both during the same run. To generate them both you must run MPC twice, once
|
|
|
123 |
with the -static option and once without. Additionally, the vc6, em3, vc7,
|
|
|
124 |
vc71 and vc8 project names will no longer automatically have _Static
|
|
|
125 |
appended to the project name when generating static projects. This can
|
|
|
126 |
still be achieved by using the -name_modifier option.
|
|
|
127 |
|
|
|
128 |
When generating static projects, inter-project dependencies will not be
|
|
|
129 |
generated for libraries within vc6, em3, vc7, vc71 and vc8 workspaces. The
|
|
|
130 |
reason is due to the fact that each static library that depended upon another
|
|
|
131 |
would be combined at the library creation stage, resulting in extremely large
|
|
|
132 |
libraries.
|
|
|
133 |
|
|
|
134 |
This behavior can be modified by setting the
|
|
|
135 |
MPC_DEPENDENCY_COMBINED_STATIC_LIBRARY environment variable. It will force
|
|
|
136 |
MPC to generate inter-project dependencies for libraries within a single
|
|
|
137 |
workspace.
|
|
|
138 |
|
|
|
139 |
The -name_modifier option can be used to modify the generated workspace or
|
|
|
140 |
project name. The parameter to the -name_modifier option is a pattern where
|
|
|
141 |
an asterisk (*) within the pattern is replaced by the actual workspace or
|
|
|
142 |
project name. Thus, passing -name_modifier '*_Static' to mwc.pl will result
|
|
|
143 |
in all workspace and project names ending in _Static. (Ex. FOO_Static.dsw,
|
|
|
144 |
FOO_Static.dsp, etc.)
|
|
|
145 |
|
|
|
146 |
The -apply_project option, when used in conjunction with the -name_modifier
|
|
|
147 |
option, causes MPC to apply the name modifier to the project name in
|
|
|
148 |
addition to the workspace and project file names. This option has no effect
|
|
|
149 |
outside the scope of the -name_modifier option.
|
|
|
150 |
|
|
|
151 |
The -noreldefs option says not to generate default relative definitions for
|
|
|
152 |
*_ROOT (which comes from environment variables).
|
|
|
153 |
|
|
|
154 |
The -notoplevel option tells mwc.pl to generate all projects for a
|
|
|
155 |
workspace, but do not generate the top level workspace file. For mpc.pl, it
|
|
|
156 |
says process the mpc files, but do not generate the project files.
|
|
|
157 |
|
|
|
158 |
The -recurse option is used to search for all files that could be processed
|
|
|
159 |
from the current directory and its sub-directories. If directories are
|
|
|
160 |
passed in a comma separated list (e.g -recurse=examples,apps,TAO), then
|
|
|
161 |
those directories will be excluded when searching for project or workspace
|
|
|
162 |
files.
|
|
|
163 |
|
|
|
164 |
The -type option can be used multiple times on the same command line to
|
|
|
165 |
generate projects of different types per mpc file. The default type for
|
|
|
166 |
this version of MPC is 'make'. NOTE: The -ti option overrides the template
|
|
|
167 |
input file for all types specified.
|
|
|
168 |
|
|
|
169 |
The -feature_file specifies a file to be read that enables or disables
|
|
|
170 |
features. These feature names can be anything, but they should correspond
|
|
|
171 |
to values used for the 'requires' and 'avoids' keywords. If a feature is
|
|
|
172 |
required and is not enable then the project will not be created. If a
|
|
|
173 |
feature is to be avoided and it is enabled then the project will not be
|
|
|
174 |
created.
|
|
|
175 |
|
|
|
176 |
The -features specifies additional list of features values. Values
|
|
|
177 |
specified by this option overwrite values from features files.
|
|
|
178 |
Example:
|
|
|
179 |
mwc.pl -features "qos=1,ssl=0" ace.mwc
|
|
|
180 |
|
|
|
181 |
|
|
|
182 |
Running only the Project Generator
|
|
|
183 |
----------------------------------
|
|
|
184 |
|
|
|
185 |
Most of what is stated about the Workspace Generator applies to the Project
|
|
|
186 |
Generator except that it only generates projects. If an input file (.mpc
|
|
|
187 |
file) is not provided, the project creator will attempt to create a default
|
|
|
188 |
project in the directory from which the script was started.
|
|
|
189 |
|
|
|
190 |
|
|
|
191 |
Environment Variables
|
|
|
192 |
---------------------
|
|
|
193 |
|
|
|
194 |
MPC_COMMANDLINE - The value of this environment variable will be prepended
|
|
|
195 |
to the options passed to mwc.pl or mpc.pl (if any are passed).
|
|
|
196 |
|
|
|
197 |
MPC_VERBOSE_ORDERING - If this is set, mwc.pl will warn the user about
|
|
|
198 |
references to projects in the 'after' keyword that have not been processed.
|
|
|
199 |
|
|
|
200 |
MPC_DEPENDENCY_COMBINED_STATIC_LIBRARY - See the -static section above.
|
|
|
201 |
|
|
|
202 |
MPC_SILENT - If this is set, MPC will not print out any information or
|
|
|
203 |
warnings when processing projects or workspaces. Errors are always printed
|
|
|
204 |
if any are encountered.
|
|
|
205 |
|
|
|
206 |
MPC_LOGGING - If this is set, MPC will parse the value and provide
|
|
|
207 |
informational, warning, diagnostic and detail messages depending on it's
|
|
|
208 |
setting. If the MPC_LOGGING value contains info=1, informational messages
|
|
|
209 |
will be printed. If it contains warn=1, warning messages will be printed.
|
|
|
210 |
If it contains diag=1, diagnostic messages will be printed.
|
|
|
211 |
And lastly, if it contains detail=1, detail messages will be printed. If it
|
|
|
212 |
contains none of these, MPC will act as if MPC_SILENT was set.
|