summaryrefslogtreecommitdiff
path: root/ACE/MPC/docs/MPC.sgml
blob: c6a8765b835fd6ad8cc6ef5e68f19b2dc2609c90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
  <!ENTITY mpc "mpc.pl">
  <!ENTITY mwc "mwc.pl">
]>
<!-- This file was written by Thomas Girard <thomas.g.girard@free.fr>   -->
<!-- on May 2006 for the Debian GNU/Linux operating system.             -->
<!-- It is mainly a plain text to DocBook conversion of the USAGE file. -->
<refentry>
  <refmeta>
    <refentrytitle>MPC</refentrytitle>
    <manvolnum>1</manvolnum>
  </refmeta>
  <refnamediv>
    <refname>&mpc;, &mwc;</refname>
    <refpurpose>generate project and workspace files</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      <command>&mpc;</command>
      <arg rep="repeat"><replaceable>OPTION</replaceable></arg>
      <arg rep="repeat"><replaceable>FILE</replaceable></arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>&mwc;</command>
      <arg rep="repeat"><replaceable>OPTION</replaceable></arg>
      <arg rep="repeat"><replaceable>FILE</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1>
    <title>DESCRIPTION</title>
    <para>
    <command>&mpc;</command> and <command>&mwc;</command>, the Makefile,
    Project and Workspace Creator generate platform and compiler specific
    files to automate the compilation process
    (e.g. <filename>GNUmakefile</filename>
    and <filename>Makefile.am</filename>).
    </para>
    <para>
    The most common way to use the Make Project Creator is to run the
    workspace generator (<command>&mwc;</command>).  This script will
    generate projects and a single workspace that contains the generated
    projects.  If no input
    <replaceable>FILE</replaceable> (<filename>.mwc</filename> file)
    is specified, it will recurse into
    the directory in which the script was started.  It looks for
    <filename>.mpc</filename> files and generates a project or projects
    for each one found.
    </para>
    <para>
    Most of what is stated about <command>&mwc;</command> applies to
    <command>&mpc;</command> except that it only generates projects.  If an
    input <replaceable>FILE</replaceable> (<filename>.mpc</filename> file) is
    not provided, the project creator will attempt to create a default
    project in the directory from which the script was started.
    </para>
    <variablelist>
      <varlistentry>
        <term><parameter>-global</parameter> <replaceable>file</replaceable></term>
        <listitem>
          <para>
	  specifies the global input file.  Values stored within this file are
	  applied to all projects.  If not specified, defaults to
	  <filename>config/global.mpb</filename>
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-include</parameter> <replaceable>directory</replaceable></term>
        <listitem>
          <para>
	  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 (<filename class="directory">config</filename>
	  and <filename class="directory">templates</filename>)
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-recurse</parameter></term>
        <listitem>
          <para>
	  recurse from the current directory and generate from all found
	  input files.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-ti dll | lib | dll_exe | lib_exe:</parameter><replaceable>file</replaceable></term>
        <listitem>
          <para>
	  specifies the template input file (with no extension) for the
	  specific type, e.g. <parameter>-ti dll_exe:vc8exe</parameter>.  Each
	  project creator has a default template input file for each type of
	  project (<parameter>dll_exe</parameter>, <parameter>lib_exe</parameter>,
	  <parameter>dll</parameter>, <parameter>lib</parameter>).  You can
	  override the default template input file name with the
	  <parameter>-ti</parameter> option.  The file must have a
	  <filename>mpt</filename> extension and must reside within the
	  include search directories.  NOTE: the <parameter>lib</parameter>
	  and the <parameter>lib_exe</parameter> template input files are only
	  used when MPC is generating static projects
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-hierarchy</parameter></term>
        <listitem>
          <para>
	  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
	  <filename>.mpc</filename> file that is being processed.  This is the
	  default for <parameter>make</parameter> based workspace creators.
	  NOTE: This option has no effect when when used with
	  <command>&mpc;</command>
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-template</parameter> <replaceable>file</replaceable></term>
        <listitem>
          <para>
	  specifies the template name (with no extension).
	  <replaceable>file</replaceable> should have a
	  <filename>.mpd</filename> extension and sit in one of the include
	  search directories.  NOTE: The <parameter>-template</parameter>
	  option overrides the template file for all types specified
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-relative</parameter> <replaceable>name</replaceable>=<replaceable>var</replaceable></term>
        <listitem>
          <para>
	  any <varname>$()</varname> variable in an mpc file that is matched to
	  <replaceable>name</replaceable> is replaced by
	  <replaceable>var</replaceable> only if
	  <replaceable>var</replaceable> can be made into a relative path based
	  on the current working directory
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-base</parameter> <replaceable>project</replaceable></term>
        <listitem>
          <para>
	  add <replaceable>project</replaceable> as a base project to each
	  generated project file.  Do not provide a file extension, the
	  <filename>.mpb</filename> extension will be tried first; if that
	  fails the <filename>.mpc</filename> extension will be tried
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-nocomments</parameter></term>
        <listitem>
          <para>
	  do not place comments in the generated files
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-noreldefs</parameter></term>
        <listitem>
          <para>
	  do not try to generate default relative definitions for
	  <varname>*_ROOT</varname>, which come from environment variables
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-notoplevel</parameter></term>
        <listitem>
          <para>
	  do not generate the top level target file.  Files are still processed,
	  but no top level file is created.  For <command>&mwc;</command>, it
	  says process all projects for a workspace, but do not generate the
	  top level workspace file.  For <command>&mpc;</command>, it says
	  process the <filename>.mpc</filename> files, but do not generate
	  the project files
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-static</parameter></term>
        <listitem>
          <para>
	  specifies that only static projects are generated.  By default,
	  only dynamic projects will be generated.  This parameter was
	  previously <parameter>-static_only</parameter>.  Currently,
	  <command>&mpc;</command> only supports generating dynamic projects
	  or static projects, but not both during the same run.  To generate
	  them both you must run <command>&mpc;</command> twice, once with the
	  <parameter>-static</parameter> option and once without.
	  Additionally, the <parameter>vc6</parameter>,
	  <parameter>em3</parameter>, <parameter>vc7</parameter>,
	  <parameter>vc71</parameter> and <parameter>vc8</parameter> project
	  names will no longer automatically have
	  <filename>_Static</filename> appended to the project name when
	  generating static projects.  This can still be achieved by using the
	  <parameter>-name_modifier</parameter> option.
	  </para>
	  <para>
	  When generating static projects, inter-project dependencies will
	  not be generated for libraries within <parameter>vc6</parameter>,
	  <parameter>em3</parameter>, <parameter>vc7</parameter>,
	  and <parameter>vc71</parameter>  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
	  <envar>MPC_DEPENDENCY_COMBINED_STATIC_LIBRARY</envar> environment
	  variable.  It will force <command>&mpc;</command> to generate
	  inter-project dependencies for libraries within a single workspace
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-genins</parameter></term>
        <listitem>
          <para>
	  generate <filename>.ins</filename> files after
	  processing each project that can be used in conjunction with the
	  <command>prj_install.pl</command> script to install different
	  parts of the project (such as header files) into an alternate
	  location
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-use_env</parameter></term>
        <listitem>
          <para>
	  use environment variables for all uses of
	  <varname>$()</varname> instead of the relative replacement values
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-value_template</parameter> <replaceable>name</replaceable><parameter>+=</parameter><replaceable>val</replaceable> | <replaceable>name</replaceable><parameter>=</parameter><replaceable>val</replaceable> | <replaceable>name</replaceable><parameter>-=</parameter><replaceable>val</replaceable></term>
        <listitem>
          <para>
	  this option allows modification of a template input name pair.  Use
	  <parameter>+=</parameter> to add
	  <replaceable>val</replaceable> to the
	  <replaceable>name</replaceable>'s value.  Use
	  <parameter>-=</parameter> to subtract and <parameter>=</parameter> 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)
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-value_project</parameter> <replaceable>name</replaceable><parameter>+=</parameter><replaceable>val</replaceable> | <replaceable>name</replaceable><parameter>=</parameter><replaceable>val</replaceable> | <replaceable>name</replaceable><parameter>-=</parameter><replaceable>val</replaceable></term>
        <listitem>
          <para>
	  this option allows modification of a project variable
	  assignment.  Use <parameter>+=</parameter> to add
	  <replaceable>val</replaceable> to the
	  <replaceable>name</replaceable>'s value.  Use
	  <parameter>-=</parameter> to subtract and <parameter>=</parameter> 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
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-make_coexistence</parameter></term>
        <listitem>
          <para>
	  if multiple <command>make</command> based project types are generated,
	  they will be named such that they can coexist
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-feature_file</parameter> <replaceable>file</replaceable></term>
        <listitem>
          <para>
	  specifies the features file to read before processing.  These
	  feature names can be anything, but they should correspond
	  to values used for the <property>requires</property> and
	  <property>avoids</property> 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
	  <filename>default.features</filename> under the
	  <filename class="directory">config</filename> directory
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-expand_vars</parameter></term>
        <listitem>
          <para>
	  perform direct expansion, instead of performing relative replacement
	  with either <parameter>-use_env</parameter> or
	  <parameter>-relative</parameter> options
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-features</parameter> <replaceable>features</replaceable></term>
        <listitem>
          <para>
	  specifies the feature list to set before processing.  Values
	  specified by this option overwrite values from features files,
	  e.g. <parameter>-features "qos=1,ssl=0"</parameter>
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-gendot</parameter></term>
        <listitem>
          <para>
	  generate .dot files for use with <command>Graphvis</command>.
	  This option, which is only useful with <command>&mwc;</command>,
	  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.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-exclude</parameter> <replaceable>directories</replaceable></term>
        <listitem>
          <para>
	  use this option to exclude directories or files when searching for
          input files.  NOTE: This option has no effect when used with
	  <command>&mpc;</command>
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-name_modifier</parameter> <replaceable>pattern</replaceable></term>
        <listitem>
          <para>
	  modify generated workspace or project names.  The
	  <replaceable>pattern</replaceable> passed
	  to this parameter will have the <filename>*</filename> portion
	  replaced with the actual output name.  For example
	  <parameter>-name_modifier '*_Static'</parameter> will result in all
	  workspace and project names ending in <filename>_Static</filename>,
	  e.g. <filename>FOO_Static.dsw</filename> and
	  <filename>FOO_Static.dsp</filename>
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-apply_project</parameter></term>
        <listitem>
          <para>
	  when used in conjunction with <parameter>-name_modifier</parameter>,
	  it applies the name modifier to the project name also.  NOTE: this
	  option has no effect without the
	  <parameter>-name_modifier</parameter> option
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-version</parameter></term>
        <listitem>
          <para>
	  print the MPC version and exit
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-into</parameter> <replaceable>directory</replaceable></term>
        <listitem>
          <para>
	  place all output files in a mirrored directory structure starting
	  at <replaceable>directory</replaceable>
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-gfeature_file</parameter> <replaceable>file</replaceable></term>
        <listitem>
          <para>
	  specifies the global feature file.  The default value is
	  <filename>global.features</filename> under the
	  <filename class="directory">config</filename> directory
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-language cplusplus | csharp | java | vb</parameter></term>
        <listitem>
          <para>
	  specify the language preference.  The default is
	  <parameter>cplusplus</parameter>
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>-type automake | bcb2007 | bcb2009 | bds4 | bmake | cc | em3 | ghs | html | make | nmake | sle | vc6 | vc7 | vc71 | vc8 | vc9 | vc10 | wb26</parameter></term>
        <listitem>
          <para>
	  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 <parameter>-ti</parameter>
	  option overrides the template input file for all types specified
          </para>
        </listitem>
      </varlistentry>

    </variablelist>
    <refsect2>
      <title>MPC Codebase Configuration File</title>
      <para>
      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.
      </para>
      <para>
      For example, if $MPC_ROOT/mwc.pl is run under /foo/bar_root/src and
      $MPC_ROOT/config/base.cfg contained:
      </para>
      <para>
      /foo/bar_root = /foo/bar_root/MPC/config
      </para>
      <para>
      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.
      </para>
      <para>
      You may reference environment variables, accessed by $NAME, on either side
      of the equals sign.
      </para>
    </refsect2>
    <refsect2>
      <title>MPC Configuration File</title>
      <para>
      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.
      </para>
      <para>
      The following keywords are allowed in the configuration file, which will
      be read from the 'config' directory of MPC.
      </para>
      <para>
        <variablelist>
          <varlistentry>
            <term><parameter>command_line</parameter></term>
            <listitem>
              <para>
              provide additional command line options to MPC.  The value of
              this setting will be prepended to the options passed to
              <command>&mwc;</command> or <command>&mpc;</command>
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term><parameter>default_type</parameter></term>
            <listitem>
              <para>
              provide a single project type (as specified by the -type
              option) as the default project type
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term><parameter>dynamic_types</parameter></term>
            <listitem>
              <para>
              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
              <property>modules</property> include path for Perl to find
              modules, add a <property>config</property> include path to
              locate base projects and a <property>template</property>
              include path to find MPC templates.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term><parameter>includes</parameter></term>
            <listitem>
              <para>
              similar to the -include command line option, it adds the
              list of comma separated paths to the MPC include search paths.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term><envar>logging</envar></term>
            <listitem>
              <para>
              if this setting contains
              <property>info=1</property>, informational
              messages will be printed.  If it contains
              <property>warn=1</property>, warning
              messages will be printed.  If it contains
              <property>diag=1</property>, diagnostic
              messages will be printed.  If it contains
              <property>debug=1</property>, debug
              messages will be printed.  And lastly, if it contains
              <property>detail=1</property>,
              detail messages will be printed.  If it contains none of these,
              <command>&mpc;</command> will not print out any information or
              warnings when processing projects or workspaces.  Errors are
              always printed if any are encountered.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term><envar>verbose_ordering</envar></term>
            <listitem>
              <para>
              if this is set, <command>&mwc;</command> will warn the user about
              references to projects in the <property>after</property> keyword
              that have not been processed
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </para>
    </refsect2>
    <refsect2>
      <title>ENVIRONMENT VARIABLES</title>
      <para>
        The following environment variable could affect
        <command>&mwc;</command> and <command>&mpc;</command>:

        <variablelist>
          <varlistentry>
            <term><envar>MPC_DEPENDENCY_COMBINED_STATIC_LIBRARY</envar></term>
            <listitem>
              <para>
              see the help on <parameter>-static</parameter> parameter above
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term><envar>MPC_GHS_UNIX</envar></term>
            <listitem>
              <para>
              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
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </para>
    </refsect2>
  </refsect1>
</refentry>