Debian Codegraph @

MPC/docs/html/MakeProjectCreator.html

raw symbols SCIP
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
3 <html>
4 <head>
5 <meta name="generator" content=
6 "HTML Tidy for Linux (vers 1 September 2005), see www.w3.org">
7 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
8 <meta http-equiv="Content-Style-Type" content="text/css">
9 <link rel="STYLESHEET" href="MakeProjectCreator.css" charset="ISO-8859-1"
10 type="text/css">
11
12 <title>MPC</title>
13 </head>
14
15 <body bgcolor="#FFFFFF">
16 <div>
17 <h2 class="ChapterNum">&nbsp;</h2>
18 </div>
19
20 <div>
21 <h1 class="Head1">The Makefile, Project, and Workspace Creator (MPC)</h1>
22
23 <div>
24 <h3 class="Head2">Introduction</h3>
25 <hr>
26
27 <p class="Body">
28 Maintaining multiple build tool files for a
29 multi-platform project can be quite a challenge, especially when the
30 project structure and platforms are constantly changing and evolving.
31 A project may support Makefiles, Visual C++ project files, Borland
32 Makefiles, and many others. Adding files, deleting files, changing
33 project options or even changing the name of the target within your
34 project will require you to expend time updating each build tool
35 file. What you need instead is a single location to store project
36 specific information to avoid repetitious, tedious modifications to
37 multiple build tool files. This is where Makefile Project Creator
38 (MPC) comes into the picture.
39 </p>
40
41 <p class="Body">
42 MPC can be used to generate build tool specific
43 project files from a generic mpc file. The MPC project file is a
44 collection of source files that make up a single build target. MPC
45 uses platform specific input along with mpc files and generates build
46 tool specific files like makefiles, Visual C++ workspace and project
47 files, Visual Studio solution and project files, etc.
48 </p>
49
50 <p class="Body">
51 MPC provides many advantages over the build tool
52 files it replaces. It provides mechanisms for minimizing maintenance
53 of project build files. It does this through support for project
54 inheritance and defaults for all aspects of a project, and the syntax
55 is simple and easy to use and maintain. These and other features will
56 be discussed in detail in the following sections. The structure and
57 syntax of the MPC files are described in the
58 <a href="#Writing_MPC_Files">Writing MPC and MWC Files</a> section.
59 In addition, a complete example of the use of MPC is shown in the <a href=
60 "MakeProjectCreator.html#ExampleMPCFile" class="XRef">
61 Example MPC
62 File
63 </a> section.
64 </p>
65 </div>
66
67 <div>
68 <h3 class="Head2">Using MPC</h3>
69 <hr>
70
71 <p class="Body">
72 An MPC project is a set of parameters that describe
73 an individual build target (such as a library or executable). These
74 parameters include the target name, include paths, source files,
75 header files, etc. One or more projects can be defined within a
76 single mpc file. An MPC workspace is just an arbitrary collection of
77 projects.
78 </p>
79
80 <p class="Body">
81 Projects can be generated (without workspaces) by
82 using the mpc.pl script. Multiple mpc files can be passed to this
83 script. If no mpc files are passed to the script, it will search for
84 project-related files (such as source files, header files, etc.) and
85 incorporate them into a default project.
86 </p>
87
88 <p class="Body">
89 <a name="Figure_1-2"></a>This diagram shows a
90 high-level view of project file generation using mpc.pl.
91 </p>
92
93 <p class="Body">
94 <h6 class="FigTitle">Generating projects with mpc.pl</h6>
95
96 <table border="1" summary="Generating projects with mpc.pl">
97 <tr>
98 <td rowspan="1" colspan="1">
99 <p class="Tbl-Body">&nbsp;</p>
100
101 <div>
102 <img src="images/mpc.png" alt=
103 "Generating projects with mpc.pl">
104 </div>
105 </td>
106 </tr>
107 </table>
108 </p>
109
110 <p class="Body">
111 To generate workspaces, you must run <em class=
112 "Code">mwc.pl</em>. This script will generate projects from mpc files
113 and create a workspace based on those mpc files. If no mwc files are
114 passed to the script, it will search in the current directory and its
115 subdirectories for all mpc files and incorporate them into a single
116 workspace.
117 </p>
118
119 <p class="Body">
120 For make based project types (make, gnuace, bmake,
121 nmake), a workspace is just a top-level makefile. But, for graphical
122 interfaces such as Visual Studio, a workspace is the top-level file
123 that groups all of the project files together.
124 </p>
125
126 <p class="Body">
127 The following diagram shows a high-level view of
128 workspace file generation using mwc.pl.
129 </p>
130
131 <h6 class="FigTitle">Generating workspaces with mwc.pl</h6>
132
133 <p class="Body">
134 <table border="1" summary="Generating workspaces with mwc.pl">
135 <tr>
136 <td rowspan="1" colspan="1">
137 <p class="Tbl-Body">&nbsp;</p>
138
139 <div>
140 <img src="images/mwc.png" alt=
141 "Generating workspaces with mwc.pl">
142 </div>
143 </td>
144 </tr>
145 </table>
146 </p>
147
148
149
150 <div>
151 <h4 class="Head3">Supported Build Tools</h4>
152
153
154 <p class="BodyNoLead">
155 MPC generates workspaces and projects for use with
156 many build tools. This table lists the MPC types (used with
157 mpc&rsquo;s <em class="Code">-type</em> option) and their
158 associated build tools.
159 </p>
160
161
162 <h6 class="NumberedTableTitle">MPC Types</h6>
163
164 <p class="Body">
165 <table border="1" summary="MPC Types">
166 <tr>
167 <th rowspan="1" colspan="1">
168 <p class="Tbl-Heading">Type</p>
169 </th>
170
171 <th rowspan="1" colspan="1">
172 <p class="Tbl-Heading">Build Tool</p>
173 </th>
174 </tr>
175
176 <tr>
177 <td rowspan="1" colspan="1">
178 <p class="Tbl-Body">
179 <em class="TableCode">automake</em>
180 </p>
181 </td>
182
183 <td rowspan="1" colspan="1">
184 <p class="Tbl-Body">GNU Automake.</p>
185 </td>
186 </tr>
187
188 <tr>
189 <td rowspan="1" colspan="1">
190 <p class="Tbl-Body">
191 <em class="TableCode">bcb2007</em>
192 </p>
193 </td>
194
195 <td rowspan="1" colspan="1">
196 <p class="Tbl-Body">Borland C++ Builder 2007.</p>
197 </td>
198 </tr>
199
200 <tr>
201 <td rowspan="1" colspan="1">
202 <p class="Tbl-Body">
203 <em class="TableCode">bcb2009</em>
204 </p>
205 </td>
206
207 <td rowspan="1" colspan="1">
208 <p class="Tbl-Body">CodeGear C++ Builder 2009.</p>
209 </td>
210 </tr>
211
212 <tr>
213 <td rowspan="1" colspan="1">
214 <p class="Tbl-Body">
215 <em class="TableCode">bds4</em>
216 </p>
217 </td>
218
219 <td rowspan="1" colspan="1">
220 <p class="Tbl-Body">
221 Support for Borland Developer Studio 4
222 is incomplete.
223 </p>
224 </td>
225 </tr>
226
227 <tr>
228 <td rowspan="1" colspan="1">
229 <p class="Tbl-Body">
230 <em class="TableCode">bmake</em>
231 </p>
232 </td>
233
234 <td rowspan="1" colspan="1">
235 <p class="Tbl-Body">Borland Make.</p>
236 </td>
237 </tr>
238
239 <tr>
240 <td rowspan="1" colspan="1">
241 <p class="Tbl-Body">
242 <em class="TableCode">cc</em>
243 </p>
244 </td>
245
246 <td rowspan="1" colspan="1">
247 <p class="Tbl-Body">Code Composer Studio 2.0</p>
248 </td>
249 </tr>
250
251 <tr>
252 <td rowspan="1" colspan="1">
253 <p class="Tbl-Body">
254 <em class="TableCode">
255 <a href="CDT6.html">cdt6</a>
256 </em>
257 </p>
258 </td>
259
260 <td rowspan="1" colspan="1">
261 <p class="Tbl-Body">
262 Eclipse CDT 6 (for Eclipse "Galileo" 3.5)
263 </p>
264 </td>
265 </tr>
266
267 <tr>
268 <td rowspan="1" colspan="1">
269 <p class="Tbl-Body">
270 <em class="TableCode">
271 <a href="CDT6.html">
272 <!--CDT6.html describes cdt7 as well
273 -->cdt7
274 </a>
275 </em>
276 </p>
277 </td>
278
279 <td rowspan="1" colspan="1">
280 <p class="Tbl-Body">
281 Eclipse CDT 7 (for Eclipse "Helios" 3.6)
282 </p>
283 </td>
284 </tr>
285
286 <tr>
287 <td rowspan="1" colspan="1">
288 <p class="Tbl-Body">
289 <em class="TableCode">cmake</em>
290 </p>
291 </td>
292
293 <td rowspan="1" colspan="1">
294 <p class="Tbl-Body">Support for CMake requires user provided modules for custom commands.</p>
295 </td>
296 </tr>
297
298 <tr>
299 <td rowspan="1" colspan="1">
300 <p class="Tbl-Body">
301 <em class="TableCode">em3</em>
302 </p>
303 </td>
304
305 <td rowspan="1" colspan="1">
306 <p class="Tbl-Body">eMbedded Visual C++ 3.00 and 4.00.</p>
307 </td>
308 </tr>
309
310 <tr>
311 <td rowspan="1" colspan="1">
312 <p class="TblCode">
313 <em class="TableCode">ghs</em>
314 </p>
315 </td>
316
317 <td rowspan="1" colspan="1">
318 <p class="Tbl-Body">Green Hills C++ Builder.</p>
319 </td>
320 </tr>
321
322 <tr>
323 <td rowspan="1" colspan="1">
324 <p class="Tbl-Body">
325 <em class="TableCode">gnuace</em>
326 </p>
327 </td>
328
329 <td rowspan="1" colspan="1">
330 <p class="Tbl-Body">
331 GNU Make for ACE/TAO/CIAO only
332 (ACE/TAO/CIAO extension).
333 </p>
334 </td>
335 </tr>
336
337 <tr>
338 <td rowspan="1" colspan="1">
339 <p class="Tbl-Body">
340 <em class="TableCode">html</em>
341 </p>
342 </td>
343
344 <td rowspan="1" colspan="1">
345 <p class="Tbl-Body">
346 html pages are generated for
347 visualization of project information.
348 </p>
349 </td>
350 </tr>
351
352 <tr>
353 <td rowspan="1" colspan="1">
354 <p class="TblCode">
355 <em class="TableCode">make</em>
356 </p>
357 </td>
358
359 <td rowspan="1" colspan="1">
360 <p class="Tbl-Body">
361 Generic make. The makefiles generated
362 by this project type can be used with any version of make.
363 However, due to configuration issues, it should not be used
364 with ACE or TAO.
365 </p>
366 </td>
367 </tr>
368
369 <tr>
370 <td rowspan="1" colspan="1">
371 <p class="TblCode">
372 <em class="TableCode">nmake</em>
373 </p>
374 </td>
375
376 <td rowspan="1" colspan="1">
377 <p class="Tbl-Body">Microsoft NMake.</p>
378 </td>
379 </tr>
380
381 <tr>
382 <td rowspan="1" colspan="1">
383 <p class="TblCode">
384 <em class="TableCode">
385 <a href="RpmSpec.html">rpmspec</a>
386 </em>
387 </p>
388 </td>
389
390 <td rowspan="1" colspan="1">
391 <p class="Tbl-Body">RPM packaging .spec files.</p>
392 </td>
393 </tr>
394
395 <tr>
396 <td rowspan="1" colspan="1">
397 <p class="TblCode">
398 <em class="TableCode">sle</em>
399 </p>
400 </td>
401
402 <td rowspan="1" colspan="1">
403 <p class="Tbl-Body">
404 Support for Visual SlickEdit is
405 incomplete.
406 </p>
407 </td>
408 </tr>
409
410 <tr>
411 <td rowspan="1" colspan="1">
412 <p class="TblCode">
413 <em class="TableCode">vc6</em>
414 </p>
415 </td>
416
417 <td rowspan="1" colspan="1">
418 <p class="Tbl-Body">Visual C++ 6.0.</p>
419 </td>
420 </tr>
421
422 <tr>
423 <td rowspan="1" colspan="1">
424 <p class="TblCode">
425 <em class="TableCode">vc7</em>
426 </p>
427 </td>
428
429 <td rowspan="1" colspan="1">
430 <p class="Tbl-Body">Visual Studio .NET 2002.</p>
431 </td>
432 </tr>
433
434 <tr>
435 <td rowspan="1" colspan="1">
436 <p class="TblCode">
437 <em class="TableCode">vc71</em>
438 </p>
439 </td>
440
441 <td rowspan="1" colspan="1">
442 <p class="Tbl-Body">Visual Studio .NET 2003.</p>
443 </td>
444 </tr>
445
446 <tr>
447 <td rowspan="1" colspan="1">
448 <p class="TblCode">
449 <em class="TableCode">vc8</em>
450 </p>
451 </td>
452
453 <td rowspan="1" colspan="1">
454 <p class="Tbl-Body">Visual Studio 2005.</p>
455 </td>
456 </tr>
457
458 <tr>
459 <td rowspan="1" colspan="1">
460 <p class="TblCode">
461 <em class="TableCode">vc9</em>
462 </p>
463 </td>
464
465 <td rowspan="1" colspan="1">
466 <p class="Tbl-Body">Visual Studio 2008.</p>
467 </td>
468 </tr>
469
470 <tr>
471 <td rowspan="1" colspan="1">
472 <p class="TblCode">
473 <em class="TableCode">vc10</em>
474 </p>
475 </td>
476
477 <td rowspan="1" colspan="1">
478 <p class="Tbl-Body">Visual Studio 2010.</p>
479 </td>
480 </tr>
481
482 <tr>
483 <td rowspan="1" colspan="1">
484 <p class="TblCode">
485 <em class="TableCode">vc11</em>
486 </p>
487 </td>
488
489 <td rowspan="1" colspan="1">
490 <p class="Tbl-Body">Visual Studio 2012.</p>
491 </td>
492 </tr>
493
494 <tr>
495 <td rowspan="1" colspan="1">
496 <p class="TblCode">
497 <em class="TableCode">vc12</em>
498 </p>
499 </td>
500
501 <td rowspan="1" colspan="1">
502 <p class="Tbl-Body">Visual Studio 2013.</p>
503 </td>
504 </tr>
505
506 <tr>
507 <td rowspan="1" colspan="1">
508 <p class="TblCode">
509 <em class="TableCode">vc14</em>
510 </p>
511 </td>
512
513 <td rowspan="1" colspan="1">
514 <p class="Tbl-Body">Visual Studio 2015.</p>
515 </td>
516 </tr>
517
518 <tr>
519 <td rowspan="1" colspan="1">
520 <p class="TblCode">
521 <em class="TableCode">vs2017</em>
522 </p>
523 </td>
524
525 <td rowspan="1" colspan="1">
526 <p class="Tbl-Body">Visual Studio 2017.</p>
527 </td>
528 </tr>
529
530 <tr>
531 <td rowspan="1" colspan="1">
532 <p class="TblCode">
533 <em class="TableCode">vs2019</em>
534 </p>
535 </td>
536
537 <td rowspan="1" colspan="1">
538 <p class="Tbl-Body">Visual Studio 2019.</p>
539 </td>
540 </tr>
541
542 <tr>
543 <td rowspan="1" colspan="1">
544 <p class="TblCode">
545 <em class="TableCode">vs2022</em>
546 </p>
547 </td>
548
549 <td rowspan="1" colspan="1">
550 <p class="Tbl-Body">Visual Studio 2022.</p>
551 </td>
552 </tr>
553
554 <tr>
555 <td rowspan="1" colspan="1">
556 <p class="TblCode">
557 <em class="TableCode">
558 <a href="WB26.html">
559 wb26
560 </a>
561 </em>
562 </p>
563 </td>
564
565 <td rowspan="1" colspan="1">
566 <p class="Tbl-Body">Wind River Workbench 2.6.</p>
567 </td>
568 </tr>
569
570 <tr>
571 <td rowspan="1" colspan="1">
572 <p class="TblCode">
573 <em class="TableCode">
574 <a href="WB30.html">
575 wb30
576 </a>
577 </em>
578 </p>
579 </td>
580
581 <td rowspan="1" colspan="1">
582 <p class="Tbl-Body">Wind River Workbench 3.0.</p>
583 </td>
584 </tr>
585
586 <tr>
587 <td rowspan="1" colspan="1">
588 <p class="Tbl-Body">
589 <em class="TableCode">wix</em>
590 </p>
591 </td>
592
593 <td rowspan="1" colspan="1">
594 <p class="Tbl-Body">Wix toolset for .msi creation.</p>
595 </td>
596 </tr>
597 </table>
598 </p>
599
600
601 </div>
602
603 <div>
604 <h4 class="Head3">Command Line</h4>
605
606 <p class="BodyNoLead">
607 The command line options for the workspace
608 creator (<em class="Code">mwc.pl</em>) and the project creator
609 (<em class="Code">mpc.pl</em>) are exactly the same. The project
610 creator is used to generate one or more separate projects by
611 passing mpc files to it on the command line. The workspace creator
612 is used to generate one or more workspaces and the projects related
613 to those workspaces.
614 </p>
615
616 <p class="Body">
617 The table below describes each option with the
618 more commonly used options in bold and project specific options in
619 italics.
620 </p>
621
622 <p class="Body">
623 <h6 class="NumberedTableTitle">
624 <a name=
625 "Command%20Line%20Options"></a>Command Line Options
626 </h6>
627 </p>
628 <p class="Body">
629 <table border="1" summary="Command Line Options">
630 <tr>
631 <th rowspan="1" colspan="1">
632 <p class="Tbl-Heading">Option</p>
633 </th>
634
635 <th rowspan="1" colspan="1">
636 <p class="Tbl-Heading">Description</p>
637 </th>
638 </tr>
639
640 <tr>
641 <td rowspan="1" colspan="1">
642 <p class="Tbl-Body">
643 <em class="TableCode">-base</em>
644 </p>
645 </td>
646
647 <td rowspan="1" colspan="1">
648 <p class="Tbl-Body">
649 This option allows the user to force
650 every project to inherit from a specified <a href="#Base_Project">base project</a>. This
651 option can be used multiple times to force multiple
652 inheritance upon a project.
653 </p>
654 </td>
655 </tr>
656
657 <tr>
658 <td rowspan="1" colspan="1">
659 <p class="Tbl-Body">
660 <em class=
661 "TableCode">-complete</em>
662 </p>
663 </td>
664
665 <td rowspan="1" colspan="1">
666 <p class="Tbl-Body">
667 This hidden option can be used to
668 generate a tcsh <em class="TableCode">complete</em> command
669 that allows a user of the tcsh shell to complete on options
670 as well as file names.
671 </p>
672 </td>
673 </tr>
674
675 <tr>
676 <td rowspan="1" colspan="1">
677 <p class="Tbl-Body">
678 <em class="TableCode">-exclude</em>
679 </p>
680 </td>
681
682 <td rowspan="1" colspan="1">
683 <p class="Tbl-Body">
684 If this option is used with <em class=
685 "Code">mwc.pl</em> , the directories or mwc files provided
686 in a comma separated list will be excluded when searching
687 for mpc files. Each element provided for exclusion should
688 be relative to the starting directory. This option has no
689 effect when used with <em class="Code">mpc.pl</em>.
690 </p>
691 </td>
692 </tr>
693
694 <tr>
695 <td rowspan="1" colspan="1">
696 <p class="Tbl-Body">
697 <em class=
698 "TableCode">-expand_vars</em>
699 </p>
700 </td>
701
702 <td rowspan="1" colspan="1">
703 <p class="Tbl-Body">
704 This option instructs MPC to perform
705 direct replacement of $() variables with the values from
706 the environment (if the <em class="Code">-use_env</em>
707 option is used) or the values specified by the <em class=
708 "Code">-relative</em> option.
709 </p>
710 </td>
711 </tr>
712
713 <tr>
714 <td rowspan="1" colspan="1">
715 <p class="Tbl-Body">
716 <em class=
717 "TableCode">-feature_file</em>
718 </p>
719 </td>
720
721 <td rowspan="1" colspan="1">
722 <p class="Tbl-Body">
723 This option allows the user to override
724 the default feature file (<em class="Code">MPC/config/</em>
725 <em class="Code">default.features</em> or <em class=
726 "Code">ACE_wrappers/bin/MakeProjectCreator/config/default.features</em>
727 ) which may or may not exist. This file can be used to
728 override feature values specified in the <em class=
729 "Code">global.features</em> file located in the <em class=
730 "Code">config</em> directory. Feature files are described
731 in the <a href="MakeProjectCreator.html#TheFeatureFile"
732 class="XRef">Feature File</a> section.
733 </p>
734 </td>
735 </tr>
736
737 <tr>
738 <td rowspan="1" colspan="1">
739 <p class="Tbl-Body">
740 <em class=
741 "TableCode">-features</em>
742 </p>
743 </td>
744
745 <td rowspan="1" colspan="1">
746 <p class="Tbl-Body">
747 Specifies the feature list to set
748 before processing. This is a comma separated list and
749 should contain no spaces. The -features option can be
750 used multiple times on the same command line, the
751 effect is the same as if the parameters had been
752 specified with a single -features options, with the
753 parameters joined by commas.
754 </p>
755 </td>
756 </tr>
757
758 <tr>
759 <td rowspan="1" colspan="1">
760 <p class="Tbl-Body">
761 <em class=
762 "TableCode">-for_eclipse</em>
763 </p>
764 </td>
765
766 <td rowspan="1" colspan="1">
767 <p class="Tbl-Body">
768 Allows generated makefiles to be used
769 with Eclipse.
770 </p>
771 </td>
772 </tr>
773
774 <tr>
775 <td rowspan="1" colspan="1">
776 <p class="Tbl-Body">
777 <em class="TableCode">-gendot</em>
778 </p>
779 </td>
780
781 <td rowspan="1" colspan="1">
782 <p class="Tbl-Body">
783 A .dot file, for use with Graphviz,
784 will be created for each workspace processed.
785 </p>
786 </td>
787 </tr>
788
789 <tr>
790 <td rowspan="1" colspan="1">
791 <p class="Tbl-Body">
792 <em class="TableCode">-genins</em>
793 </p>
794 </td>
795
796 <td rowspan="1" colspan="1">
797 <p class="Tbl-Body">
798 This option instructs MPC to generate
799 an &ldquo;install&rdquo; file after processing each
800 project. These &ldquo;install&rdquo; files can be used with
801 the prj_install.pl script which will copy portions of the
802 project related files into a user specified location.
803 </p>
804 </td>
805 </tr>
806
807 <tr>
808 <td rowspan="1" colspan="1">
809 <p class="Tbl-Body">
810 <em class=
811 "TableCode">-gfeature_file</em>
812 </p>
813 </td>
814
815 <td rowspan="1" colspan="1">
816 <p class="Tbl-Body">
817 Specifies the global feature file. The
818 default global feature file is <em class=
819 "Code">global.features</em> found in the <em class=
820 "Code">config</em> directory.
821 </p>
822 </td>
823 </tr>
824
825 <tr>
826 <td rowspan="1" colspan="1">
827 <p class="Tbl-Body">
828 <em class="TableCode">-global</em>
829 </p>
830 </td>
831
832 <td rowspan="1" colspan="1">
833 <p class="Tbl-Body">
834 This option specifies the global input
835 file. Values stored within this <a href="#Base_Project">base project</a> are applied to
836 all generated projects. The default value is <em class=
837 "Code">
838 ACE_wrappers/bin/MakeProjectCreator/global.mpb or
839 MPC/config/global.mpb
840 </em>.
841 </p>
842 </td>
843 </tr>
844
845 <tr>
846 <td rowspan="1" colspan="1">
847 <p class="Tbl-Body">
848 <em class=
849 "TableCode">-hierarchy</em>
850 </p>
851 </td>
852
853 <td rowspan="1" colspan="1">
854 <p class="Tbl-Body">
855 If this option is used with <em class=
856 "Code">mwc.pl</em> , it will generate a workspace at each
857 directory between the directory in which it is run and the
858 location of a processed mpc file. This option has no effect
859 when used with <em class="Code">mpc.pl</em> and is the
860 default for &ldquo;make&rdquo; based workspace types.
861 </p>
862 </td>
863 </tr>
864
865 <tr>
866 <td rowspan="1" colspan="1">
867 <p class="Tbl-Body">
868 <em class="Bold">
869 <em class=
870 "TableCode">-include</em>
871 </em>
872 </p>
873 </td>
874
875 <td rowspan="1" colspan="1">
876 <p class="Tbl-Body">
877 Include search directories are added
878 with this option. These search directories are used when
879 locating base projects, template input files and templates.
880 It can be used multiple times on the same command line.
881 </p>
882 </td>
883 </tr>
884
885 <tr>
886 <td rowspan="1" colspan="1">
887 <p class="Tbl-Body">
888 <em class="TableCode">-into</em>
889 </p>
890 </td>
891
892 <td rowspan="1" colspan="1">
893 <p class="Tbl-Body">
894 This option specifies that all
895 generated project files will be placed in a mirrored
896 directory structure. If any project within the
897 workspace is referenced via a full path, use of this
898 option is likely to cause problems.
899 </p>
900 </td>
901 </tr>
902
903 <tr>
904 <td rowspan="1" colspan="1">
905 <p class="Tbl-Body">
906 <em class=
907 "TableCode">-language</em>
908 </p>
909 </td>
910
911 <td rowspan="1" colspan="1">
912 <p class="Tbl-Body">
913 This option is used to specify which
914 language to assume when generating projects. The default
915 language is <em class="Code">cplusplus</em>, but <em class=
916 "Code">csharp</em>, <em class="Code">java</em> and
917 <em class="Code">vb</em> are also supported.
918 </p>
919 </td>
920 </tr>
921
922 <tr>
923 <td rowspan="1" colspan="1">
924 <p class="Tbl-Body">
925 <em class=
926 "TableCode">-make_coexistence</em>
927 </p>
928 </td>
929
930 <td rowspan="1" colspan="1">
931 <p class="Tbl-Body">
932 Make based project types that normally
933 name the workspace <em class="Code">Makefile</em>
934 (<em class="Code">bmake</em> or <em class="Code">nmake</em>
935 ) will name the generated output files such that they can
936 coexist within the same directory. In essence, the
937 <em class="Code">bmake</em> and <em class="Code">nmake</em>
938 workspace names will not be <em class="Code">Makefile</em>,
939 but the name of the workspace followed by the project type
940 (<em class="Code">.bmake</em> or <em class=
941 "Code">.nmake</em> ).
942 </p>
943 </td>
944 </tr>
945
946 <tr>
947 <td rowspan="1" colspan="1">
948 <p class="Tbl-Body">
949 <em class=
950 "TableCode">-name_modifier</em>
951 </p>
952 </td>
953
954 <td rowspan="1" colspan="1">
955 <p class="Tbl-Body">
956 This option allows the user to modify
957 the output names of projects and workspaces. These are
958 usually determined by either the mpc or mwc file, but can
959 be modified using a pattern replacement. The parameter
960 passed to this option will be used as the pattern and any
961 asterisks (*) found in the pattern will be replaced with
962 the project or workspace name depending on which type of
963 file is being created.
964 </p>
965 </td>
966 </tr>
967
968 <tr>
969 <td rowspan="1" colspan="1">
970 <p class="Tbl-Body">
971 <em class=
972 "TableCode">-apply_project</em>
973 </p>
974 </td>
975
976 <td rowspan="1" colspan="1">
977 <p class="Tbl-Body">
978 This option is only useful with the
979 <em class="Code">-name_modifier</em> option. When used in
980 conjunction with <em class="Code">-name_modifier</em>, the
981 pattern will be applied to the project name in addition to
982 the project or workspace name.
983 </p>
984 </td>
985 </tr>
986
987 <tr>
988 <td rowspan="1" colspan="1">
989 <p class="Tbl-Body">
990 <em class=
991 "TableCode">-nocomments</em>
992 </p>
993 </td>
994
995 <td rowspan="1" colspan="1">
996 <p class="Tbl-Body">
997 Comments will not be placed in the
998 generated workspace files.
999 </p>
1000 </td>
1001 </tr>
1002
1003 <tr>
1004 <td rowspan="1" colspan="1">
1005 <p class="Tbl-Body">
1006 <em class=
1007 "TableCode">-noreldefs</em>
1008 </p>
1009 </td>
1010
1011 <td rowspan="1" colspan="1">
1012 <p class="Tbl-Body">
1013 This option specifies that the default
1014 relative definitions should not be generated. See the
1015 <em class="TableCode">-relative</em> option below.
1016 </p>
1017 </td>
1018 </tr>
1019
1020 <tr>
1021 <td rowspan="1" colspan="1">
1022 <p class="Tbl-Body">
1023 <em class=
1024 "TableCode">-notoplevel</em>
1025 </p>
1026 </td>
1027
1028 <td rowspan="1" colspan="1">
1029 <p class="Tbl-Body">
1030 This option tells <em class=
1031 "TableCode">mwc.pl</em> to generate all workspace related
1032 project files, but do not generate the associated
1033 workspace. This option tells <em class=
1034 "TableCode">mpc.pl</em> to process all mpc files passed in,
1035 but it will not generate any project files.
1036 </p>
1037 </td>
1038 </tr>
1039
1040 <tr>
1041 <td rowspan="1" colspan="1">
1042 <p class="Tbl-Body">
1043 <em class="TableCode">-recurse</em>
1044 </p>
1045 </td>
1046
1047 <td rowspan="1" colspan="1">
1048 <p class="Tbl-Body">
1049 Search from the current directory for
1050 any input files and process them from the directory in
1051 which they are located.
1052 </p>
1053 </td>
1054 </tr>
1055
1056 <tr>
1057 <td rowspan="1" colspan="1">
1058 <p class="Tbl-Body">
1059 <em class="Bold">
1060 <em class=
1061 "TableCode">-relative</em>
1062 </em>
1063 </p>
1064 </td>
1065
1066 <td rowspan="1" colspan="1">
1067 <p class="Tbl-Body">
1068 Relative paths are used to replace
1069 variables enclosed with <em class="TableCode">$()</em>. By
1070 default, any environment variable that ends in <em class=
1071 "TableCode">_ROOT</em> will be automatically used as a
1072 relative path replacement. For more information see
1073 <a href="MakeProjectCreator.html#Additional-relative_information"
1074 class="XRef">the -relative Option</a>.
1075 </p>
1076 </td>
1077 </tr>
1078
1079 <tr>
1080 <td rowspan="1" colspan="1">
1081 <p class="Tbl-Body">
1082 <em class=
1083 "TableCode">-relative_file</em>
1084 </p>
1085 </td>
1086
1087 <td rowspan="1" colspan="1">
1088 <p class="Tbl-Body">
1089 This option allows you to override the
1090 default relative definitions file, which is default.rel
1091 under the MPC config directory.
1092 </p>
1093 </td>
1094 </tr>
1095
1096 <tr>
1097 <td rowspan="1" colspan="1">
1098 <p class="Tbl-Body">
1099 <em class="TableCode">-static</em>
1100 </p>
1101 </td>
1102
1103 <td rowspan="1" colspan="1">
1104 <p class="Tbl-Body">
1105 Specifies that static project files
1106 will be generated from the MPC projects. The default is to
1107 generate dynamic project files.
1108 </p>
1109 </td>
1110 </tr>
1111
1112 <tr>
1113 <td rowspan="1" colspan="1">
1114 <p class="Tbl-Body">
1115 <em class=
1116 "TableCode">-template</em>
1117 </p>
1118 </td>
1119
1120 <td rowspan="1" colspan="1">
1121 <p class="Tbl-Body">
1122 This option allows a user to specify an
1123 alternate template. Each project type has its own template
1124 and this option allows a user to override the default
1125 template.
1126 </p>
1127 </td>
1128 </tr>
1129
1130 <tr>
1131 <td rowspan="1" colspan="1">
1132 <p class="Tbl-Body">
1133 <em class="TableCode">-ti</em>
1134 </p>
1135 </td>
1136
1137 <td rowspan="1" colspan="1">
1138 <p class="Tbl-Body">
1139 Each project type has a set of template
1140 input files. With this option the default template input
1141 file can be overridden for a particular project type. For
1142 more information see <a href=
1143 "MakeProjectCreator.html#Additional-ti_information"
1144 class="XRef">the -ti Option</a>.
1145 </p>
1146 </td>
1147 </tr>
1148
1149 <tr>
1150 <td rowspan="1" colspan="1">
1151 <p class="Tbl-Body">
1152 <em class="Bold">
1153 <em class=
1154 "TableCode">-type</em>
1155 </em>
1156 </p>
1157 </td>
1158
1159 <td rowspan="1" colspan="1">
1160 <p class="Tbl-Body">
1161 This option specifies the type of
1162 project or workspace to be generated. It can be specified
1163 multiple times to generate different project types for a
1164 single set of input files.
1165 </p>
1166 </td>
1167 </tr>
1168
1169 <tr>
1170 <td rowspan="1" colspan="1">
1171 <p class="Tbl-Body">
1172 <em class="TableCode">-use_env</em>
1173 </p>
1174 </td>
1175
1176 <td rowspan="1" colspan="1">
1177 <p class="Tbl-Body">
1178 This option instructs MPC to replace
1179 all <em class="TableCode">$()</em> instances with the
1180 corresponding environment variable value instead of using
1181 values provided by the -relative option.
1182 </p>
1183 </td>
1184 </tr>
1185
1186 <tr>
1187 <td rowspan="1" colspan="1">
1188 <p class="Tbl-Body">
1189 <em class=
1190 "TableCode">-value_project</em>
1191 </p>
1192 </td>
1193
1194 <td rowspan="1" colspan="1">
1195 <p class="Tbl-Body">
1196 Use this option to override an mpc
1197 project assignment from the command line. This can be used
1198 to introduce new name value pairs to a project. However, it
1199 must be a valid project assignment. For more information
1200 see <a href=
1201 "MakeProjectCreator.html#Additional-value_project_information"
1202 class="XRef">the -value_project Option</a>.
1203 </p>
1204 </td>
1205 </tr>
1206
1207 <tr>
1208 <td rowspan="1" colspan="1">
1209 <p class="Tbl-Body">
1210 <em class=
1211 "TableCode">-value_template</em>
1212 </p>
1213 </td>
1214
1215 <td rowspan="1" colspan="1">
1216 <p class="Tbl-Body">
1217 This option can be used to override
1218 existing template input variable values from the command
1219 line. It can not be used to introduce new template input
1220 name value pairs. For more information see <a href=
1221 "MakeProjectCreator.html#Additional-value_template_information"
1222 class="XRef">the -value_template Option</a>.
1223 </p>
1224 </td>
1225 </tr>
1226
1227 <tr>
1228 <td rowspan="1" colspan="1">
1229 <p class="Tbl-Body">
1230 <em class="TableCode">-workers</em>
1231 </p>
1232 </td>
1233
1234 <td rowspan="1" colspan="1">
1235 <p class="Tbl-Body">
1236 Specifies number of child processes to
1237 use to generate projects. For more information see <a href=
1238 "MakeProjectCreator.html#Additional-workers_information"
1239 class="XRef">the -workers Option</a>.
1240 </p>
1241 </td>
1242 </tr>
1243
1244 <tr>
1245 <td rowspan="1" colspan="1">
1246 <p class="Tbl-Body">
1247 <em class="TableCode">-workers_dir</em>
1248 </p>
1249 </td>
1250
1251 <td rowspan="1" colspan="1">
1252 <p class="Tbl-Body">
1253 The directory for storing temporary
1254 output files from the child processes. The default is
1255 '/tmp/mpc' on Unix systems and %TEMP% on Windows. If
1256 neither -workers_dir nor -workers_port is used,
1257 -workers_dir is assumed. For more information see <a href=
1258 "MakeProjectCreator.html#Additional-workers_dir_information"
1259 class="XRef">the -workers_dir Option</a>.
1260 </p>
1261 </td>
1262 </tr>
1263
1264 <tr>
1265 <td rowspan="1" colspan="1">
1266 <p class="Tbl-Body">
1267 <em class="TableCode">-workers_port</em>
1268 </p>
1269 </td>
1270
1271 <td rowspan="1" colspan="1">
1272 <p class="Tbl-Body">
1273 The port number for the parent listener.
1274 If neither -workers_dir nor -workers_port is used,
1275 -workers_dir is assumed. For more information see <a href=
1276 "MakeProjectCreator.html#Additional-workers_port_information"
1277 class="XRef">the -workers_port Option</a>.
1278 </p>
1279 </td>
1280 </tr>
1281
1282 <tr>
1283 <td rowspan="1" colspan="1">
1284 <p class="Tbl-Body">
1285 <em class="TableCode">-version</em>
1286 </p>
1287 </td>
1288
1289 <td rowspan="1" colspan="1">
1290 <p class="Tbl-Body">
1291 The MPC version is printed and no files
1292 are processed.
1293 </p>
1294 </td>
1295 </tr>
1296 </table>
1297 </p>
1298
1299
1300 <div>
1301 <h5 class="Head4">Additional Option Descriptions</h5>
1302
1303
1304 <p class="BodyNoLead">
1305 Some of the options in <a href=
1306 "MakeProjectCreator.html#Command%20Line%20Options" class=
1307 "XRef">Command Line Options</a> require an expanded explanation.
1308 You will find more information on the <em class=
1309 "Code">-relative</em>, <em class="Code">-ti</em>, <em class=
1310 "Code">-value_project</em>, <em class=
1311 "Code">-value_template</em>, <em class=
1312 "Code">-workers</em>, <em class=
1313 "Code">-workers_dir</em> and <em class=
1314 "Code">-workers_port</em> options below.
1315 </p>
1316
1317
1318 <div>
1319 <h6 class="Head5">
1320 <a name=
1321 "Additional-relative_information"></a>The -relative Option.
1322 </h6>
1323
1324
1325 <p class="BodyNoLead">
1326 Some project types do not (completely)
1327 support the idea of accessing environment variables through the
1328 use of <em class="Code">$()</em>, and therefore MPC must ensure
1329 that generated projects are usable in these cases. In order to
1330 avoid the existence of <em class="Code">$()</em> variables
1331 within the generated project files, relative paths are put in
1332 place of those (where possible).
1333 </p>
1334
1335 <p class="Body">
1336 The <em class="Code">-relative</em> option
1337 takes a single parameter of a name value pair, for
1338 example:
1339 </p>
1340
1341 <blockquote>
1342
1343
1344 <p class="Code">
1345 mwc.pl -relative
1346 PROJ_TOP=/usr/projects/top
1347 </p>
1348
1349
1350 </blockquote>
1351
1352 <p class="Body">
1353 In above example, if the text <em class=
1354 "Code">"$(PROJ_TOP)</em> " is found as a value for any mpb,
1355 mpc, mpd, or mpt variable then it is replaced by a path that is
1356 relative to <em class="Code">/usr/projects/top</em>. For
1357 example, if an mpc file located under <em class=
1358 "Code">/usr/projects/top/dir</em> contained the following:
1359 </p>
1360
1361 <blockquote>
1362
1363
1364
1365 <p class="Code">project {</p>
1366
1367 <p class="Code">&nbsp;&nbsp;includes += $(PROJ_TOP)</p>
1368
1369 <p class="Code">}</p>
1370
1371
1372 </blockquote>
1373
1374 <p class="Body">
1375 The generated project file would contain text
1376 similar to:
1377 </p>
1378
1379 <blockquote>
1380 <p class="Code">CPPFLAGS += -I..</p>
1381 </blockquote>
1382
1383 <p class="Body">
1384 The <em class="Code">$(PROJ_TOP)</em> string
1385 was replaced with a directory value that is relative to the
1386 directory in which the mpc file is located.</li>
1387
1388 </div>
1389
1390 <div>
1391 <a name="Additional-ti_information"></a>
1392
1393 <h6 class="Head5">The -ti Option.</h6>
1394
1395
1396 <p class="BodyNoLead">
1397 The <em class="Code">-ti</em> option
1398 allows you to identify different template input files based on
1399 the type of target being built. Template input files correspond
1400 to four different categories: <em class="Code">dll</em>,
1401 <em class="Code">lib</em>, <em class="Code">dll_exe</em>, and
1402 <em class="Code">lib_exe</em>. Not all project types
1403 distinguish between the different categories, but the templates
1404 for various project types will be combined with different
1405 template input files, depending on the build target type, to
1406 generate different output.
1407 </p>
1408
1409 <p class="Body">
1410 To override the default template input file
1411 names, a <em class="Code">-ti</em> option is provided. The
1412 <em class="Code">-ti</em> option takes a single parameter of
1413 the form <em class="Code">type:file</em>. The <em class=
1414 "Code">type</em> is one of the four categories stated above and
1415 the <em class="Code">file</em> is the base name of an mpt file
1416 located somewhere in the include search paths.
1417 </p>
1418
1419 <p class="Body">
1420 The following example shows a usage of the -ti
1421 option. It says that when generating a static project (lib),
1422 use the <em class="Code">vc7lib</em> template input file and
1423 when generating a dynamic project (dll), use the <em class=
1424 "Code">vc7dll</em> template input file:
1425 </p>
1426
1427 <blockquote>
1428 <p class="Code">
1429 mpc.pl -type vc71 -ti lib:vc7dsplib -ti
1430 dll:vc7dspdll
1431 </p>
1432
1433 </blockquote>
1434
1435 <p class="Body">
1436 These happen to be the default values for the
1437 <em class="Code">vc71</em> type, but it illustrates that a
1438 different template input can be specified for each
1439 category.
1440 </p>
1441
1442 </div>
1443
1444 <div>
1445 <a name="Additional-value_project_information"></a>
1446
1447 <h6 class="Head5">The -value_project Option.</h6>
1448
1449 <p class="BodyNoLead">
1450 The <em class="Code">-value_project</em>
1451 option can be useful when the need arises to modify the value
1452 of an MPC variable across one or more mpc files. For example,
1453 if you wanted to generate all of your projects with an
1454 additional include search path you would run the following
1455 command:
1456 </p>
1457
1458 <blockquote>
1459
1460 <p class="Code">
1461 mwc.pl -value_project
1462 includes+=/include/path
1463 </p>
1464
1465 </blockquote>
1466
1467 <p class="Body">
1468 In the above example, an additional include
1469 search path of <em class="Code">/include/path</em> would be
1470 placed in all generated projects.
1471 </p>
1472
1473 </div>
1474
1475 <div>
1476 <a name="Additional-value_template_information"></a>
1477
1478 <h6 class="Head5">The -value_template Option.</h6>
1479
1480 <p class="BodyNoLead">
1481 This option modifies existing or adds
1482 new template input name/value pairs. For example, if you wanted
1483 to generate dynamic <em class="Code">vc71</em> projects with
1484 only <em class="Code">Release</em> targets, you would run the
1485 following command:
1486 </p>
1487
1488 <blockquote>
1489
1490 <p class="Code">
1491 mwc.pl -type vc71 -value_template
1492 configurations=Release
1493 </p>
1494
1495 </blockquote>
1496
1497 <p class="Body">
1498 To find out what template input variables are
1499 defined, see the individual mpd file of interest (<em class=
1500 "Code">$ACE_ROOT/bin/MakeProjectCreator/templates/*.mpd</em>
1501 and <em class="Code">$MPC_ROOT/templates/*.mpd</em> ) and
1502 search for names used within <em class="Code">&lt;%</em> and
1503 <em class="Code">%&gt;</em> or use the <em class=
1504 "Code">document_template.pl</em> script described in the
1505 <a href="#Document_Template_Script">
1506 Template Variable
1507 Documentation
1508 </a> section. Names that are not listed as project
1509 keywords (see <a href="MakeProjectCreator.html#82186" class=
1510 "XRef">Assignment Keywords</a>) are template variables.
1511 </p>
1512
1513 </div>
1514
1515 <div>
1516 <a name="Additional-workers_information"></a>
1517
1518 <h6 class="Head5">The -workers Option.</h6>
1519
1520 <p class="BodyNoLead">
1521 This option specifies the number of
1522 child process to use to generate projects. Using multiple
1523 workers can decrease project generation time significantly
1524 on multiprocessor systems. For example, if you wanted to
1525 distribute projects among four worker processes, you
1526 would run the following command:
1527 </p>
1528
1529 <blockquote>
1530
1531 <p class="Code">mwc.pl -type gnuace -workers 4</p>
1532
1533 </blockquote>
1534
1535 <p class="Body">
1536 In multi-process MPC, each child has
1537 to pass intermediate project info back to the parent. This
1538 is done using temporary files or using a socket. The temp
1539 file implementation, <a href=
1540 "MakeProjectCreator.html#Additional-workers_dir_information"
1541 class="XRef">the -workers_dir option</a>,
1542 forks a new child for each project and ensures there are
1543 never more children running than requested. The socket
1544 listener implementation, <a href=
1545 "MakeProjectCreator.html#Additional-workers_port_information"
1546 class="XRef">the -workers_port option</a>,
1547 pre-forks N children and distributes jobs to them.
1548 </p>
1549
1550 </div>
1551
1552 <div>
1553 <a name="Additional-workers_dir_information"></a>
1554
1555 <h6 class="Head5">The -workers_dir Option.</h6>
1556
1557
1558 <p class="Body">
1559 This option specifies the directory for
1560 storing temporary output files from the child processes.
1561 The default is '/tmp/mpc' on Unix-like systems and %TEMP%
1562 on Windows. If neither <em class="Code">-workers_dir</em>
1563 nor <em class="Code">-workers_port</em> is
1564 used, <em class="Code">-workers_dir</em> is assumed. For
1565 example, if you wanted to use 4 workers and '/tmp/mydir' for
1566 temporary filess, you would run the following command:
1567 </p>
1568
1569 <blockquote>
1570
1571
1572 <p class="Code">mwc.pl -type gnuace -workers 4 -workers_dir /tmp/mydir</p>
1573
1574
1575 </blockquote>
1576
1577 </div>
1578
1579 <div>
1580 <a name="Additional-workers_port_information"></a>
1581
1582 <h6 class="Head5">The -workers_port Option.</h6>
1583
1584
1585 <p class="BodyNoLead">
1586 This option specifies the port number
1587 where the parent listens for project information from the
1588 children. If you wanted to receive information from 2 workers
1589 on port 9876, you would run the following command:
1590 </p>
1591
1592 <blockquote>
1593
1594
1595 <p class="Code">mwc.pl -type gnuace -workers 2 -workers_port 9876</p>
1596
1597 </blockquote>
1598
1599
1600 </div>
1601 </div>
1602 </div>
1603
1604 <div>
1605 <h4 class="Head3">Configuration Files</h4>
1606
1607
1608
1609 <h6 class="Head5">Codebase Configuration File (base.cfg)</h6>
1610
1611
1612 <p class="BodyNoLead">
1613 This configuration file can be used to
1614 specify alternate locations for the MPC Configuration File
1615 (discussed below). If a <em class="Code">base.cfg</em> is found
1616 underneath the <em class="Code">config</em> directory in the MPC
1617 root directory, it will be read to determine the location of
1618 MPC.cfg based on the directory in which MPC was started.
1619 </p>
1620
1621
1622 <p class="Body">
1623 The <em class="Code">base.cfg</em> file allows you to specify which MPC.cfg
1624 file to use with the syntax: &lt;execution_path_root&gt = &lt;mpc_config_path&gt;.
1625 &nbsp;For a base.cfg file containing the following:
1626 </p>
1627
1628 <blockquote>
1629
1630 <p class="Code">/foo/bar_root = /foo/bar_root/MPC/config</p>
1631
1632 </blockquote>
1633
1634 <p class ="Body">
1635 Meaning that when $MPC_ROOT/mwc.pl is run in a directory below <em class="Code">/foo/bar_root</em>, it will
1636 search for <em class="Code">MPC.cfg</em> in the directory <em class="Code">/foo/bar_root/MPC/config</em>.
1637 </p>
1638 <p class="Body">
1639 For example, if <em class=
1640 "Code">$MPC_ROOT/mwc.pl</em> is run under <em class=
1641 "Code">
1642 <strong>/foo/bar_root/</strong>src
1643 </em>, MPC would attempt to open and read <em class=
1644 "Code">
1645 <strong>/foo/bar_root/MPC/config/</strong>MPC.cfg
1646 </em> as the MPC
1647 Configuration File. If the base configuration file is not present,
1648 MPC will try to use <em class="Code">$MPC_ROOT/config/MPC.cfg</em>
1649 as the MPC Configuration File.
1650 </p>
1651
1652 <p class="Body">
1653 You may reference environment variables, accessed
1654 via the dollar sign (e.g., <em class="Code">$NAME</em>), on either
1655 side of the equals sign. In either this file or the MPC
1656 Configuration File (see below), an alternate form of environment
1657 variable reference may be used for variables which are not expected
1658 to be defined in all scenarios. These variables use the syntax
1659 <em class="Code">$?NAME</em> instead of <em class="Code">$NAME</em>.
1660 With this syntax, if the environment variable
1661 <em class="Code">NAME</em> is not defined, no error or warning is
1662 printed by MPC, and the substring starting with
1663 <em class="Code">$?NAME</em> until the next whitespace is expanded
1664 to the empty string.
1665 </p>
1666
1667
1668
1669
1670 <h6 class="Head5">MPC Configuration File</h6>
1671
1672
1673 <p class="BodyNoLead">
1674 In an effort to move away from the use of
1675 environment variables, a configuration file has been introduced.
1676 The configuration file (<em class="Code">MPC.cfg</em>) can contain
1677 settings to provide command line options, control logging and
1678 direct MPC to dynamic project types.
1679 </p>
1680
1681 <p class="Body">
1682 The following keywords are allowed in the
1683 configuration file.
1684 </p>
1685
1686 <p class="Body">
1687 <table border="1" summary="Configuration File Keywords">
1688 <tr>
1689 <th rowspan="1" colspan="1">
1690 <p class="Tbl-Heading">Keyword</p>
1691 </th>
1692
1693 <th rowspan="1" colspan="1">
1694 <p class="Tbl-Heading">Description</p>
1695 </th>
1696 </tr>
1697
1698 <tr>
1699 <td rowspan="1" colspan="1">
1700 <p class="Tbl-Body">
1701 <em class=
1702 "TableCode">command_line</em>
1703 </p>
1704 </td>
1705
1706 <td rowspan="1" colspan="1">
1707 <p class="Tbl-Body">
1708 Provide additional command line options
1709 to MPC. The value of this setting will be prepended to the
1710 options passed to <em class="Code">mwc.pl</em> or
1711 <em class="Code">mpc.pl</em>.
1712 </p>
1713 </td>
1714 </tr>
1715
1716 <tr>
1717 <td rowspan="1" colspan="1">
1718 <p class="Tbl-Body">
1719 <em class=
1720 "TableCode">default_type</em>
1721 </p>
1722 </td>
1723
1724 <td rowspan="1" colspan="1">
1725 <p class="Tbl-Body">
1726 Provide a single project type (as
1727 specified by the <em class="Code">-type</em> option) as the
1728 default project type.
1729 </p>
1730 </td>
1731 </tr>
1732
1733 <tr>
1734 <td rowspan="1" colspan="1">
1735 <p class="Tbl-Body">
1736 <em class=
1737 "TableCode">dynamic_types</em>
1738 </p>
1739 </td>
1740
1741 <td rowspan="1" colspan="1">
1742 <p class="Tbl-Body">
1743 This comma separated list points to
1744 directories in which MPC will search for Perl modules to
1745 implement additional MPC project types, base projects or
1746 template files. This setting can be used to augment or
1747 replace functionality in MPC. For each suitable directory
1748 found, it will add a <em class="Code">modules</em> include
1749 path for Perl to find modules, add a <em class=
1750 "Code">config</em> include path to locate base projects and
1751 a <em class="Code">template</em> include path to find MPC
1752 templates.
1753 </p>
1754 </td>
1755 </tr>
1756
1757 <tr>
1758 <td rowspan="1" colspan="1">
1759 <p class="Tbl-Body">
1760 <em class="TableCode">includes</em>
1761 </p>
1762 </td>
1763
1764 <td rowspan="1" colspan="1">
1765 <p class="Tbl-Body">
1766 Similar to the <em class=
1767 "Code">-include</em> command line option, it adds the list
1768 of comma separated paths to the MPC include search
1769 paths.
1770 </p>
1771 </td>
1772 </tr>
1773
1774 <tr>
1775 <td rowspan="1" colspan="1">
1776 <p class="Tbl-Body">
1777 <em class="TableCode">logging</em>
1778 </p>
1779 </td>
1780
1781 <td rowspan="1" colspan="1">
1782 <p class="Tbl-Body">
1783 If this setting contains <em class=
1784 "Code">info=1</em>, informational messages will be printed.
1785 If it contains <em class="Code">warn=1</em>, warning
1786 messages will be printed. If it contains <em class=
1787 "Code">diag=1</em>, diagnostic messages will be printed. If
1788 it contains <em class="Code">debug=1</em>, debug message
1789 will be printed. And lastly, if it contains <em class=
1790 "Code">detail=1</em>, detail messages will be printed. If
1791 it contains none of these, MPC will not print out any
1792 information or warnings when processing projects or
1793 workspaces. Errors are always printed if any are
1794 encountered. The default value is <em class="Code">
1795 warn=1,
1796 diag=1, detail=1
1797 </em>.
1798 </p>
1799 </td>
1800 </tr>
1801
1802 <tr>
1803 <td rowspan="1" colspan="1">
1804 <p class="Tbl-Body">
1805 <em class=
1806 "TableCode">main_functions</em>
1807 </p>
1808 </td>
1809
1810 <td rowspan="1" colspan="1">
1811 <p class="Tbl-Body">
1812 Provide additional main functions to be
1813 recognized in conjunction with automatic executable project
1814 recognition. The value assigned should be of the form
1815 <em class="Code">
1816 &lt;language&gt;:&lt;func name&gt;[,
1817 &lt;language&gt;:&lt;func name&gt;]*
1818 </em>. A function can
1819 be specified for all languages by only providing the
1820 function name.
1821 </p>
1822 </td>
1823 </tr>
1824
1825 <tr>
1826 <td rowspan="1" colspan="1">
1827 <p class="Tbl-Body">
1828 <em class=
1829 "TableCode">verbose_ordering</em>
1830 </p>
1831 </td>
1832
1833 <td rowspan="1" colspan="1">
1834 <p class="Tbl-Body">
1835 If this is set, mwc.pl will warn the
1836 user about references to projects in the <em class=
1837 "Code">after</em> keyword that have not been processed.
1838 </p>
1839 </td>
1840 </tr>
1841 </table>
1842 </p>
1843
1844 </div>
1845
1846 <div>
1847 <h4 class="Head3">Environment Variables</h4>
1848
1849
1850 <p class="BodyNoLead">
1851 MPC recognizes a few environment variables
1852 that alter the way it performs certain tasks. The sections below
1853 describe each one and the effect it has on MPC.
1854 </p>
1855
1856 <p class="Body">
1857 The <em class=
1858 "Code">MPC_DEPENDENCY_COMBINED_STATIC_LIBRARY</em> environment
1859 variable only affects the way workspace dependencies are created
1860 for <em class="Emphasis">static</em> projects with the <em class=
1861 "Code">em3</em>, <em class="Code">vc6</em>, <em class=
1862 "Code">vc7</em>, <em class="Code">vc71</em>, <em class="Code">vc8</em>,
1863 <em class="Code">vc9</em>, <em class="Code">vc10</em>, <em class="Code">vc11</em>,
1864 <em class="Code">vc12</em>, <em class="Code">vc14</em>,
1865 and <em class="Code">vs*</em> project types. If this environment
1866 variable is set, MPC will generate inter-project dependencies for
1867 libraries within a single workspace. This is usually not desired
1868 since adding these dependencies in a static workspace has the side
1869 effect of including dependent libraries into the dependent
1870 library.
1871 </p>
1872
1873 <p class="Body">
1874 The <em class="Code">MPC_GHS_UNIX</em> environment
1875 variable is only meaningful when generating the ghs project files.
1876 By default, the ghs type assumes that it is for Windows. Set this
1877 environment variable prior to running MPC if this is not the
1878 case.
1879 </p>
1880
1881 <p class="Body">
1882 The <em class="Code">MPC_USE_WIN_COMMANDS</em>
1883 environment variable causes the Windows related pseudo template
1884 variables to be used regardless of the type of project being
1885 generated.
1886 </p>
1887
1888 </div>
1889 </div>
1890
1891 <div>
1892 <a name="Writing_MPC_Files"></a>
1893 <h3 class="Head2">Writing MPC and MWC Files</h3>
1894 <hr>
1895
1896
1897 <p class="Body">
1898 You may want to familiarize yourself with the
1899 various input files for MPC. The input file types and the syntax of
1900 each are discussed in the sections below.
1901 </p>
1902
1903
1904 <div>
1905 <h4 class="Head3">Input Files</h4>
1906
1907 <p class="BodyNoLead">
1908 There are four different input files
1909 associated with MPC. For most users of MPC, the main files of
1910 concern are mpc and mwc files.
1911 </p>
1912
1913
1914 <div>
1915 <h5 class="Head4">Project Files (mpc)</h5>
1916
1917 <p class="Body">
1918 Project files, those with the <em class=
1919 "Code">mpc</em> extension, contain such things as include paths,
1920 library paths, source files and inter-project dependencies. An
1921 mpc file can contain one or more &ldquo;projects&rdquo; each of
1922 which needs to be uniquely named to avoid project generation
1923 errors. Projects represent build targets such as libraries and
1924 executables.
1925 </p>
1926
1927 </div>
1928
1929 <div>
1930 <h5 class="Head4">Workspace Files (mwc)</h5>
1931
1932
1933 <p class="Body">
1934 Workspaces are defined by providing a list
1935 of mpc files, directories or other mwc files in a single mwc
1936 file. For each mpc file, the Workspace Creator calls upon the
1937 Project Creator to generate the project. After all of the
1938 projects are successfully generated, the tool-specific workspace
1939 is generated containing the projects and any defined
1940 inter-project dependency information (if supported by the build
1941 tool). An mwc file can contain one or more
1942 &ldquo;workspaces,&rdquo; each of which needs to be uniquely
1943 named. If no workspace files are provided to the workspace
1944 creator, the current directory is traversed and any mpc files
1945 located will be part of the workspace that is generated.
1946 </p>
1947
1948 </div>
1949
1950 <div>
1951
1952 <h5 class="Head4">Base Project Files (mpb)</h5>
1953
1954
1955 <p class="Body">
1956 One of the many unique and useful features
1957 of MPC is that the project definition files can use inheritance.
1958 Project inheritance allows a user to set up a base project (mpb
1959 file) that can contain information that is applicable to all
1960 derived projects. Common project attributes, such as include
1961 paths, library paths, and inter-project dependencies, could be
1962 described in this base project and any project that inherits from
1963 it would contain this information as well.
1964 </p>
1965
1966 </div>
1967
1968 <div>
1969 <h5 class="Head4">Base Workspace Files (mwb)</h5>
1970
1971
1972 <p class="Body">
1973 As with projects, workspaces can also
1974 inherit from other workspaces. A base workspace can provide
1975 workspace information that may be common to other
1976 workspaces.
1977 </p>
1978
1979 </div>
1980 </div>
1981
1982 <div>
1983 <h4 class="Head3">General Input File Syntax</h4>
1984
1985
1986 <p class="BodyNoLead">
1987 In this section we discuss the syntax of the
1988 various files. We also describe some of the default values that go
1989 along with these files.
1990 </p>
1991
1992
1993 <div>
1994 <h5 class="Head4">mwc and mwb files</h5>
1995
1996
1997 <p class="Body">
1998 Workspaces can contain individual mpc
1999 files or directories. There can be one or more workspaces defined
2000 within a single mwc file.
2001 </p>
2002
2003 <blockquote>
2004
2005
2006 <p class="Code">
2007 workspace(optional name):
2008 optional_base_workspace {
2009 </p>
2010
2011 <p class="Code">&nbsp;&nbsp;file.mpc</p>
2012
2013 <p class="Code">&nbsp;&nbsp;directory</p>
2014
2015 <p class="Code">&nbsp;&nbsp;other.mwc</p>
2016
2017 <p class="Code">&nbsp;</p>
2018
2019 <p class="Code">
2020 &nbsp;&nbsp;exclude(vc6, vc7, vc71, vc8, vc9,
2021 vc10, vc11, vc12, vc14, vs2017, vs2019, vs2022, nmake) {
2022 </p>
2023
2024 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;this_directory</p>
2025
2026 <p class="Code">&nbsp;&nbsp;}</p>
2027
2028 <p class="Code">&nbsp;</p>
2029
2030 <p class="Code">&nbsp;&nbsp;exclude(prop:microsoft) {</p>
2031
2032 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;non_microsoft</p>
2033
2034 <p class="Code">&nbsp;&nbsp;}</p>
2035
2036 <p class="Code">&nbsp;</p>
2037
2038 <p class="Code">&nbsp;&nbsp;specific(rpmspec) {</p>
2039
2040 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;rpm_version = 1.0</p>
2041
2042 <p class="Code">&nbsp;&nbsp;}</p>
2043
2044 <p class="Code">}</p>
2045
2046
2047 </blockquote>
2048
2049 <p class="BodyNoLead">
2050 A workspace can be given a name. This is
2051 the value given in the parentheses after the keyword <em class=
2052 "Code">workspace</em>. If the workspace is not given a name, the
2053 workspace name is taken from the name of the mwc file without the
2054 extension.
2055 </p>
2056
2057 <p class="Body">
2058 Workspaces can also inherit from other
2059 workspaces. In the above example, <em class=
2060 "Code">optional_base_workspace</em> would be the base name of an
2061 mwb file with no extension that contains workspace information.
2062 This information would then be included in each workspace that
2063 inherits from it.
2064 </p>
2065
2066 <p class="Body">
2067 The lines between the curly braces
2068 contain assignments, mpc files, directories, other
2069 workspace files or exclusion sections. For each listed item,
2070 <ul>
2071 <li>an mpc file will be included in the workspace,</li>
2072
2073 <li>
2074 a directory recursively traversed and any mpc files
2075 found will be included,
2076 </li>
2077 <li>
2078 <a name="AggregatedWorkspace"></a>a workspace file will be aggregated into the main workspace.
2079 </li>
2080 </ul>
2081
2082 <p class="Body">
2083 A workspace can have assignments interspersed
2084 within the directories and mpc files. These assignments modify
2085 the way projects are generated.
2086 </p>
2087
2088 <p class="Body">
2089 The <em class="Code">cmdline</em> setting can be
2090 used to provide command line options that would normally be
2091 passed to <em class="Code">mwc.pl</em> (see <a href=
2092 "MakeProjectCreator.html#Command%20Line%20Options" class=
2093 "XRef">Command Line Options</a>). However, the <em class=
2094 "Code">-exclude</em>, <em class="Code">-for_eclipse</em>,
2095 <em class="Code">-gendot</em>, <em class="Code">-gfeature_file</em>,
2096 <em class="Code">-into</em>, <em class="Code">-make_coexistence</em>,
2097 <em class="Code">-recurse</em>, <em class="Code">-reldefs</em>,
2098 and <em class="Code">-type</em> options as well as input files
2099 are ignored. Environment variables may be accessed through
2100 <em class="Code">$NAME</em>, where <em class="Code">NAME</em> is
2101 the environment variable name. The <em class="Code">cmdline</em>
2102 assignment may be useful for workspaces that require specific
2103 <em class="Code">mwc.pl</em> options in order to process
2104 correctly.
2105 </p>
2106
2107 <p class="Body">
2108 The only other setting supported by mwc.pl is
2109 <em class="Code">implicit</em>. If <em class="Code">implicit</em>
2110 is set to <em class="Code">1</em> then default project files are
2111 generated in each directory where no mpc file exists. The
2112 <em class="Code">implicit</em> keyword can also be set to the
2113 name of a base project. In this case, the implicitly generated
2114 project will inherit from the base project specified in the
2115 assignment. Either way, if the directory does not contain files
2116 that can be used within a project, no project is created. Setting
2117 <em class="Code">implicit</em> can be useful when you want to
2118 define specific workspaces, but the MPC defaults are sufficient
2119 for the directories involved within the workspace.
2120 </p>
2121
2122 <p class="Body">
2123 <a name="workspaceSpecific"></a>Workspaces
2124 support a <em class="Code">specific</em> clause
2125 conceptually and syntactically similar to <a
2126 href="#projectSpecific">
2127 the project <em
2128 class="Code">specific</em> clause.
2129 </a> Any variables
2130 assigned within the clause are only available to
2131 workspaces, not to projects. Two sorts of assignments are
2132 possible: first are assignments to the keywords
2133 <em class="Code">cmdline</em> and <em class="Code">implicit</em>
2134 and the second are type-specific variables. Consult the
2135 documentation for the type for details on type-specific variables.
2136 Keyword assignments impact the entire workspace, not just the
2137 <em class="Code">specific</em> scope.
2138 </p>
2139
2140 <p class="Body">
2141 Scoped assignments are assignments that are
2142 associated with specific mpc files or directories listed with the
2143 scope of the assignment. The following example shows a scoped
2144 assignment of <em class="Code">cmdline</em> that only applies to
2145 <em class="Code">
2146 one of the mpc files listed in the
2147 workspace
2148 </em>. In this example, <em class=
2149 "Code">directory/foo.mpc</em> would be processed as if the
2150 <em class="Code">-static</em> option had been passed on the
2151 command line whereas other directories and mpc files would
2152 not.
2153 </p>
2154
2155 <blockquote>
2156
2157
2158 <p class="Code">workspace {</p>
2159
2160 <p class="Code">&nbsp;&nbsp;...</p>
2161
2162 <p class="Code">&nbsp;&nbsp;static {</p>
2163
2164 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;cmdline += -static</p>
2165
2166 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;directory/foo.mpc</p>
2167
2168 <p class="Code">&nbsp;&nbsp;}</p>
2169
2170 <p class="Code">&nbsp;</p>
2171
2172 <p class="Code">&nbsp;&nbsp;exclude(gnuace, make) {</p>
2173
2174 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;some.mpc</p>
2175
2176 <p class="Code">&nbsp;&nbsp;}</p>
2177
2178 <p class="Code">&nbsp;</p>
2179
2180 <p class="Code">
2181 &nbsp;&nbsp;// Associate the name "other" with
2182 dir3
2183 </p>
2184
2185 <p class="Code">&nbsp;&nbsp;associate(other) {</p>
2186
2187 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;dir3</p>
2188
2189 <p class="Code">&nbsp;&nbsp;}</p>
2190
2191 <p class="Code">}</p>
2192
2193 </blockquote>
2194
2195 <p class="Body">
2196 Exclusion sections are used to prevent
2197 directories and mpc files from being processed. These excluded
2198 directories and mpc files will be skipped when generating project
2199 files and workspaces. The <em class="Code">exclude</em> keyword
2200 accepts project types as well as properties (see <a href=
2201 "MakeProjectCreator.html#properties" class="XRef">Properties</a>)
2202 within the parentheses (as above), which will cause the workspace
2203 creator to only exclude the listing for particular types. If no
2204 types are provided, exclusion will take place for all project
2205 types.
2206 </p>
2207
2208 <p class="Body">
2209 The <em class="Code">associate</em> scope
2210 associates a name with one or more directories. This does not add
2211 directories to a workspace, it only makes an association. This
2212 may or may not have an effect on the generated workspace; it
2213 depends solely upon whether the project type supports
2214 associations. Currently <em class="Code">automake</em> is the
2215 only project type that supports associations. Each directory
2216 listed under an association is grouped together and built
2217 conditionally based on the association name.
2218 </p>
2219
2220 <p class="Body">
2221 Comments are similar to the C++ style comments.
2222 Any text after a double slash (<em class="Code">//</em> ) is
2223 considered a comment.
2224 </p>
2225
2226 </div>
2227
2228 <div>
2229 <h5 class="Head4">mpc and mpb files</h5>
2230
2231 <div>
2232 <a name="Base_Project"></a>
2233 <h6 class="Head5">Project Declarations</h6>
2234
2235
2236 <p class="Body">
2237 Project declarations are similar to
2238 workspace declarations, but are a bit more complex. An mpc file
2239 can contain one or more &ldquo;projects&rdquo; and each project
2240 can inherit from base projects.
2241 </p>
2242
2243 <blockquote>
2244 <p class="Code">&nbsp;</p>
2245
2246 <p class="Code">
2247 project(optional name): base_project,
2248 another_base_project {
2249 </p>
2250
2251 <p class="Code">&nbsp;&nbsp;exename = client</p>
2252
2253 <p class="Code">
2254 &nbsp;&nbsp;includes += directory_name
2255 other_directory
2256 </p>
2257
2258 <p class="Code">&nbsp;&nbsp;libpaths += /usr/X11R6/lib</p>
2259
2260 <p class="Code">&nbsp;</p>
2261
2262 <p class="Code">&nbsp;&nbsp;Header_Files {</p>
2263
2264 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;file1.h</p>
2265
2266 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;file2.h</p>
2267
2268 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;fileN.h</p>
2269
2270 <p class="Code">&nbsp;&nbsp;}</p>
2271
2272 <p class="Code">&nbsp;</p>
2273
2274 <p class="Code">&nbsp;&nbsp;Source_Files {</p>
2275
2276 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;file1.cpp</p>
2277
2278 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;file2.cpp</p>
2279
2280 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;fileN.cpp</p>
2281
2282 <p class="Code">&nbsp;&nbsp;}</p>
2283
2284 <p class="Code">}</p>
2285
2286 </blockquote>
2287
2288 <p class="BodyNoLead">
2289 If the optional project name is not
2290 given, then the project name is taken from the name of the mpc
2291 file without the extension. Therefore, if your mpc file is
2292 going to contain multiple projects, it is important to provide
2293 project names to prevent each generated project from
2294 overwriting the other. MPC will issue an error and stop if
2295 duplicate project names are detected.
2296 </p>
2297
2298 </div>
2299
2300 <div>
2301 <h6 class="Head5">Base Projects</h6>
2302
2303
2304 <p class="BodyNoLead">
2305 Base projects can be of the extension
2306 <em class="Code">mpb</em> and <em class="Code">mpc</em>. If a
2307 file with the name of the base project with an <em class=
2308 "Code">mpb</em> or <em class="Code">mpc</em> extension cannot
2309 be found within the mpc include search path, a fatal error is
2310 issued and processing halts.
2311 </p>
2312 </div>
2313
2314 <div>
2315 <h6 class="Head5">Assignment Keywords</h6>
2316
2317
2318 <p class="Body">
2319 This table shows the keywords that can
2320 be used in an assignment (i.e., <em class="Code">=</em>,
2321 <em class="Code">+=</em> or <em class="Code">-=</em> ) within
2322 an mpc file. The most commonly used keywords are shown in bold
2323 face.
2324 </p>
2325
2326 <p style="list-style: none">
2327 <h6 class="NumberedTableTitle">
2328 <a name="82186"></a>Assignment
2329 Keywords
2330 </h6>
2331
2332 <p class="Body">
2333 <table border="1" summary="Assignment Keywords">
2334 <tr>
2335 <th rowspan="1" colspan="1">
2336 <p class="Tbl-Heading">Keyword</p>
2337 </th>
2338
2339 <th rowspan="1" colspan="1">
2340 <p class="Tbl-Heading">Description</p>
2341 </th>
2342 </tr>
2343
2344 <tr>
2345 <td rowspan="1" colspan="1">
2346 <p class="Tbl-Body">
2347 <em class="Bold">
2348 <em class=
2349 "TableCode">after</em>
2350 </em>
2351 </p>
2352 </td>
2353
2354 <td rowspan="1" colspan="1">
2355 <p class="Tbl-Body">
2356 Specifies that this project must be
2357 built after 1 or more project names listed.
2358 </p>
2359 <p class="Tbl-Body">
2360 An extended syntax is available
2361 in order to associate name-value pairs with a
2362 dependency: <em class="Code">
2363 &lt;project
2364 name[:name=value]&gt;
2365 </em><br>
2366 These name-value pairs may be used in the creation
2367 of the dependencies of the project.
2368
2369
2370 </p>
2371 </td>
2372 </tr>
2373
2374 <tr>
2375 <td rowspan="1" colspan="1">
2376 <p class="Tbl-Body">
2377 <em class=
2378 "TableCode">avoids</em>
2379 </p>
2380 </td>
2381
2382 <td rowspan="1" colspan="1">
2383 <p class="Tbl-Body">
2384 Specifies which features should be
2385 disabled in order to generate the project file. Under
2386 the GNUACE type, it also specifies which make macros
2387 should not be set to build the target.
2388 </p>
2389 </td>
2390 </tr>
2391
2392 <tr>
2393 <td rowspan="1" colspan="1">
2394 <p class="Tbl-Body">
2395 <em class=
2396 "TableCode">buildflags</em>
2397 </p>
2398 </td>
2399
2400 <td rowspan="1" colspan="1">
2401 <p class="Tbl-Body">
2402 This keyword can only be used as a source component
2403 scoped setting (ie. inside the scope of
2404 Source_Files). It specifies additional build flags
2405 that will be passed to the compiler as the source
2406 files are being compiled.
2407 </p>
2408 </td>
2409 </tr>
2410
2411 <tr>
2412 <td rowspan="1" colspan="1">
2413 <p class="Tbl-Body">
2414 <em class=
2415 "TableCode">custom_only</em>
2416 </p>
2417 </td>
2418
2419 <td rowspan="1" colspan="1">
2420 <p class="Tbl-Body">
2421 This setting instructs MPC to
2422 create projects that only contain custom generation
2423 targets. Any files included in the projects will be
2424 provided by custom component lists defined through the
2425 use of <em class="Code">Define_Custom</em>.
2426 </p>
2427 </td>
2428 </tr>
2429
2430 <tr>
2431 <td rowspan="1" colspan="1">
2432 <p class="Tbl-Body">
2433 <em class=
2434 "TableCode">dependent_upon</em>
2435 </p>
2436 </td>
2437
2438 <td rowspan="1" colspan="1">
2439 <p class="Tbl-Body">
2440 This keyword can only be used
2441 as a header component scoped setting (ie. inside
2442 the scope of Header_Files). It determines which
2443 file the header file is dependent upon for vc8,
2444 and vc9 only.
2445 </p>
2446 </td>
2447 </tr>
2448
2449 <tr>
2450 <td rowspan="1" colspan="1">
2451 <p class="Tbl-Body">
2452 <em class=
2453 "TableCode">dllout</em>
2454 </p>
2455 </td>
2456
2457 <td rowspan="1" colspan="1">
2458 <p class="Tbl-Body">
2459 If defined, specifies where the
2460 dynamic libraries will be placed. This overrides libout
2461 in the dynamic case.
2462 </p>
2463 </td>
2464 </tr>
2465
2466 <tr>
2467 <td rowspan="1" colspan="1">
2468 <p class="Tbl-Body">
2469 <em class="Bold">
2470 <em class=
2471 "TableCode">dynamicflags</em>
2472 </em>
2473 </p>
2474 </td>
2475
2476 <td rowspan="1" colspan="1">
2477 <p class="Tbl-Body">
2478 Specifies preprocessor flags passed
2479 to the compiler when building a dynamic library.
2480 </p>
2481 </td>
2482 </tr>
2483
2484 <tr>
2485 <td rowspan="1" colspan="1">
2486 <p class="Tbl-Body">
2487 <em class="Bold">
2488 <em class=
2489 "TableCode">exename</em>
2490 </em>
2491 </p>
2492 </td>
2493
2494 <td rowspan="1" colspan="1">
2495 <p class="Tbl-Body">
2496 Determines that the project will be
2497 an executable and the name of the executable
2498 target.
2499 </p>
2500 </td>
2501 </tr>
2502
2503 <tr>
2504 <td rowspan="1" colspan="1">
2505 <p class="Tbl-Body">
2506 <em class="Bold">
2507 <em class=
2508 "TableCode">exeout</em>
2509 </em>
2510 </p>
2511 </td>
2512
2513 <td rowspan="1" colspan="1">
2514 <p class="Tbl-Body">
2515 Specifies where executables will be
2516 placed.
2517 </p>
2518 </td>
2519 </tr>
2520
2521 <tr>
2522 <td rowspan="1" colspan="1">
2523 <p class="Tbl-Body">
2524 <em class="Bold">
2525 <em class=
2526 "TableCode">includes</em>
2527 </em>
2528 </p>
2529 </td>
2530
2531 <td rowspan="1" colspan="1">
2532 <p class="Tbl-Body">
2533 Specifies one or more directories
2534 to supply to the compiler for use as include search
2535 paths.
2536 </p>
2537 </td>
2538 </tr>
2539
2540 <tr>
2541 <td rowspan="1" colspan="1">
2542 <p class="Tbl-Body">
2543 <em class="Bold">
2544 <em class=
2545 "TableCode">libout</em>
2546 </em>
2547 </p>
2548 </td>
2549
2550 <td rowspan="1" colspan="1">
2551 <p class="Tbl-Body">
2552 Specifies where the dynamic and
2553 static libraries will be placed.
2554 </p>
2555 </td>
2556 </tr>
2557
2558 <tr>
2559 <td rowspan="1" colspan="1">
2560 <p class="Tbl-Body">
2561 <em class="Bold">
2562 <em class=
2563 "TableCode">libpaths</em>
2564 </em>
2565 </p>
2566 </td>
2567
2568 <td rowspan="1" colspan="1">
2569 <p class="Tbl-Body">
2570 Specifies one or more directories
2571 to supply to the compiler for use as library search
2572 paths.
2573 </p>
2574 </td>
2575 </tr>
2576
2577 <tr>
2578 <td rowspan="1" colspan="1">
2579 <p class="Tbl-Body">
2580 <em class="Bold">
2581 <em class=
2582 "TableCode">libs</em>
2583 </em>
2584 </p>
2585 </td>
2586
2587 <td rowspan="1" colspan="1">
2588 <p class="Tbl-Body">
2589 Specifies one or more libraries to
2590 link into the target. Library modifiers may be added
2591 when being processed in the template file. For example,
2592 library modifiers are added when using the vc6 project
2593 type.
2594 </p>
2595 </td>
2596 </tr>
2597
2598 <tr>
2599 <td rowspan="1" colspan="1">
2600 <p class="Tbl-Body">
2601 <em class=
2602 "TableCode">lit_libs</em>
2603 </p>
2604 </td>
2605
2606 <td rowspan="1" colspan="1">
2607 <p class="Tbl-Body">
2608 This is the same as libs except
2609 that a library modifier will not be added.
2610 </p>
2611 </td>
2612 </tr>
2613
2614 <tr>
2615 <td rowspan="1" colspan="1">
2616 <p class="Tbl-Body">
2617 <em class=
2618 "TableCode">macros</em>
2619 </p>
2620 </td>
2621
2622 <td rowspan="1" colspan="1">
2623 <p class="Tbl-Body">
2624 Values supplied here will be passed
2625 directly to the compiler as command line defined
2626 macros.
2627 </p>
2628 </td>
2629 </tr>
2630
2631 <tr>
2632 <td rowspan="1" colspan="1">
2633 <p class="Tbl-Body">
2634 <em class=
2635 "TableCode">managed</em>
2636 </p>
2637 </td>
2638
2639 <td rowspan="1" colspan="1">
2640 <p class="Tbl-Body">
2641 Specifies that the source files
2642 should be compiled as managed C++. This is only
2643 supported by the <em class="Code">nmake</em>,
2644 <em class="Code">vc7</em>, <em class="Code">vc71</em>,
2645 <em class="Code">vc8</em>, <em class="Code">vc9</em>,
2646 <em class="Code">vc10</em>, <em class="Code">vc11</em>,
2647 <em class="Code">vc12</em>, <em class="Code">vc14</em>,
2648 <em class="Code">vc12</em>, <em class="Code">vc14</em>,
2649 and <em class="Code">vs*</em> project types.
2650 </p>
2651 </td>
2652 </tr>
2653
2654 <tr>
2655 <td rowspan="1" colspan="1">
2656 <p class="Tbl-Body">
2657 <em class=
2658 "TableCode">no_pch</em>
2659 </p>
2660 </td>
2661
2662 <td rowspan="1" colspan="1">
2663 <p class="Tbl-Body">
2664 It specifies that precompiled
2665 headers should not be used for the source files listed
2666 within the scope of it&rsquo;s setting. This keyword
2667 can only be used as a source component scoped setting
2668 (i.e., inside the scope of Source_Files).
2669 </p>
2670 </td>
2671 </tr>
2672
2673 <tr>
2674 <td rowspan="1" colspan="1">
2675 <p class="Tbl-Body">
2676 <em class=
2677 "TableCode">pch_header</em>
2678 </p>
2679 </td>
2680
2681 <td rowspan="1" colspan="1">
2682 <p class="Tbl-Body">
2683 The name of the precompiled header
2684 file. See the discussion below this table for more
2685 information.
2686 </p>
2687 </td>
2688 </tr>
2689
2690 <tr>
2691 <td rowspan="1" colspan="1">
2692 <p class="Tbl-Body">
2693 <em class=
2694 "TableCode">pch_source</em>
2695 </p>
2696 </td>
2697
2698 <td rowspan="1" colspan="1">
2699 <p class="Tbl-Body">
2700 The name of the precompiled source
2701 file. See the discussion below this table for more
2702 information.
2703 </p>
2704 </td>
2705 </tr>
2706
2707 <tr>
2708 <td rowspan="1" colspan="1">
2709 <p class="Tbl-Body">
2710 <em class=
2711 "TableCode">postbuild</em>
2712 </p>
2713 </td>
2714
2715 <td rowspan="1" colspan="1">
2716 <p class="Tbl-Body">
2717 If this is defined in the project,
2718 the value will be interpreted as commands to run after
2719 the project has been successfully built. The <em class=
2720 "Code">&lt;% %&gt;</em> construct (see <a href=
2721 "MakeProjectCreator.html#MPD_Syntax" class=
2722 "XRef">Template Files</a>) can be used within this
2723 value to access template variables and functions of the
2724 template parser. See <a href=
2725 "#Common_Pseudo_Variables" class="XRef">
2726 Common
2727 Pseudo Variables
2728 </a> for a list of pseudo variables
2729 that are also available.
2730 </p>
2731 </td>
2732 </tr>
2733
2734 <tr>
2735 <td rowspan="1" colspan="1">
2736 <p class="Tbl-Body">
2737 <em class=
2738 "TableCode">postclean</em>
2739 </p>
2740 </td>
2741
2742 <td rowspan="1" colspan="1">
2743 <p class="Tbl-Body">
2744 If this is defined in the project,
2745 the value will be interpreted as commands to run after
2746 the project has been cleaned. It should be noted that
2747 this setting is not supported by all project types. As
2748 with <em class="Code">postbuild</em>, the <em class=
2749 "Code">&lt;% %&gt;</em> construct (see <a href=
2750 "MakeProjectCreator.html#MPD_Syntax" class=
2751 "XRef">Template Files</a>) can be used within this
2752 value to access template variables and functions of the
2753 template parser. See <a href=
2754 "#Common_Pseudo_Variables" class="XRef">
2755 Common
2756 Pseudo Variables
2757 </a> for a list of pseudo variables
2758 that are also available.
2759 </p>
2760 </td>
2761 </tr>
2762
2763 <tr>
2764 <td rowspan="1" colspan="1">
2765 <p class="Tbl-Body">
2766 <em class=
2767 "TableCode">prebuild</em>
2768 </p>
2769 </td>
2770
2771 <td rowspan="1" colspan="1">
2772 <p class="Tbl-Body">
2773 If this is defined in the project,
2774 the value will be interpreted as commands to run before
2775 the project has been built. As with <em class=
2776 "Code">postbuild</em>, the <em class="Code">
2777 &lt;%
2778 %&gt;
2779 </em> construct (see <a href=
2780 "MakeProjectCreator.html#MPD_Syntax" class=
2781 "XRef">Template Files</a>) can be used within this
2782 value to access template variables and functions of the
2783 template parser. See <a href=
2784 "#Common_Pseudo_Variables" class="XRef">
2785 Common
2786 Pseudo Variables
2787 </a> for a list of pseudo variables
2788 that are also available.
2789 </p>
2790 </td>
2791 </tr>
2792
2793 <tr>
2794 <td rowspan="1" colspan="1">
2795 <p class="Tbl-Body">
2796 <em class=
2797 "TableCode">pure_libs</em>
2798 </p>
2799 </td>
2800
2801 <td rowspan="1" colspan="1">
2802 <p class="Tbl-Body">
2803 This is similar to <em class=
2804 "Code">lit_libs</em> except that no prefix or extension
2805 is added to the names specified.
2806 </p>
2807 </td>
2808 </tr>
2809
2810 <tr>
2811 <td rowspan="1" colspan="1">
2812 <p class="Tbl-Body">
2813 <em class=
2814 "TableCode">recurse</em>
2815 </p>
2816 </td>
2817
2818 <td rowspan="1" colspan="1">
2819 <p class="Tbl-Body">
2820 If set to 1, MPC will recurse into
2821 directories listed under component listings (such as
2822 Source_Files, Header_Files, etc.) and add any component
2823 corresponding files to the list. This keyword can be
2824 used as a global project setting or a component scoped
2825 setting.
2826 </p>
2827 </td>
2828 </tr>
2829
2830 <tr>
2831 <td rowspan="1" colspan="1">
2832 <p class="Tbl-Body">
2833 <em class=
2834 "TableCode">recursive_includes</em>
2835 </p>
2836 </td>
2837
2838 <td rowspan="1" colspan="1">
2839 <p class="Tbl-Body">
2840 This is similar to <em class=
2841 "Code">includes</em> in that it provides include paths
2842 to the compiler. However, each path supplied will be
2843 recursively searched for sub-directories which will
2844 also be provided as include paths to the compiler.
2845 </p>
2846 </td>
2847 </tr>
2848
2849 <tr>
2850 <td rowspan="1" colspan="1">
2851 <p class="Tbl-Body">
2852 <em class=
2853 "TableCode">recursive_libpaths</em>
2854 </p>
2855 </td>
2856
2857 <td rowspan="1" colspan="1">
2858 <p class="Tbl-Body">
2859 This is similar to <em class=
2860 "Code">libpaths</em> in that it provides library search
2861 paths to the linker. However, each path supplied will
2862 be recursively searched for sub-directories which will
2863 also be provided as library search paths to the
2864 linker.
2865 </p>
2866 </td>
2867 </tr>
2868
2869 <tr>
2870 <td rowspan="1" colspan="1">
2871 <p class="Tbl-Body">
2872 <em class=
2873 "TableCode">requires</em>
2874 </p>
2875 </td>
2876
2877 <td rowspan="1" colspan="1">
2878 <p class="Tbl-Body">
2879 Specifies which features should be
2880 enabled in order to generate the project file. Under
2881 the GNUACE type, it also specifies which make macros
2882 should be set to build the target.
2883 </p>
2884 </td>
2885 </tr>
2886
2887 <tr>
2888 <td rowspan="1" colspan="1">
2889 <p class="Tbl-Body">
2890 <em class="Bold">
2891 <em class=
2892 "TableCode">sharedname</em>
2893 </em>
2894 </p>
2895 </td>
2896
2897 <td rowspan="1" colspan="1">
2898 <p class="Tbl-Body">
2899 Determines that the project will be
2900 a library and the name of the dynamic library target.
2901 See the discussion below this table for more
2902 information.
2903 </p>
2904 </td>
2905 </tr>
2906
2907 <tr>
2908 <td rowspan="1" colspan="1">
2909 <p class="Tbl-Body">
2910 <em class="Bold">
2911 <em class=
2912 "TableCode">staticflags</em>
2913 </em>
2914 </p>
2915 </td>
2916
2917 <td rowspan="1" colspan="1">
2918 <p class="Tbl-Body">
2919 Specifies preprocessor flags passed
2920 to the compiler when building a static library.
2921 </p>
2922 </td>
2923 </tr>
2924
2925 <tr>
2926 <td rowspan="1" colspan="1">
2927 <p class="Tbl-Body">
2928 <em class="Bold">
2929 <em class=
2930 "TableCode">staticname</em>
2931 </em>
2932 </p>
2933 </td>
2934
2935 <td rowspan="1" colspan="1">
2936 <p class="Tbl-Body">
2937 Determines that the project will be
2938 a library and the name of the static library
2939 target.
2940 </p>
2941 </td>
2942 </tr>
2943
2944 <tr>
2945 <td rowspan="1" colspan="1">
2946 <p class="Tbl-Body">
2947 <em class=
2948 "TableCode">tagchecks</em>
2949 </p>
2950 </td>
2951
2952 <td rowspan="1" colspan="1">
2953 <p class="Tbl-Body">
2954 For GNUACE Make only, specifies one
2955 or more names to search for in the macros specified by
2956 tagname.
2957 </p>
2958 </td>
2959 </tr>
2960
2961 <tr>
2962 <td rowspan="1" colspan="1">
2963 <p class="Tbl-Body">
2964 <em class=
2965 "TableCode">tagname</em>
2966 </p>
2967 </td>
2968
2969 <td rowspan="1" colspan="1">
2970 <p class="Tbl-Body">
2971 Specifies the GNUACE Make macro to
2972 check before building the target.
2973 </p>
2974 </td>
2975 </tr>
2976
2977 <tr>
2978 <td rowspan="1" colspan="1">
2979 <p class="Tbl-Body">
2980 <em class=
2981 "TableCode">version</em>
2982 </p>
2983 </td>
2984
2985 <td rowspan="1" colspan="1">
2986 <p class="Tbl-Body">
2987 Specifies the version number for
2988 the library or executable.
2989 </p>
2990 </td>
2991 </tr>
2992
2993 <tr>
2994 <td rowspan="1" colspan="1">
2995 <p class="Tbl-Body">
2996 <em class=
2997 "TableCode">webapp</em>
2998 </p>
2999 </td>
3000
3001 <td rowspan="1" colspan="1">
3002 <p class="Tbl-Body">
3003 Determines whether the project is a
3004 Web Application. A web application project will have no
3005 project file written but the information will be
3006 included in the workspace if web applications are
3007 supported by the project type.
3008 </p>
3009 </td>
3010 </tr>
3011 </table>
3012
3013 </p>
3014
3015 <p class="Body">
3016 Assignments can also use the <em class=
3017 "Code">+=</em> and <em class="Code">-=</em> operators to add
3018 and subtract values from keyword values.
3019 </p>
3020
3021 <p class="Body">
3022 Assignments can be bracketed by curly braces
3023 so they can span multiple lines. The opening curly brace must
3024 be the last thing on the same line as the operator and the closing
3025 brace must be on its own line (but can have leading white space).
3026 Optionally, \n, \s, or \ns can be included after the operator. These
3027 indicate that new lines should be retained (\n) and leading white space
3028 should be retained (\s).
3029 </p>
3030
3031 <blockquote>
3032
3033 <p class="Code">specific(rpmspec) {</p>
3034 <p class="Code">&nbsp;rpm_description = \ns {</p>
3035 <p class="Code">This description</p>
3036 <p class="Code">spans multiple lines.</p>
3037 <p class="Code">&nbsp;}</p>
3038 <p class="Code">}</p>
3039
3040 </blockquote>
3041
3042 <p class="Body">
3043 If a <em class="Code">sharedname</em> is
3044 specified in the mpc file and <em class="Code">staticname</em>
3045 is not used, then <em class="Code">staticname</em> is assumed
3046 to be the same as <em class="Code">sharedname</em>. This also
3047 applies in the opposite direction.
3048 </p>
3049
3050 <p class="Body">
3051 If neither exename, sharedname nor staticname
3052 is specified, MPC will search the source files for a <em class=
3053 "Code">main</em> function. If a <em class="Code">main</em> is
3054 found, the exename will be set to the name of the file, minus
3055 the extension, that contained the <em class="Code">main</em>
3056 function. Otherwise, sharedname and staticname will be set to
3057 the project name.
3058 </p>
3059
3060 <p class="Body">
3061 If the project name, exename, sharedname or
3062 staticname contain an asterisk it instructs MPC to dynamically
3063 determine a portion of the name based on certain defaults. If
3064 the project name contains an asterisk, then the asterisk will
3065 be replaced with the default project name. If exename,
3066 sharedname or staticname contains an asterisk, then the
3067 asterisk will be replaced with the project name.
3068 </p>
3069
3070 <p class="Body">
3071 If the <em class="Code">pch_header</em>
3072 keyword is not used and a file exists, in the directory in
3073 which the mpc file is located, that matches <em class=
3074 "Code">*_pch.h</em> it is assumed to be the precompiled header
3075 for that directory. If there are multiple pch files in the
3076 directory, then the precompiled header that closely matches the
3077 project name will be chosen. Similar logic applies for the
3078 <em class="Code">pch_source</em> keyword.
3079 </p>
3080
3081 </div>
3082
3083 <div>
3084 <a name="16907"></a>
3085
3086 <h6 class="Head5">Components</h6>
3087
3088
3089 <p class="BodyNoLead">
3090 An mpc file can also specify the files
3091 to be included in the generated &ldquo;project&rdquo; file.
3092 These files are specified using the component names shown in
3093 the following table. However, most of the time users will want
3094 to allow MPC to provide the default values for project
3095 files.
3096 </p>
3097
3098 <p style="list-style: none">
3099 <h6 class="NumberedTableTitle">
3100 Component Names and Default
3101 Values
3102 </h6>
3103
3104 <table border="1" summary=
3105 "Component Names and Default Values">
3106 <tr>
3107 <th rowspan="1" colspan="1">
3108 <p class="Tbl-Heading">Name</p>
3109 </th>
3110
3111 <th rowspan="1" colspan="1">
3112 <p class="Tbl-Heading">Default Value</p>
3113 </th>
3114 </tr>
3115
3116 <tr>
3117 <td rowspan="1" colspan="1">
3118 <p class="Tbl-Body">
3119 <em class=
3120 "TableCode">Source_Files</em>
3121 </p>
3122 </td>
3123
3124 <td rowspan="1" colspan="1">
3125 <p class="Tbl-Body">
3126 Defaults to all files in the
3127 directory that have the following extensions:
3128 <em class="Code">cpp</em>, <em class="Code">cxx</em>,
3129 <em class="Code">cc</em>, <em class="Code">c</em>, and
3130 <em class="Code">C</em>.
3131 </p>
3132 </td>
3133 </tr>
3134
3135 <tr>
3136 <td rowspan="1" colspan="1">
3137 <p class="Tbl-Body">
3138 <em class=
3139 "TableCode">Header_Files</em>
3140 </p>
3141 </td>
3142
3143 <td rowspan="1" colspan="1">
3144 <p class="Tbl-Body">
3145 Defaults to all files in the
3146 directory that have the following extensions:
3147 <em class="Code">h</em>, hpp, <em class=
3148 "Code">hxx</em>, and <em class="Code">hh</em>.
3149 </p>
3150 </td>
3151 </tr>
3152
3153 <tr>
3154 <td rowspan="1" colspan="1">
3155 <p class="Tbl-Body">
3156 <em class=
3157 "TableCode">Inline_Files</em>
3158 </p>
3159 </td>
3160
3161 <td rowspan="1" colspan="1">
3162 <p class="Tbl-Body">
3163 Defaults to all files in the
3164 directory that have the following extensions:
3165 <em class="Code">i</em> and <em class=
3166 "Code">inl</em>.
3167 </p>
3168 </td>
3169 </tr>
3170
3171 <tr>
3172 <td rowspan="1" colspan="1">
3173 <p class="Tbl-Body">
3174 <em class=
3175 "TableCode">Template_Files</em>
3176 </p>
3177 </td>
3178
3179 <td rowspan="1" colspan="1">
3180 <p class="Tbl-Body">
3181 Defaults to all files in the
3182 directory that end in the following: <em class=
3183 "Code">_T.cpp</em>, <em class="Code">_T.cxx</em>,
3184 <em class="Code">_T.cc</em>, <em class=
3185 "Code">_T.c</em>, and <em class="Code">_T.C</em>.
3186 </p>
3187 </td>
3188 </tr>
3189
3190 <tr>
3191 <td rowspan="1" colspan="1">
3192 <p class="Tbl-Body">
3193 <em class=
3194 "TableCode">Documentation_Files</em>
3195 </p>
3196 </td>
3197
3198 <td rowspan="1" colspan="1">
3199 <p class="Tbl-Body">
3200 Defaults to all files in the
3201 directory that match the following: <em class=
3202 "Code">README</em>, <em class="Code">readme</em>,
3203 <em class="Code">.doc</em>, <em class="Code">.html</em>
3204 and <em class="Code">.txt</em>.
3205 </p>
3206 </td>
3207 </tr>
3208
3209 <tr>
3210 <td rowspan="1" colspan="1">
3211 <p class="Tbl-Body">
3212 <em class=
3213 "TableCode">Resource_Files</em>
3214 </p>
3215 </td>
3216
3217 <td rowspan="1" colspan="1">
3218 <p class="Tbl-Body">
3219 Defaults to all files in the
3220 directory that match the project name and have an
3221 <em class="Code">rc</em> extension.
3222 </p>
3223 </td>
3224 </tr>
3225 </table>
3226 </p>
3227
3228 <p class="Body">
3229 If a component is not specified in the mpc
3230 file, the default value will be used. To disallow a particular
3231 set of files that may exist in the directory, you must declare
3232 an empty set of the particular component type.
3233 </p>
3234
3235 <p class="Body">
3236 Each component name accepts two forms. The
3237 first form is a simple list of files within the construct.
3238 </p>
3239
3240 <blockquote>
3241
3242
3243 <p class="Code">Source_Files {</p>
3244
3245 <p class="Code">&nbsp;&nbsp;file1.cpp</p>
3246
3247 <p class="Code">&nbsp;&nbsp;file2.cpp</p>
3248
3249 <p class="Code">}</p>
3250
3251
3252 </blockquote>
3253
3254 <p class="Body">
3255 The second form is a complex list of files
3256 within named blocks.
3257 </p>
3258
3259 <blockquote>
3260 <a name="MPC grouping example"></a>
3261
3262
3263
3264 <p class="Code">Source_Files(MACRO_NAME) {</p>
3265
3266 <p class="Code">&nbsp;&nbsp;BlockA {</p>
3267
3268 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;file1.cpp</p>
3269
3270 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;file2.cpp</p>
3271
3272 <p class="Code">&nbsp;&nbsp;}</p>
3273
3274 <p class="Code">&nbsp;&nbsp;BlockB {</p>
3275
3276 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;file3.cpp</p>
3277
3278 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;file4.cpp</p>
3279
3280 <p class="Code">&nbsp;&nbsp;}</p>
3281
3282 <p class="Code">}</p>
3283
3284
3285 </blockquote>
3286
3287 <p class="Body">
3288 The second form allows the user to logically
3289 group the files to make future maintenance easier. Using this
3290 form has the effect of visually grouping files in the generated
3291 project file for the <em class="Code">em3</em>, <em class=
3292 "Code">gnuace</em>, <em class="Code">vc6</em>, <em class=
3293 "Code">vc7</em>, <em class="Code">vc71</em>, <em class="Code">vc8</em>,
3294 <em class="Code">vc9</em>, <em class="Code">vc10</em>, <em class="Code">vc11</em>,
3295 <em class="Code">vc12</em>, <em class="Code">vc14</em>,
3296 and <em class="Code">vs*</em> project types.
3297 </p>
3298
3299 <p class="Body">
3300 If a file is listed in the <em class=
3301 "Code">Source_Files</em> component list and a corresponding
3302 header or inline file exists in the directory, it is added to
3303 the corresponding component list unless it is already
3304 listed.
3305 </p>
3306
3307 </div>
3308
3309 <div>
3310 <h6 class="Head5">Verbatim Clause</h6>
3311
3312
3313 <p class="BodyNoLead">
3314 The <em class="Code">verbatim</em>
3315 construct can be used to place text into a generated project
3316 file verbatim. The <em class="Code">verbatim</em> syntax is as
3317 follows:
3318 </p>
3319
3320 <blockquote>
3321
3322 <p class="Code">
3323 verbatim(&lt;project type&gt;,
3324 &lt;location&gt;) {
3325 </p>
3326
3327 <p class="Code">&nbsp;&nbsp;...</p>
3328
3329 <p class="Code">}</p>
3330
3331
3332 </blockquote>
3333
3334 <p class="Body">
3335 When MPC is generating a project of type
3336 <em class="Code">&lt;project type&gt;</em> and encounters a
3337 <em class="Code">marker</em> in the template file (see <a href=
3338 "MakeProjectCreator.html#38037" class="XRef">
3339 Template File
3340 Keywords
3341 </a>) that matches the <em class=
3342 "Code">&lt;location&gt;</em> name, it will place the text found
3343 inside the construct directly into the generated project. If
3344 the text inside the construct requires that white space be
3345 preserved, each line must be enclosed in double quotes. The
3346 following <em class="Code">verbatim</em> example would result
3347 in <em class="Code">gnuace</em> generated projects having a
3348 rule at the bottom of the GNUmakefile where the <em class=
3349 "Code">all:</em> target depends on <em class=
3350 "Code">foo</em>.
3351 </p>
3352
3353 <blockquote>
3354
3355 <p class="Code">verbatim(gnuace, bottom) {</p>
3356
3357 <p class="Code">&nbsp;&nbsp;all: foo</p>
3358
3359 <p class="Code">}</p>
3360 </blockquote>
3361
3362 </div>
3363
3364 <div>
3365 <h6 class="Head5">Expand Clause</h6>
3366
3367
3368 <p class="BodyNoLead">
3369 The <em class="Code">expand</em> keyword
3370 can be used to provide values for variable names enclosed
3371 within <em class="Code">$()</em>. In the example below, we see
3372 the name <em class="Code">VAR_NAME</em> inside the parenthesis.
3373 Whenever MPC sees <em class="Code">$(VAR_NAME)</em> it will
3374 attempt to replace it with values from the expansion list. MPC
3375 will first try to replace it with the value of the environment
3376 variable named <em class="Code">ENV_VAR</em>. If that
3377 environment variable has a value, it will be used. Otherwise,
3378 it will continue down the list until a suitable value is found.
3379 In this example, the text <em class=
3380 "Code">last_resort_value</em> will be used. MPC will leave the
3381 <em class="Code">$()</em> value as it was in the event that no
3382 value is found.
3383 </p>
3384
3385 <blockquote>
3386
3387 <p class="Code">expand(VAR_NAME) {</p>
3388
3389 <p class="Code">&nbsp;&nbsp;$ENV_VAR</p>
3390
3391 <p class="Code">&nbsp;&nbsp;last_resort_value</p>
3392
3393 <p class="Code">}</p>
3394 </blockquote>
3395
3396 </div>
3397
3398 <div>
3399 <h6 class="Head5">
3400 <a name="projectSpecific">Specific Clause</a>
3401 </h6>
3402
3403
3404 <p class="BodyNoLead">
3405 The <em class="Code">specific</em>
3406 keyword can be used to define assignments that are specific to
3407 a particular project type or property specified in the
3408 parenthesis. This will allow platform or OS-specific values to
3409 be placed into a project. For example, on one platform you may
3410 want to link in a library named <em class="Code">qt-mt</em>,
3411 but on another you need to link in <em class=
3412 "Code">qt-mt230nc</em>.
3413 </p>
3414
3415 <blockquote>
3416
3417
3418 <p class="Code">specific(prop:windows) {</p>
3419
3420 <p class="Code">&nbsp;&nbsp;lit_libs += qt-mt230nc</p>
3421
3422 <p class="Code">} else {</p>
3423
3424 <p class="Code">&nbsp;&nbsp;lit_libs += qt-mt</p>
3425
3426 <p class="Code">}</p>
3427
3428
3429 </blockquote>
3430
3431 <p class="Body">
3432 If an else clause is provided, it is required
3433 to be on the same line as the closing curly brace. You may also
3434 negate the project type or property (using &rsquo;!&rsquo;)
3435 which will cause the specific to be evaluated for all types
3436 except the type specified.
3437 </p>
3438
3439 <p class="Body">
3440 If a keyword used within a <em class=
3441 "Code">specific</em> section is not recognized as a valid MPC
3442 keyword, it is interpreted to be template value modifier. In
3443 this situation, this construct works exactly the same way as
3444 the <em class="Code">-value_template</em> command line option
3445 (see <a href="MakeProjectCreator.html#Command%20Line%20Options"
3446 class="XRef">Command Line Options</a>).
3447 </p>
3448
3449 <a name="properties">
3450 <p class="Body">
3451 The following table shows which properties
3452 apply to which project types. The <em class="Code">static</em>
3453 property (not represented in the table) is set if the -static
3454 option is supplied when processing the project files.
3455 Additionally, a property that corresponds to the language
3456 will be set (e.g., cplusplus, csharp, java, vb).
3457 </p>
3458
3459 <p class="Body">
3460 <h6 class="NumberedTableTitle">
3461 <a name=
3462 "Property_Table"></a>Property Table
3463 </h6>
3464
3465 <p class="Body">
3466 <table border="1" summary="Property Table">
3467 <tr>
3468 <th rowspan="1" colspan="1">
3469 <p class="Tbl-Heading">Project Type</p>
3470 </th>
3471
3472 <th rowspan="1" colspan="1">
3473 <p class="Tbl-Heading">borland</p>
3474 </th>
3475
3476 <th rowspan="1" colspan="1">
3477 <p class="Tbl-Heading">make</p>
3478 </th>
3479
3480 <th rowspan="1" colspan="1">
3481 <p class="Tbl-Heading">microsoft</p>
3482 </th>
3483
3484 <th rowspan="1" colspan="1">
3485 <p class="Tbl-Heading">windows</p>
3486 </th>
3487 </tr>
3488
3489 <tr>
3490 <td rowspan="1" colspan="1">
3491 <p class="Tbl-Body">
3492 <em class=
3493 "TableCode">automake</em>
3494 </p>
3495 </td>
3496
3497 <td rowspan="1" colspan="1">
3498 <p class="Tbl-Body">&nbsp;</p>
3499 </td>
3500
3501 <td rowspan="1" colspan="1">
3502 <p class="Tbl-Body">Yes</p>
3503 </td>
3504
3505 <td rowspan="1" colspan="1">
3506 <p class="Tbl-Body">&nbsp;</p>
3507 </td>
3508
3509 <td rowspan="1" colspan="1">
3510 <p class="Tbl-Body">&nbsp;</p>
3511 </td>
3512 </tr>
3513
3514 <tr>
3515 <td rowspan="1" colspan="1">
3516 <p class="Tbl-Body">
3517 <em class=
3518 "TableCode">bcb2007</em>
3519 </p>
3520 </td>
3521
3522 <td rowspan="1" colspan="1">
3523 <p class="Tbl-Body">Yes</p>
3524 </td>
3525
3526 <td rowspan="1" colspan="1">
3527 <p class="Tbl-Body">&nbsp;</p>
3528 </td>
3529
3530 <td rowspan="1" colspan="1">
3531 <p class="Tbl-Body">&nbsp;</p>
3532 </td>
3533
3534 <td rowspan="1" colspan="1">
3535 <p class="Tbl-Body">Yes</p>
3536 </td>
3537 </tr>
3538
3539 <tr>
3540 <td rowspan="1" colspan="1">
3541 <p class="Tbl-Body">
3542 <em class=
3543 "TableCode">bcb2009</em>
3544 </p>
3545 </td>
3546
3547 <td rowspan="1" colspan="1">
3548 <p class="Tbl-Body">Yes</p>
3549 </td>
3550
3551 <td rowspan="1" colspan="1">
3552 <p class="Tbl-Body">&nbsp;</p>
3553 </td>
3554
3555 <td rowspan="1" colspan="1">
3556 <p class="Tbl-Body">&nbsp;</p>
3557 </td>
3558
3559 <td rowspan="1" colspan="1">
3560 <p class="Tbl-Body">Yes</p>
3561 </td>
3562 </tr>
3563
3564 <tr>
3565 <td rowspan="1" colspan="1">
3566 <p class="Tbl-Body">
3567 <em class="TableCode">bds4</em>
3568 </p>
3569 </td>
3570
3571 <td rowspan="1" colspan="1">
3572 <p class="Tbl-Body">Yes</p>
3573 </td>
3574
3575 <td rowspan="1" colspan="1">
3576 <p class="Tbl-Body">&nbsp;</p>
3577 </td>
3578
3579 <td rowspan="1" colspan="1">
3580 <p class="Tbl-Body">&nbsp;</p>
3581 </td>
3582
3583 <td rowspan="1" colspan="1">
3584 <p class="Tbl-Body">Yes</p>
3585 </td>
3586 </tr>
3587
3588 <tr>
3589 <td rowspan="1" colspan="1">
3590 <p class="Tbl-Body">
3591 <em class=
3592 "TableCode">bmake</em>
3593 </p>
3594 </td>
3595
3596 <td rowspan="1" colspan="1">
3597 <p class="Tbl-Body">Yes</p>
3598 </td>
3599
3600 <td rowspan="1" colspan="1">
3601 <p class="Tbl-Body">Yes</p>
3602 </td>
3603
3604 <td rowspan="1" colspan="1">
3605 <p class="Tbl-Body">&nbsp;</p>
3606 </td>
3607
3608 <td rowspan="1" colspan="1">
3609 <p class="Tbl-Body">Yes</p>
3610 </td>
3611 </tr>
3612
3613 <tr>
3614 <td rowspan="1" colspan="1">
3615 <p class="Tbl-Body">
3616 <em class="TableCode">cc</em>
3617 </p>
3618 </td>
3619
3620 <td rowspan="1" colspan="1">
3621 <p class="Tbl-Body">&nbsp;</p>
3622 </td>
3623
3624 <td rowspan="1" colspan="1">
3625 <p class="Tbl-Body">&nbsp;</p>
3626 </td>
3627
3628 <td rowspan="1" colspan="1">
3629 <p class="Tbl-Body">&nbsp;</p>
3630 </td>
3631
3632 <td rowspan="1" colspan="1">
3633 <p class="Tbl-Body">Yes</p>
3634 </td>
3635 </tr>
3636
3637 <tr>
3638 <td rowspan="1" colspan="1">
3639 <p class="Tbl-Body">
3640 <em class="TableCode">em3</em>
3641 </p>
3642 </td>
3643
3644 <td rowspan="1" colspan="1">
3645 <p class="Tbl-Body">&nbsp;</p>
3646 </td>
3647
3648 <td rowspan="1" colspan="1">
3649 <p class="Tbl-Body">&nbsp;</p>
3650 </td>
3651
3652 <td rowspan="1" colspan="1">
3653 <p class="Tbl-Body">Yes</p>
3654 </td>
3655
3656 <td rowspan="1" colspan="1">
3657 <p class="Tbl-Body">Yes</p>
3658 </td>
3659 </tr>
3660
3661 <tr>
3662 <td rowspan="1" colspan="1">
3663 <p class="Tbl-Body">
3664 <em class="TableCode">ghs</em>
3665 </p>
3666 </td>
3667
3668 <td rowspan="1" colspan="1">
3669 <p class="Tbl-Body">&nbsp;</p>
3670 </td>
3671
3672 <td rowspan="1" colspan="1">
3673 <p class="Tbl-Body">&nbsp;</p>
3674 </td>
3675
3676 <td rowspan="1" colspan="1">
3677 <p class="Tbl-Body">&nbsp;</p>
3678 </td>
3679
3680 <td rowspan="1" colspan="1">
3681 <p class="Tbl-Body">Depends</p>
3682 </td>
3683 </tr>
3684
3685 <tr>
3686 <td rowspan="1" colspan="1">
3687 <p class="Tbl-Body">
3688 <em class="TableCode">make</em>
3689 </p>
3690 </td>
3691
3692 <td rowspan="1" colspan="1">
3693 <p class="Tbl-Body">&nbsp;</p>
3694 </td>
3695
3696 <td rowspan="1" colspan="1">
3697 <p class="Tbl-Body">Yes</p>
3698 </td>
3699
3700 <td rowspan="1" colspan="1">
3701 <p class="Tbl-Body">&nbsp;</p>
3702 </td>
3703
3704 <td rowspan="1" colspan="1">
3705 <p class="Tbl-Body">&nbsp;</p>
3706 </td>
3707 </tr>
3708
3709 <tr>
3710 <td rowspan="1" colspan="1">
3711 <p class="Tbl-Body">
3712 <em class=
3713 "TableCode">nmake</em>
3714 </p>
3715 </td>
3716
3717 <td rowspan="1" colspan="1">
3718 <p class="Tbl-Body">&nbsp;</p>
3719 </td>
3720
3721 <td rowspan="1" colspan="1">
3722 <p class="Tbl-Body">Yes</p>
3723 </td>
3724
3725 <td rowspan="1" colspan="1">
3726 <p class="Tbl-Body">Yes</p>
3727 </td>
3728
3729 <td rowspan="1" colspan="1">
3730 <p class="Tbl-Body">Yes</p>
3731 </td>
3732 </tr>
3733
3734 <tr>
3735 <td rowspan="1" colspan="1">
3736 <p class="Tbl-Body">
3737 <em class="TableCode">vc6</em>
3738 </p>
3739 </td>
3740
3741 <td rowspan="1" colspan="1">
3742 <p class="Tbl-Body">&nbsp;</p>
3743 </td>
3744
3745 <td rowspan="1" colspan="1">
3746 <p class="Tbl-Body">&nbsp;</p>
3747 </td>
3748
3749 <td rowspan="1" colspan="1">
3750 <p class="Tbl-Body">Yes</p>
3751 </td>
3752
3753 <td rowspan="1" colspan="1">
3754 <p class="Tbl-Body">Yes</p>
3755 </td>
3756 </tr>
3757
3758 <tr>
3759 <td rowspan="1" colspan="1">
3760 <p class="Tbl-Body">
3761 <em class="TableCode">vc7</em>
3762 </p>
3763 </td>
3764
3765 <td rowspan="1" colspan="1">
3766 <p class="Tbl-Body">&nbsp;</p>
3767 </td>
3768
3769 <td rowspan="1" colspan="1">
3770 <p class="Tbl-Body">&nbsp;</p>
3771 </td>
3772
3773 <td rowspan="1" colspan="1">
3774 <p class="Tbl-Body">Yes</p>
3775 </td>
3776
3777 <td rowspan="1" colspan="1">
3778 <p class="Tbl-Body">Yes</p>
3779 </td>
3780 </tr>
3781
3782 <tr>
3783 <td rowspan="1" colspan="1">
3784 <p class="Tbl-Body">
3785 <em class="TableCode">vc71</em>
3786 </p>
3787 </td>
3788
3789 <td rowspan="1" colspan="1">
3790 <p class="Tbl-Body">&nbsp;</p>
3791 </td>
3792
3793 <td rowspan="1" colspan="1">
3794 <p class="Tbl-Body">&nbsp;</p>
3795 </td>
3796
3797 <td rowspan="1" colspan="1">
3798 <p class="Tbl-Body">Yes</p>
3799 </td>
3800
3801 <td rowspan="1" colspan="1">
3802 <p class="Tbl-Body">Yes</p>
3803 </td>
3804 </tr>
3805
3806 <tr>
3807 <td rowspan="1" colspan="1">
3808 <p class="Tbl-Body">
3809 <em class="TableCode">vc8</em>
3810 </p>
3811 </td>
3812
3813 <td rowspan="1" colspan="1">
3814 <p class="Tbl-Body">&nbsp;</p>
3815 </td>
3816
3817 <td rowspan="1" colspan="1">
3818 <p class="Tbl-Body">&nbsp;</p>
3819 </td>
3820
3821 <td rowspan="1" colspan="1">
3822 <p class="Tbl-Body">Yes</p>
3823 </td>
3824
3825 <td rowspan="1" colspan="1">
3826 <p class="Tbl-Body">Yes</p>
3827 </td>
3828 </tr>
3829
3830 <tr>
3831 <td rowspan="1" colspan="1">
3832 <p class="Tbl-Body">
3833 <em class="TableCode">vc9</em>
3834 </p>
3835 </td>
3836
3837 <td rowspan="1" colspan="1">
3838 <p class="Tbl-Body">&nbsp;</p>
3839 </td>
3840
3841 <td rowspan="1" colspan="1">
3842 <p class="Tbl-Body">&nbsp;</p>
3843 </td>
3844
3845 <td rowspan="1" colspan="1">
3846 <p class="Tbl-Body">Yes</p>
3847 </td>
3848
3849 <td rowspan="1" colspan="1">
3850 <p class="Tbl-Body">Yes</p>
3851 </td>
3852 </tr>
3853
3854 <tr>
3855 <td rowspan="1" colspan="1">
3856 <p class="Tbl-Body">
3857 <em class="TableCode">vc10</em>
3858 </p>
3859 </td>
3860
3861 <td rowspan="1" colspan="1">
3862 <p class="Tbl-Body">&nbsp;</p>
3863 </td>
3864
3865 <td rowspan="1" colspan="1">
3866 <p class="Tbl-Body">&nbsp;</p>
3867 </td>
3868
3869 <td rowspan="1" colspan="1">
3870 <p class="Tbl-Body">Yes</p>
3871 </td>
3872
3873 <td rowspan="1" colspan="1">
3874 <p class="Tbl-Body">Yes</p>
3875 </td>
3876 </tr>
3877
3878 <tr>
3879 <td rowspan="1" colspan="1">
3880 <p class="Tbl-Body">
3881 <em class="TableCode">vc11</em>
3882 </p>
3883 </td>
3884
3885 <td rowspan="1" colspan="1">
3886 <p class="Tbl-Body">&nbsp;</p>
3887 </td>
3888
3889 <td rowspan="1" colspan="1">
3890 <p class="Tbl-Body">&nbsp;</p>
3891 </td>
3892
3893 <td rowspan="1" colspan="1">
3894 <p class="Tbl-Body">Yes</p>
3895 </td>
3896
3897 <td rowspan="1" colspan="1">
3898 <p class="Tbl-Body">Yes</p>
3899 </td>
3900 </tr>
3901
3902 <tr>
3903 <td rowspan="1" colspan="1">
3904 <p class="Tbl-Body">
3905 <em class="TableCode">vc12</em>
3906 </p>
3907 </td>
3908
3909 <td rowspan="1" colspan="1">
3910 <p class="Tbl-Body">&nbsp;</p>
3911 </td>
3912
3913 <td rowspan="1" colspan="1">
3914 <p class="Tbl-Body">&nbsp;</p>
3915 </td>
3916
3917 <td rowspan="1" colspan="1">
3918 <p class="Tbl-Body">Yes</p>
3919 </td>
3920
3921 <td rowspan="1" colspan="1">
3922 <p class="Tbl-Body">Yes</p>
3923 </td>
3924 </tr>
3925
3926 <tr>
3927 <td rowspan="1" colspan="1">
3928 <p class="Tbl-Body">
3929 <em class="TableCode">vc14</em>
3930 </p>
3931 </td>
3932
3933 <td rowspan="1" colspan="1">
3934 <p class="Tbl-Body">&nbsp;</p>
3935 </td>
3936
3937 <td rowspan="1" colspan="1">
3938 <p class="Tbl-Body">&nbsp;</p>
3939 </td>
3940
3941 <td rowspan="1" colspan="1">
3942 <p class="Tbl-Body">Yes</p>
3943 </td>
3944
3945 <td rowspan="1" colspan="1">
3946 <p class="Tbl-Body">Yes</p>
3947 </td>
3948 </tr>
3949
3950 <tr>
3951 <td rowspan="1" colspan="1">
3952 <p class="Tbl-Body">
3953 <em class="TableCode">vs2017</em>
3954 </p>
3955 </td>
3956
3957 <td rowspan="1" colspan="1">
3958 <p class="Tbl-Body">&nbsp;</p>
3959 </td>
3960
3961 <td rowspan="1" colspan="1">
3962 <p class="Tbl-Body">&nbsp;</p>
3963 </td>
3964
3965 <td rowspan="1" colspan="1">
3966 <p class="Tbl-Body">Yes</p>
3967 </td>
3968
3969 <td rowspan="1" colspan="1">
3970 <p class="Tbl-Body">Yes</p>
3971 </td>
3972 </tr>
3973
3974 <tr>
3975 <td rowspan="1" colspan="1">
3976 <p class="Tbl-Body">
3977 <em class="TableCode">vs2019</em>
3978 </p>
3979 </td>
3980
3981 <td rowspan="1" colspan="1">
3982 <p class="Tbl-Body">&nbsp;</p>
3983 </td>
3984
3985 <td rowspan="1" colspan="1">
3986 <p class="Tbl-Body">&nbsp;</p>
3987 </td>
3988
3989 <td rowspan="1" colspan="1">
3990 <p class="Tbl-Body">Yes</p>
3991 </td>
3992
3993 <td rowspan="1" colspan="1">
3994 <p class="Tbl-Body">Yes</p>
3995 </td>
3996 </tr>
3997
3998 <tr>
3999 <td rowspan="1" colspan="1">
4000 <p class="Tbl-Body">
4001 <em class="TableCode">vs2022</em>
4002 </p>
4003 </td>
4004
4005 <td rowspan="1" colspan="1">
4006 <p class="Tbl-Body">&nbsp;</p>
4007 </td>
4008
4009 <td rowspan="1" colspan="1">
4010 <p class="Tbl-Body">&nbsp;</p>
4011 </td>
4012
4013 <td rowspan="1" colspan="1">
4014 <p class="Tbl-Body">Yes</p>
4015 </td>
4016
4017 <td rowspan="1" colspan="1">
4018 <p class="Tbl-Body">Yes</p>
4019 </td>
4020 </tr>
4021
4022 <tr>
4023 <td rowspan="1" colspan="1">
4024 <p class="Tbl-Body">
4025 <em class="TableCode">wix</em>
4026 </p>
4027 </td>
4028
4029 <td rowspan="1" colspan="1">
4030 <p class="Tbl-Body">&nbsp;</p>
4031 </td>
4032
4033 <td rowspan="1" colspan="1">
4034 <p class="Tbl-Body">&nbsp;</p>
4035 </td>
4036
4037 <td rowspan="1" colspan="1">
4038 <p class="Tbl-Body">&nbsp;</p>
4039 </td>
4040
4041 <td rowspan="1" colspan="1">
4042 <p class="Tbl-Body">Yes</p>
4043 </td>
4044 </tr>
4045 </table>
4046 </p>
4047 </p>
4048
4049 <p class="Body">
4050 The ghs project type can be used on both
4051 Windows and UNIX. The windows property will be active if the
4052 <em class="Code">MPC_GHS_UNIX</em> environment variable is not
4053 set during project generation.
4054 </p>
4055
4056 </div>
4057
4058 <div>
4059 <h6 class="Head5">Conditional Clause</h6>
4060
4061
4062 <p class="Body">
4063 This scope allows addition of source files
4064 conditionally based on a particular project type or property
4065 (see the <a href="#Property_Table" class="XRef">
4066 property
4067 table
4068 </a>). The syntax is as follows:
4069 </p>
4070
4071 <blockquote>
4072 <p class="Code">&nbsp;</p>
4073
4074 <p class="Code">
4075 conditional(&lt;project type|property&gt; [,
4076 &lt;project type|property&gt; ...]) {
4077 </p>
4078
4079 <p class="Code">&nbsp;&nbsp;source1.cpp</p>
4080
4081 <p class="Code">&nbsp;&nbsp;...</p>
4082
4083 <p class="Code">}</p>
4084
4085
4086
4087 <p class="Code">
4088 conditional(&lt;project type|property&gt; [,
4089 &lt;project type|property&gt; ...]) {
4090 </p>
4091
4092 <p class="Code">&nbsp;&nbsp;source1.cpp</p>
4093
4094 <p class="Code">&nbsp;&nbsp;...</p>
4095
4096 <p class="Code">} else {</p>
4097
4098 <p class="Code">&nbsp;&nbsp;source2.cpp</p>
4099
4100 <p class="Code">&nbsp;&nbsp;...</p>
4101
4102 <p class="Code">}</p>
4103
4104
4105 </blockquote>
4106
4107 <p class="Body">
4108 If the else is provided, it is required to be
4109 on the same line as the closing curly brace. You may also
4110 negate the project type (using &rsquo;!&rsquo;) which will
4111 cause the conditional to be evaluated for all types except the
4112 type specified.
4113 </p>
4114
4115 </div>
4116
4117 <div>
4118 <a name="Custom_Types_and_Build_Rules"></a>
4119
4120 <h6 class="Head5">Custom Types and Build Rules</h6>
4121
4122
4123 <p class="Body">
4124 MPC allows you to define your own custom
4125 file types to support a variety of custom build rules. Below is
4126 an example of a custom definition.
4127 </p>
4128
4129 <blockquote>
4130
4131 <p class="Code">project {</p>
4132
4133 <p class="Code">&nbsp;&nbsp;Define_Custom(MOC) {</p>
4134
4135 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;automatic_in = 0</p>
4136
4137 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;automatic_out = 0</p>
4138
4139 <p class="Code">
4140 &nbsp;&nbsp;&nbsp;&nbsp;command =
4141 $(QTDIR)/bin/moc
4142 </p>
4143
4144 <p class="Code">
4145 &nbsp;&nbsp;&nbsp;&nbsp;output_option =
4146 -o
4147 </p>
4148
4149 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;inputext = .h</p>
4150
4151 <p class="Code">
4152 &nbsp;&nbsp;&nbsp;&nbsp;pre_extension =
4153 _moc
4154 </p>
4155
4156 <p class="Code">
4157 &nbsp;&nbsp;&nbsp;&nbsp;source_outputext =
4158 .cpp
4159 </p>
4160
4161 <p class="Code">
4162 &nbsp;&nbsp;&nbsp;&nbsp;keyword mocflags =
4163 commandflags
4164 </p>
4165
4166 <p class="Code">&nbsp;&nbsp;}</p>
4167
4168 <p class="Code">&nbsp;</p>
4169
4170 <p class="Code">&nbsp;&nbsp;// Custom Component</p>
4171
4172 <p class="Code">&nbsp;&nbsp;MOC_Files {</p>
4173
4174 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;QtReactor.h</p>
4175
4176 <p class="Code">&nbsp;&nbsp;}</p>
4177
4178 <p class="Code">&nbsp;</p>
4179
4180 <p class="Code">&nbsp;&nbsp;Source_Files {</p>
4181
4182 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;QtReactor_moc.cpp</p>
4183
4184 <p class="Code">&nbsp;&nbsp;}</p>
4185
4186 <p class="Code">}</p>
4187
4188 <p class="Code">&nbsp;</p>
4189 </blockquote>
4190
4191 <p class="Body">
4192 The above example defines a custom file type,
4193 &ldquo;<em class="Code">MOC</em> &rdquo;, that describes basic
4194 information about how to process the input files and what
4195 output files are created. Once the custom file type is defined,
4196 <em class="Code">MOC_Files</em> can be used to specify the
4197 input files for this new file type.
4198 </p>
4199
4200 <p class="Body">
4201 Define_Custom definitions may use single
4202 inheritance. This is useful for creating aliased names:
4203 </p>
4204 <blockquote>
4205 <p class="Code">Define_Custom(QtMOC) : MOC {</p>
4206 <p class="Code">}</p>
4207 </blockquote>
4208
4209 <p class="Body">
4210 The following table contains the keywords that
4211 can be used within the scope of <em class=
4212 "Code">Define_Custom</em>.
4213 </p>
4214
4215 <p style="list-style: none">
4216 <a name="32899"></a>
4217
4218 <h6 class="NumberedTableTitle">Define_Custom Keywords</h6>
4219
4220 <p class="Body">
4221 <table border="1" summary="Define_Custom Keywords">
4222 <tr>
4223 <th rowspan="1" colspan="1">
4224 <p class="Tbl-Heading">Keyword</p>
4225 </th>
4226
4227 <th rowspan="1" colspan="1">
4228 <p class="Tbl-Heading">Description</p>
4229 </th>
4230 </tr>
4231
4232 <tr>
4233 <td rowspan="1" colspan="1">
4234 <p class="Tbl-Body">
4235 <em class=
4236 "TableCode">automatic_in</em>
4237 </p>
4238 </td>
4239
4240 <td rowspan="1" colspan="1">
4241 <p class="Tbl-Body">
4242 If set to 1, then attempt to
4243 automatically determine which files belong to the set
4244 of input files for the custom type. If set to 0, then
4245 no files are automatically added to the input
4246 files.
4247 </p>
4248 </td>
4249 </tr>
4250
4251 <tr>
4252 <td rowspan="1" colspan="1">
4253 <p class="Tbl-Body">
4254 <em class=
4255 "TableCode">automatic_out</em>
4256 </p>
4257 </td>
4258
4259 <td rowspan="1" colspan="1">
4260 <p class="Tbl-Body">
4261 If set to 1, then attempt to
4262 automatically determine which generated files belong to
4263 the set of components (<em class=
4264 "Code">Source_Files</em>, <em class=
4265 "Code">Inline_Files</em> , <em class=
4266 "Code">Header_Files</em>, <em class=
4267 "Code">Template_Files</em>, <em class=
4268 "Code">Resource_Files</em> and <em class=
4269 "Code">Documentation_Files</em>) based on type files
4270 that the command generates. If omitted, then
4271 automatic_out is assumed to be 1.
4272 </p>
4273 </td>
4274 </tr>
4275
4276 <tr>
4277 <td rowspan="1" colspan="1">
4278 <p class="Tbl-Body">
4279 <em class=
4280 "TableCode">command</em>
4281 </p>
4282 </td>
4283
4284 <td rowspan="1" colspan="1">
4285 <p class="Tbl-Body">
4286 The name of the command that should
4287 be used to process the input files for the custom
4288 type.
4289 </p>
4290 </td>
4291 </tr>
4292
4293 <tr>
4294 <td rowspan="1" colspan="1">
4295 <p class="Tbl-Body">
4296 <em class=
4297 "TableCode">commandflags</em>
4298 </p>
4299 </td>
4300
4301 <td rowspan="1" colspan="1">
4302 <p class="Tbl-Body">
4303 Any options that should be passed
4304 to the command.
4305 </p>
4306 </td>
4307 </tr>
4308
4309 <tr>
4310 <td rowspan="1" colspan="1">
4311 <p class="Tbl-Body">
4312 <em class=
4313 "TableCode">dependent</em>
4314 </p>
4315 </td>
4316
4317 <td rowspan="1" colspan="1">
4318 <p class="Tbl-Body">
4319 If this is given a value, then a
4320 dependency upon that value will be given to all of the
4321 generated files. The default for this is unset and no
4322 dependency will be generated.
4323 </p>
4324 </td>
4325 </tr>
4326
4327 <tr>
4328 <td rowspan="1" colspan="1">
4329 <p class="Tbl-Body">
4330 <em class=
4331 "TableCode">dependent_libs</em>
4332 </p>
4333 </td>
4334
4335 <td rowspan="1" colspan="1">
4336 <p class="Tbl-Body">
4337 If this is given a value, then a dependency upon that
4338 library value will be given to all of the generated files.
4339 The format for this entry should be the basename for the
4340 library (no library prefix, postfix, or extension)
4341 preceded by any relative or absolute path to the library.
4342 The typical use for this would be so that a project is
4343 rebuilt when a library needs to be rebuilt for its
4344 dependent executable. The default for this is unset and no
4345 dependency will be generated.
4346 </p>
4347 </td>
4348 </tr>
4349
4350 <tr>
4351 <td rowspan="1" colspan="1">
4352 <p class="Tbl-Body">
4353 <em class=
4354 "TableCode">inputext</em>
4355 </p>
4356 </td>
4357
4358 <td rowspan="1" colspan="1">
4359 <p class="Tbl-Body">
4360 This is a comma separated list of
4361 input file extensions that belong to the command.
4362 </p>
4363 </td>
4364 </tr>
4365
4366 <tr>
4367 <td rowspan="1" colspan="1">
4368 <p class="Tbl-Body">
4369 <em class="TableCode">
4370 keyword
4371 &lt;name&gt;
4372 </em>
4373 </p>
4374 </td>
4375
4376 <td rowspan="1" colspan="1">
4377 <p class="Tbl-Body">
4378 This is a special assignment that
4379 allows the user to map &lt;name&gt; into the project
4380 level namespace. The value (if any) that is assigned to
4381 this construct must be one of the keywords that can be
4382 used within a Define_Custom clause. The result of this
4383 assignment is the ability modify the value of keywords
4384 that are normally only accessible within the scope of a
4385 custom component (e.g. <em class="Code">command</em>,
4386 <em class="Code">commandflags</em>, etc.).
4387 </p>
4388 </td>
4389 </tr>
4390
4391 <tr>
4392 <td rowspan="1" colspan="1">
4393 <p class="Tbl-Body">
4394 <em class=
4395 "TableCode">libpath</em>
4396 </p>
4397 </td>
4398
4399 <td rowspan="1" colspan="1">
4400 <p class="Tbl-Body">
4401 If the command requires a library
4402 that is not in the normal library search path, this
4403 keyword can be used to ensure that the command is able
4404 to find the library that it needs to run.
4405 </p>
4406 </td>
4407 </tr>
4408
4409 <tr>
4410 <td rowspan="1" colspan="1">
4411 <p class="Tbl-Body">
4412 <em class=
4413 "TableCode">output_option</em>
4414 </p>
4415 </td>
4416
4417 <td rowspan="1" colspan="1">
4418 <p class="Tbl-Body">
4419 If the command takes an option to
4420 specify a single file output name, then set it here.
4421 Otherwise, this should be omitted.
4422 </p>
4423 </td>
4424 </tr>
4425
4426 <tr>
4427 <td rowspan="1" colspan="1">
4428 <p class="Tbl-Body">
4429 <em class=
4430 "TableCode">output_follows_input</em>
4431 </p>
4432 </td>
4433
4434 <td rowspan="1" colspan="1">
4435 <p class="Tbl-Body">
4436 This setting defaults to 1 and
4437 indicates that output files from the custom command
4438 will end up in the same directory as the input files.
4439 If this is set to 0, it is assumed that the output
4440 files will go into the same directory as the .mpc
4441 file.
4442 </p>
4443 </td>
4444 </tr>
4445
4446 <tr>
4447 <td rowspan="1" colspan="1">
4448 <p class="Tbl-Body">
4449 <em class=
4450 "TableCode">pch_postrule</em>
4451 </p>
4452 </td>
4453
4454 <td rowspan="1" colspan="1">
4455 <p class="Tbl-Body">
4456 If this is set to 1, then a rule
4457 will be added to the custom rule that will modify the
4458 source output files to include the precompiled header
4459 file.
4460 </p>
4461 </td>
4462 </tr>
4463
4464 <tr>
4465 <td rowspan="1" colspan="1">
4466 <p class="Tbl-Body">
4467 <em class=
4468 "TableCode">postcommand</em>
4469 </p>
4470 </td>
4471
4472 <td rowspan="1" colspan="1">
4473 <p class="Tbl-Body">
4474 This allows users to create
4475 arbitrary commands that will be run after the main
4476 command is run to process the custom input files.
4477 </p>
4478 </td>
4479 </tr>
4480
4481 <tr>
4482 <td rowspan="1" colspan="1">
4483 <p class="Tbl-Body">
4484 <em class=
4485 "TableCode">pre_extension</em>
4486 </p>
4487 </td>
4488
4489 <td rowspan="1" colspan="1">
4490 <p class="Tbl-Body">
4491 If the command produces multiple
4492 files of the same extension, this comma separated list
4493 can be used to specify them. For example, <em class=
4494 "Code">tao_idl</em> creates two types of files per
4495 extension (<em class="Code">C.h</em>, <em class=
4496 "Code">S.h</em>, <em class="Code">C.cpp</em>,
4497 <em class="Code">S.cpp</em>, etc.) This applies to all
4498 extension types.
4499 </p>
4500 </td>
4501 </tr>
4502
4503 <tr>
4504 <td rowspan="1" colspan="1">
4505 <p class="Tbl-Body">
4506 <em class=
4507 "TableCode">source_pre_extension</em>
4508 </p>
4509 </td>
4510
4511 <td rowspan="1" colspan="1">
4512 <p class="Tbl-Body">
4513 This is the same as pre_extension
4514 except that it only applies to source files.
4515 </p>
4516 </td>
4517 </tr>
4518
4519 <tr>
4520 <td rowspan="1" colspan="1">
4521 <p class="Tbl-Body">
4522 <em class=
4523 "TableCode">inline_pre_extension</em>
4524 </p>
4525 </td>
4526
4527 <td rowspan="1" colspan="1">
4528 <p class="Tbl-Body">
4529 This is the same as pre_extension
4530 except that it only applies to inline files.
4531 </p>
4532 </td>
4533 </tr>
4534
4535 <tr>
4536 <td rowspan="1" colspan="1">
4537 <p class="Tbl-Body">
4538 <em class=
4539 "TableCode">header_pre_extension</em>
4540 </p>
4541 </td>
4542
4543 <td rowspan="1" colspan="1">
4544 <p class="Tbl-Body">
4545 This is the same as pre_extension
4546 except that it only applies to header files.
4547 </p>
4548 </td>
4549 </tr>
4550
4551 <tr>
4552 <td rowspan="1" colspan="1">
4553 <p class="Tbl-Body">
4554 <em class=
4555 "TableCode">template_pre_extension</em>
4556 </p>
4557 </td>
4558
4559 <td rowspan="1" colspan="1">
4560 <p class="Tbl-Body">
4561 This is the same as pre_extension
4562 except that it only applies to template files.
4563 </p>
4564 </td>
4565 </tr>
4566
4567 <tr>
4568 <td rowspan="1" colspan="1">
4569 <p class="Tbl-Body">
4570 <em class=
4571 "TableCode">resource_pre_extension</em>
4572 </p>
4573 </td>
4574
4575 <td rowspan="1" colspan="1">
4576 <p class="Tbl-Body">
4577 This is the same as pre_extension
4578 except that it only applies to resource files.
4579 </p>
4580 </td>
4581 </tr>
4582
4583 <tr>
4584 <td rowspan="1" colspan="1">
4585 <p class="Tbl-Body">
4586 <em class=
4587 "TableCode">documentation_pre_extension</em>
4588 </p>
4589 </td>
4590
4591 <td rowspan="1" colspan="1">
4592 <p class="Tbl-Body">
4593 This is the same as pre_extension
4594 except that it only applies to documentation files.
4595 </p>
4596 </td>
4597 </tr>
4598
4599 <tr>
4600 <td rowspan="1" colspan="1">
4601 <p class="Tbl-Body">
4602 <em class=
4603 "TableCode">generic_pre_extension</em>
4604 </p>
4605 </td>
4606
4607 <td rowspan="1" colspan="1">
4608 <p class="Tbl-Body">
4609 This is the same as pre_extension
4610 except that it only applies to generic files.
4611 </p>
4612 </td>
4613 </tr>
4614
4615 <tr>
4616 <td rowspan="1" colspan="1">
4617 <p class="Tbl-Body">
4618 <em class=
4619 "TableCode">pre_filename</em>
4620 </p>
4621 </td>
4622
4623 <td rowspan="1" colspan="1">
4624 <p class="Tbl-Body">
4625 The syntax for this is the same as
4626 <em class="Code">pre_extension</em>, but the values
4627 specified are prepended to the file name instead of the
4628 extension. This applies to all extension types.
4629 </p>
4630 </td>
4631 </tr>
4632
4633 <tr>
4634 <td rowspan="1" colspan="1">
4635 <p class="Tbl-Body">
4636 <em class=
4637 "TableCode">source_pre_filename</em>
4638 </p>
4639 </td>
4640
4641 <td rowspan="1" colspan="1">
4642 <p class="Tbl-Body">
4643 This is the same as pre_filename
4644 except that it only applies to source files.
4645 </p>
4646 </td>
4647 </tr>
4648
4649 <tr>
4650 <td rowspan="1" colspan="1">
4651 <p class="Tbl-Body">
4652 <em class=
4653 "TableCode">inline_pre_filename</em>
4654 </p>
4655 </td>
4656
4657 <td rowspan="1" colspan="1">
4658 <p class="Tbl-Body">
4659 This is the same as pre_filename
4660 except that it only applies to inline files.
4661 </p>
4662 </td>
4663 </tr>
4664
4665 <tr>
4666 <td rowspan="1" colspan="1">
4667 <p class="Tbl-Body">
4668 <em class=
4669 "TableCode">header_pre_filename</em>
4670 </p>
4671 </td>
4672
4673 <td rowspan="1" colspan="1">
4674 <p class="Tbl-Body">
4675 This is the same as pre_filename
4676 except that it only applies to header files.
4677 </p>
4678 </td>
4679 </tr>
4680
4681 <tr>
4682 <td rowspan="1" colspan="1">
4683 <p class="Tbl-Body">
4684 <em class=
4685 "TableCode">template_pre_filename</em>
4686 </p>
4687 </td>
4688
4689 <td rowspan="1" colspan="1">
4690 <p class="Tbl-Body">
4691 This is the same as pre_filename
4692 except that it only applies to template files.
4693 </p>
4694 </td>
4695 </tr>
4696
4697 <tr>
4698 <td rowspan="1" colspan="1">
4699 <p class="Tbl-Body">
4700 <em class=
4701 "TableCode">resource_pre_filename</em>
4702 </p>
4703 </td>
4704
4705 <td rowspan="1" colspan="1">
4706 <p class="Tbl-Body">
4707 This is the same as pre_filename
4708 except that it only applies to resource files.
4709 </p>
4710 </td>
4711 </tr>
4712
4713 <tr>
4714 <td rowspan="1" colspan="1">
4715 <p class="Tbl-Body">
4716 <em class=
4717 "TableCode">documentation_pre_filename</em>
4718 </p>
4719 </td>
4720
4721 <td rowspan="1" colspan="1">
4722 <p class="Tbl-Body">
4723 This is the same as pre_filename
4724 except that it only applies to documentation files.
4725 </p>
4726 </td>
4727 </tr>
4728
4729 <tr>
4730 <td rowspan="1" colspan="1">
4731 <p class="Tbl-Body">
4732 <em class=
4733 "TableCode">generic_pre_filename</em>
4734 </p>
4735 </td>
4736
4737 <td rowspan="1" colspan="1">
4738 <p class="Tbl-Body">
4739 This is the same as pre_filename
4740 except that it only applies to generic files.
4741 </p>
4742 </td>
4743 </tr>
4744
4745 <tr>
4746 <td rowspan="1" colspan="1">
4747 <p class="Tbl-Body">
4748 <em class=
4749 "TableCode">pre_dirname</em>
4750 </p>
4751 </td>
4752
4753 <td rowspan="1" colspan="1">
4754 <p class="Tbl-Body">
4755 The syntax for this is the same as
4756 <em class="Code">pre_filename</em>, but the value
4757 specified is prepended to the directory portion of the
4758 file name instead of the file name itself. If a
4759 separate directory is desired, the <em class=
4760 "Code">pre_dirname</em> setting should end in a
4761 slash.
4762 </p>
4763 </td>
4764 </tr>
4765
4766 <tr>
4767 <td rowspan="1" colspan="1">
4768 <p class="Tbl-Body">
4769 <em class=
4770 "TableCode">source_pre_dirname</em>
4771 </p>
4772 </td>
4773
4774 <td rowspan="1" colspan="1">
4775 <p class="Tbl-Body">
4776 This is the same as pre_dirname
4777 except that it only applies to source files.
4778 </p>
4779 </td>
4780 </tr>
4781
4782 <tr>
4783 <td rowspan="1" colspan="1">
4784 <p class="Tbl-Body">
4785 <em class=
4786 "TableCode">inline_pre_dirname</em>
4787 </p>
4788 </td>
4789
4790 <td rowspan="1" colspan="1">
4791 <p class="Tbl-Body">
4792 This is the same as pre_dirname
4793 except that it only applies to inline files.
4794 </p>
4795 </td>
4796 </tr>
4797
4798 <tr>
4799 <td rowspan="1" colspan="1">
4800 <p class="Tbl-Body">
4801 <em class=
4802 "TableCode">header_pre_dirname</em>
4803 </p>
4804 </td>
4805
4806 <td rowspan="1" colspan="1">
4807 <p class="Tbl-Body">
4808 This is the same as pre_dirname
4809 except that it only applies to header files.
4810 </p>
4811 </td>
4812 </tr>
4813
4814 <tr>
4815 <td rowspan="1" colspan="1">
4816 <p class="Tbl-Body">
4817 <em class=
4818 "TableCode">template_pre_dirname</em>
4819 </p>
4820 </td>
4821
4822 <td rowspan="1" colspan="1">
4823 <p class="Tbl-Body">
4824 This is the same as pre_dirname
4825 except that it only applies to template files.
4826 </p>
4827 </td>
4828 </tr>
4829
4830 <tr>
4831 <td rowspan="1" colspan="1">
4832 <p class="Tbl-Body">
4833 <em class=
4834 "TableCode">resource_pre_dirname</em>
4835 </p>
4836 </td>
4837
4838 <td rowspan="1" colspan="1">
4839 <p class="Tbl-Body">
4840 This is the same as pre_dirname
4841 except that it only applies to resource files.
4842 </p>
4843 </td>
4844 </tr>
4845
4846 <tr>
4847 <td rowspan="1" colspan="1">
4848 <p class="Tbl-Body">
4849 <em class=
4850 "TableCode">documentation_pre_dirname</em>
4851 </p>
4852 </td>
4853
4854 <td rowspan="1" colspan="1">
4855 <p class="Tbl-Body">
4856 This is the same as pre_dirname
4857 except that it only applies to documentation files.
4858 </p>
4859 </td>
4860 </tr>
4861
4862 <tr>
4863 <td rowspan="1" colspan="1">
4864 <p class="Tbl-Body">
4865 <em class=
4866 "TableCode">generic_pre_dirname</em>
4867 </p>
4868 </td>
4869
4870 <td rowspan="1" colspan="1">
4871 <p class="Tbl-Body">
4872 This is the same as pre_dirname
4873 except that it only applies to generic files.
4874 </p>
4875 </td>
4876 </tr>
4877
4878 <tr>
4879 <td rowspan="1" colspan="1">
4880 <p class="Tbl-Body">
4881 <em class=
4882 "TableCode">source_outputext</em>
4883 </p>
4884 </td>
4885
4886 <td rowspan="1" colspan="1">
4887 <p class="Tbl-Body">
4888 This is a comma separated list of
4889 possible source file output extensions. If the command
4890 does not produce source files, then this can be
4891 omitted.
4892 </p>
4893 </td>
4894 </tr>
4895
4896 <tr>
4897 <td rowspan="1" colspan="1">
4898 <p class="Tbl-Body">
4899 <em class=
4900 "TableCode">inline_outputext</em>
4901 </p>
4902 </td>
4903
4904 <td rowspan="1" colspan="1">
4905 <p class="Tbl-Body">
4906 This is a comma separated list of
4907 possible inline file output extensions. If the command
4908 does not produce inline files, then this can be
4909 omitted.
4910 </p>
4911 </td>
4912 </tr>
4913
4914 <tr>
4915 <td rowspan="1" colspan="1">
4916 <p class="Tbl-Body">
4917 <em class=
4918 "TableCode">header_outputext</em>
4919 </p>
4920 </td>
4921
4922 <td rowspan="1" colspan="1">
4923 <p class="Tbl-Body">
4924 This is a comma separated list of
4925 possible header file output extensions. If the command
4926 does not produce header files, then this can be
4927 omitted.
4928 </p>
4929 </td>
4930 </tr>
4931
4932 <tr>
4933 <td rowspan="1" colspan="1">
4934 <p class="Tbl-Body">
4935 <em class=
4936 "TableCode">template_outputext</em>
4937 </p>
4938 </td>
4939
4940 <td rowspan="1" colspan="1">
4941 <p class="Tbl-Body">
4942 This is a comma separated list of
4943 possible template file output extensions. If the
4944 command does not produce template files, then this can
4945 be omitted.
4946 </p>
4947 </td>
4948 </tr>
4949
4950 <tr>
4951 <td rowspan="1" colspan="1">
4952 <p class="Tbl-Body">
4953 <em class=
4954 "TableCode">resource_outputext</em>
4955 </p>
4956 </td>
4957
4958 <td rowspan="1" colspan="1">
4959 <p class="Tbl-Body">
4960 This is a comma separated list of
4961 possible resource file output extensions. If the
4962 command does not produce resource files, then this can
4963 be omitted.
4964 </p>
4965 </td>
4966 </tr>
4967
4968 <tr>
4969 <td rowspan="1" colspan="1">
4970 <p class="Tbl-Body">
4971 <em class=
4972 "TableCode">documentation_outputext</em>
4973 </p>
4974 </td>
4975
4976 <td rowspan="1" colspan="1">
4977 <p class="Tbl-Body">
4978 This is a comma separated list of
4979 possible documentation file output extensions. If the
4980 command does not produce documentation files, then this
4981 can be omitted.
4982 </p>
4983 </td>
4984 </tr>
4985
4986 <tr>
4987 <td rowspan="1" colspan="1">
4988 <p class="Tbl-Body">
4989 <em class=
4990 "TableCode">generic_outputext</em>
4991 </p>
4992 </td>
4993
4994 <td rowspan="1" colspan="1">
4995 <p class="Tbl-Body">
4996 If the command does not generate
4997 any of the other output types listed above, then the
4998 extensions should be listed under this.
4999 </p>
5000 </td>
5001 </tr>
5002 </table>
5003 </p>
5004 </p>
5005
5006 <p class="Body">
5007 There is a special interaction between custom
5008 components and the source, header and inline components. If a
5009 <em class="Code">custom</em> definition is set to be
5010 &ldquo;automatic&rdquo; and custom component files are present
5011 but not specified, the default custom generated names are added
5012 to the source, header and inline component lists unless those
5013 names are already listed (or partially listed) in those
5014 component lists. See <a href=
5015 "MakeProjectCreator.html#Custom_Types_and_Build_Rules"
5016 class="XRef">Custom Types and Build Rules</a> for more
5017 information about defining your own custom type.
5018 </p>
5019
5020 <p class="Body">
5021 Particular output extensions for custom build
5022 types are not required. However, at least one output extension
5023 type is required for MPC to generate a target. Your command
5024 does not necessarily have to generate output, but an extension
5025 type is required if you want the input file to be processed
5026 during the project compilation.
5027 </p>
5028
5029 <p class="Body">
5030 If the custom output can not be represented
5031 with the above output extension keywords (*_outputext) and you
5032 have knowledge of the output files <em class="Emphasis">
5033 a
5034 priori
5035 </em>, you can represent them with the <em class=
5036 "Code">&gt;&gt;</em> construct.
5037 </p>
5038
5039 <p class="Body">
5040 Below is an example that demonstrates the use
5041 of <em class="Code">&gt;&gt;</em>. The command takes an input
5042 file name of foo.prp and produces two files that have
5043 completely unrelated filenames, <em class="Code">hello.h</em>
5044 and <em class="Code">hello.cpp</em>.
5045 </p>
5046
5047 <blockquote>
5048
5049 <p class="Code">project {</p>
5050
5051 <p class="Code">&nbsp;&nbsp;Define_Custom(Quogen) {</p>
5052
5053 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;automatic_in = 0</p>
5054
5055 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;automatic_out = 0</p>
5056
5057 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;command = perl quogen.pl</p>
5058
5059 <p class="Code">
5060 &nbsp;&nbsp;&nbsp;&nbsp;commandflags = --debuglevel=1
5061 --language=c++ \
5062 </p>
5063
5064 <p class="Code">
5065 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--kernel_language=c++
5066 </p>
5067
5068 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;inputext = .prp</p>
5069
5070 <p class="Code">
5071 &nbsp;&nbsp;&nbsp;&nbsp;keyword quogenflags =
5072 commandflags
5073 </p>
5074
5075 <p class="Code">&nbsp;&nbsp;}</p>
5076
5077 <p class="Code">&nbsp;</p>
5078
5079 <p class="Code">&nbsp;&nbsp;Quogen_Files {</p>
5080
5081 <p class="Code">
5082 &nbsp;&nbsp;&nbsp;&nbsp;foo.prp &gt;&gt;
5083 hello.h hello.cpp
5084 </p>
5085
5086 <p class="Code">&nbsp;&nbsp;}</p>
5087
5088 <p class="Code">&nbsp;</p>
5089
5090 <p class="Code">&nbsp;&nbsp;Source_Files {</p>
5091
5092 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;hello.cpp</p>
5093
5094 <p class="Code">&nbsp;&nbsp;}</p>
5095
5096 <p class="Code">}</p>
5097
5098 <p class="Code">&nbsp;</p>
5099 </blockquote>
5100
5101 <p class="Body">
5102 You can use the <em class="Code">&lt;&lt;</em>
5103 construct to represent dependencies for specific custom input
5104 file. For instance, in the above example, assume that foo.prp
5105 depends upon foo.in, we would represent this by adding
5106 <em class="Code">&lt;&lt;</em> foo.in as shown below.
5107 </p>
5108
5109 <blockquote>
5110
5111 <p class="Code">Quogen_Files {</p>
5112
5113 <p class="Code">
5114 &nbsp;&nbsp;foo.prp &gt;&gt; hello.h
5115 hello.cpp &lt;&lt; foo.in
5116 </p>
5117
5118 <p class="Code">}</p>
5119
5120 <p class="Code">&nbsp;</p>
5121 </blockquote>
5122
5123 <p class="Body">
5124 An additional construct can be used within the
5125 scope of a <em class="Code">Define_Custom</em>. This construct
5126 is called <em class="Code">optional</em>, and can be used to
5127 represent optional custom command output that is dependent upon
5128 particular command line parameters passed to the custom
5129 command.
5130 </p>
5131
5132 <blockquote>
5133
5134 <p class="Code">project {</p>
5135
5136 <p class="Code">&nbsp;&nbsp;Define_Custom(TEST) {</p>
5137
5138 <p class="Code">
5139 &nbsp;&nbsp;&nbsp;&nbsp;optional(keyword)
5140 {
5141 </p>
5142
5143 <p class="Code">
5144 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flag_keyword(option) +=
5145 value [, value]
5146 </p>
5147
5148 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;}</p>
5149
5150 <p class="Code">&nbsp;&nbsp;}</p>
5151
5152 <p class="Code">}</p>
5153 </blockquote>
5154
5155 <p class="Body">
5156 In the above fragment, <em class=
5157 "Code">keyword</em> can be any of the <em class=
5158 "Code">pre_extension</em>, <em class="Code">pre_filename</em>
5159 keywords or any of the keywords that end in <em class=
5160 "Code">_outputext</em>. The <em class="Code">flag_keyword</em>
5161 can be any of the custom definition keywords, however only
5162 <em class="Code">commandflags</em> has any functional value.
5163 The <em class="Code">flag_keyword</em> value is searched for
5164 the <em class="Code">option</em> value contained inside the
5165 parenthesis. If it is found the <em class="Code">value</em> or
5166 <em class="Code">values</em> after the += are added to the list
5167 specified by <em class="Code">keyword</em>. This can also be
5168 negated by prefixing the <em class="Code">option</em> with an
5169 exclamation point (!).
5170 </p>
5171
5172 <p class="Body">
5173 The example below shows how the <em class=
5174 "Code">optional</em> construct is used by the custom definition
5175 for the <em class="Code">tao_idl</em> command (see <em class=
5176 "Code">ACE_wrappers/TAO/MPC/config/taoidldefaults.mpb</em> ).
5177 The <em class="Code">-GA</em> option causes <em class=
5178 "Code">tao_idl</em> to generate an additional source file
5179 (based on the idl file name) with an <em class=
5180 "Code">A.cpp</em> extension. The <em class="Code">-Sc</em>
5181 option causes <em class="Code">tao_idl</em> to suppress the
5182 generation of <em class="Code">S_T</em> related files.
5183 </p>
5184
5185 <blockquote>
5186
5187 <p class="Code">Define_Custom(IDL) {</p>
5188
5189 <p class="Code">&nbsp;&nbsp;...</p>
5190
5191 <p class="Code">&nbsp;&nbsp;inputext = .idl</p>
5192
5193 <p class="Code">&nbsp;&nbsp;source_pre_extension = C, S</p>
5194
5195 <p class="Code">&nbsp;&nbsp;header_pre_extension = C, S</p>
5196
5197 <p class="Code">&nbsp;&nbsp;inline_pre_extension = C, S</p>
5198
5199 <p class="Code">
5200 &nbsp;&nbsp;source_outputext = .cpp, .cxx,
5201 .cc, .C
5202 </p>
5203
5204 <p class="Code">
5205 &nbsp;&nbsp;header_outputext = .h, .hpp,
5206 .hxx, .hh
5207 </p>
5208
5209 <p class="Code">&nbsp;&nbsp;inline_outputext = .inl, .i</p>
5210
5211 <p class="Code">
5212 &nbsp;&nbsp;keyword idlflags =
5213 commandflags
5214 </p>
5215
5216 <p class="Code">&nbsp;</p>
5217
5218 <p class="Code">
5219 &nbsp;&nbsp;optional(source_pre_extension)
5220 {
5221 </p>
5222
5223 <p class="Code">
5224 &nbsp;&nbsp;&nbsp;&nbsp;commandflags(-GA) +=
5225 A
5226 </p>
5227
5228 <p class="Code">&nbsp;&nbsp;}</p>
5229
5230 <p class="Code">
5231 &nbsp;&nbsp;optional(template_outputext)
5232 {
5233 </p>
5234
5235 <p class="Code">
5236 &nbsp;&nbsp;&nbsp;&nbsp;commandflags(!-Sc) +=
5237 S_T.cpp, S_T.cxx, S_T.cc, S_T.C
5238 </p>
5239
5240 <p class="Code">&nbsp;&nbsp;}</p>
5241
5242 <p class="Code">
5243 &nbsp;&nbsp;optional(header_pre_extension)
5244 {
5245 </p>
5246
5247 <p class="Code">
5248 &nbsp;&nbsp;&nbsp;&nbsp;commandflags(!-Sc) +=
5249 S_T
5250 </p>
5251
5252 <p class="Code">&nbsp;&nbsp;}</p>
5253
5254 <p class="Code">
5255 &nbsp;&nbsp;optional(inline_pre_extension)
5256 {
5257 </p>
5258
5259 <p class="Code">
5260 &nbsp;&nbsp;&nbsp;&nbsp;commandflags(!-Sc) +=
5261 S_T
5262 </p>
5263
5264 <p class="Code">&nbsp;&nbsp;}</p>
5265
5266 <p class="Code">}</p>
5267
5268 <p class="Code">&nbsp;</p>
5269 </blockquote>
5270
5271 <p class="Body">
5272 For custom file types, there are a few
5273 keywords that can be used within the custom file type component
5274 lists: <em class="Code">command</em>, <em class=
5275 "Code">commandflags</em>, <em class="Code">dependent</em>,
5276 <em class="Code">dependent_libs</em>, <em class="Code">gendir</em>,
5277 <em class="Code">postcommand</em>, and <em class=
5278 "Code">recurse</em>.
5279 </p>
5280
5281 <p class="Body">
5282 The <em class="Code">recurse</em> keyword
5283 works as described in <a href="MakeProjectCreator.html#82186"
5284 class="XRef">Assignment Keywords</a>.
5285 </p>
5286
5287 <p class="Body">
5288 The <em class="Code">command</em>, <em class=
5289 "Code">commandflags</em>, <em class="Code">dependent</em>,
5290 <em class="Code">dependent_libs</em> and
5291 <em class="Code">postcommand</em> keywords can be used to
5292 augment or override the value defined in the <em class=
5293 "Code">Define_Custom</em> section.
5294 </p>
5295
5296 <p class="Body">
5297 The <em class="Code">gendir</em> keyword can
5298 be used (only if <em class="Code">output_option</em> is set in
5299 <em class="Code">Define_Custom</em> ) to specify the directory
5300 in which the generated output will go. Here is an example:
5301 </p>
5302
5303 <blockquote>
5304
5305 <p class="Code">MOC_Files {</p>
5306
5307 <p class="Code">&nbsp;&nbsp;commandflags += -nw</p>
5308
5309 <p class="Code">&nbsp;&nbsp;gendir = moc_generated</p>
5310
5311 <p class="Code">&nbsp;&nbsp;QtReactor.h</p>
5312
5313 <p class="Code">}</p>
5314
5315 <p class="Code">&nbsp;</p>
5316
5317 <p class="Code">Source_Files {</p>
5318
5319 <p class="Code">
5320 &nbsp;&nbsp;moc_generated/QtReactor_moc.cpp
5321 </p>
5322
5323 <p class="Code">}</p>
5324
5325
5326 </blockquote>
5327
5328 <p class="Body">
5329 In the above example, the <em class=
5330 "Code">-nw</em> option is added to <em class=
5331 "Code">commandflags</em> and the generated file (<em class=
5332 "Code">QtReactor_moc.cpp</em> ) is placed in the <em class=
5333 "Code">moc_generated</em> directory. If the <em class=
5334 "Code">MOC</em> custom definition did not have an <em class=
5335 "Code">output_option</em> setting, then options would need to
5336 be added to <em class="Code">commandflags</em> or a <em class=
5337 "Code">postcommand</em> would need to be defined to ensure that
5338 the output actually went into the <em class=
5339 "Code">moc_generated</em> directory.
5340 </p>
5341
5342
5343 <div>
5344 <h6 class="Head6">Modify_Custom</h6>
5345
5346
5347 <p class="Body">
5348 An existing <em class=
5349 "Code">Define_Custom</em> section can be modified by using
5350 <em class="Code">Modify_Custom</em>. The syntax of the body
5351 is identical to that of a <em class=
5352 "Code">Define_Custom</em>. The example below shows a
5353 modification to the TAO IDL defaults found in <em class=
5354 "Code">taoidldefaults.mpb</em> of the TAO+ACE distribution.
5355 Everything provided by the <em class=
5356 "Code">Define_Custom(IDL)</em> remains unchanged except for
5357 the values set within the <em class=
5358 "Code">Modify_Custom(IDL).</em>
5359 </p>
5360
5361 <blockquote>
5362
5363 <p class="Code">project: taoidldefaults {</p>
5364
5365 <p class="Code">&nbsp;&nbsp;specific(!automake) {</p>
5366
5367 <p class="Code">
5368 &nbsp;&nbsp;&nbsp;&nbsp;tao_idlflags += -Sc
5369 -hs _s.h -si _s.i -ss _s.cpp -hc .h -ci .i -cs .cpp
5370 </p>
5371
5372 <p class="Code">&nbsp;&nbsp;}</p>
5373
5374 <p class="Code">&nbsp;</p>
5375
5376 <p class="Code">
5377 &nbsp;&nbsp;// This allows "make idl_stubs"
5378 to work
5379 </p>
5380
5381 <p class="Code">&nbsp;&nbsp;verbatim(gnuace, macros) {</p>
5382
5383 <p class="Code">
5384 &nbsp;&nbsp;&nbsp;&nbsp;IDL_CLIENT_HDR_EXT
5385 ?= .h
5386 </p>
5387
5388 <p class="Code">
5389 &nbsp;&nbsp;&nbsp;&nbsp;IDL_CLIENT_INL_EXT
5390 ?= .i
5391 </p>
5392
5393 <p class="Code">
5394 &nbsp;&nbsp;&nbsp;&nbsp;IDL_CLIENT_SRC_EXT
5395 ?= .cpp
5396 </p>
5397
5398 <p class="Code">
5399 &nbsp;&nbsp;&nbsp;&nbsp;IDL_SERVER_HDR_EXT
5400 ?= _s.h
5401 </p>
5402
5403 <p class="Code">
5404 &nbsp;&nbsp;&nbsp;&nbsp;IDL_SERVER_INL_EXT
5405 ?= _s.i
5406 </p>
5407
5408 <p class="Code">
5409 &nbsp;&nbsp;&nbsp;&nbsp;IDL_SERVER_SRC_EXT
5410 ?= _s.cpp
5411 </p>
5412
5413 <p class="Code">&nbsp;&nbsp;}</p>
5414
5415 <p class="Code">&nbsp;</p>
5416
5417 <p class="Code">&nbsp;&nbsp;Modify_Custom(IDL) {</p>
5418
5419 <p class="Code">
5420 &nbsp;&nbsp;&nbsp;&nbsp;source_pre_extension = , _s
5421 </p>
5422
5423 <p class="Code">
5424 &nbsp;&nbsp;&nbsp;&nbsp;header_pre_extension = , _s
5425 </p>
5426
5427 <p class="Code">
5428 &nbsp;&nbsp;&nbsp;&nbsp;inline_pre_extension = , _s
5429 </p>
5430
5431 <p class="Code">
5432 &nbsp;&nbsp;&nbsp;&nbsp;inline_outputext
5433 &nbsp;&nbsp;&nbsp;&nbsp;= .i
5434 </p>
5435
5436 <p class="Code">&nbsp;&nbsp;}</p>
5437
5438 <p class="Code">}</p>
5439 <blockquote>
5440 </ul>
5441 </div>
5442
5443 <div>
5444 <h6 class="Head6">Custom Post Command</h6>
5445
5446
5447 <p class="BodyNoLead">
5448 When defining a <em class=
5449 "Code">postcommand</em> as part of a <em class=
5450 "Code">Define_Custom</em>, a few pseudo template variables
5451 are available to provide some flexibility. The following
5452 table shows the pseudo template variables that can be
5453 accessed only from the <em class="Code">postcommand</em>.
5454 Please note that <em class="Code">&lt;%</em> and <em class=
5455 "Code">%&gt;</em> are part of the syntax.
5456 </p>
5457
5458 <p style="list-style: none">
5459 <h6 class="NumberedTableTitle">
5460 Post Command Pseudo
5461 Variables
5462 </h6>
5463
5464 <table border="1" summary="Post Command Pseudo Variables">
5465 <tr>
5466 <th rowspan="1" colspan="1">
5467 <p class="Tbl-Heading">Variable</p>
5468 </th>
5469
5470 <th rowspan="1" colspan="1">
5471 <p class="Tbl-Heading">Description</p>
5472 </th>
5473 </tr>
5474
5475 <tr>
5476 <td rowspan="1" colspan="1">
5477 <p class="TblCode">
5478 <em class=
5479 "TableCode">&lt;%input%&gt;</em>
5480 </p>
5481 </td>
5482
5483 <td rowspan="1" colspan="1">
5484 <p class="Tbl-Body">
5485 The input file to the
5486 command.
5487 </p>
5488 </td>
5489 </tr>
5490
5491 <tr>
5492 <td rowspan="1" colspan="1">
5493 <p class="TblCode">
5494 <em class=
5495 "TableCode">&lt;%input_basename%&gt;</em>
5496 </p>
5497 </td>
5498
5499 <td rowspan="1" colspan="1">
5500 <p class="Tbl-Body">
5501 The basename of the input file to
5502 the command.
5503 </p>
5504 </td>
5505 </tr>
5506
5507 <tr>
5508 <td rowspan="1" colspan="1">
5509 <p class="TblCode">
5510 <em class=
5511 "TableCode">&lt;%input_dirname%&gt;</em>
5512 </p>
5513 </td>
5514
5515 <td rowspan="1" colspan="1">
5516 <p class="Tbl-Body">
5517 The directory name of the input
5518 file to the command.
5519 </p>
5520 </td>
5521 </tr>
5522
5523 <tr>
5524 <td rowspan="1" colspan="1">
5525 <p class="TblCode">
5526 <em class=
5527 "TableCode">&lt;%input_noext%&gt;</em>
5528 </p>
5529 </td>
5530
5531 <td rowspan="1" colspan="1">
5532 <p class="Tbl-Body">
5533 The input file to the command
5534 with the extension stripped off.
5535 </p>
5536 </td>
5537 </tr>
5538
5539 <tr>
5540 <td rowspan="1" colspan="1">
5541 <p class="TblCode">
5542 <em class=
5543 "TableCode">&lt;%input_ext%&gt;</em>
5544 </p>
5545 </td>
5546
5547 <td rowspan="1" colspan="1">
5548 <p class="Tbl-Body">
5549 This gives the file extension of
5550 the input file (if there is one).
5551 </p>
5552 </td>
5553 </tr>
5554
5555 <tr>
5556 <td rowspan="1" colspan="1">
5557 <p class="TblCode">
5558 <em class=
5559 "TableCode">&lt;%output%&gt;</em>
5560 </p>
5561 </td>
5562
5563 <td rowspan="1" colspan="1">
5564 <p class="Tbl-Body">
5565 The output file created by the
5566 original command.
5567 </p>
5568 </td>
5569 </tr>
5570
5571 <tr>
5572 <td rowspan="1" colspan="1">
5573 <p class="TblCode">
5574 <em class=
5575 "TableCode">&lt;%output_basename%&gt;</em>
5576 </p>
5577 </td>
5578
5579 <td rowspan="1" colspan="1">
5580 <p class="Tbl-Body">
5581 The basename of the output file
5582 to the command.
5583 </p>
5584 </td>
5585 </tr>
5586
5587 <tr>
5588 <td rowspan="1" colspan="1">
5589 <p class="TblCode">
5590 <em class=
5591 "TableCode">&lt;%output_dirname%&gt;</em>
5592 </p>
5593 </td>
5594
5595 <td rowspan="1" colspan="1">
5596 <p class="Tbl-Body">
5597 The directory name of the output
5598 file to the command.
5599 </p>
5600 </td>
5601 </tr>
5602
5603 <tr>
5604 <td rowspan="1" colspan="1">
5605 <p class="TblCode">
5606 <em class=
5607 "TableCode">&lt;%output_noext%&gt;</em>
5608 </p>
5609 </td>
5610
5611 <td rowspan="1" colspan="1">
5612 <p class="Tbl-Body">
5613 The output file created by the
5614 original command with the extension stripped off.
5615 </p>
5616 </td>
5617 </tr>
5618
5619 <tr>
5620 <td rowspan="1" colspan="1">
5621 <p class="TblCode">
5622 <em class=
5623 "TableCode">&lt;%output_ext%&gt;</em>
5624 </p>
5625 </td>
5626
5627 <td rowspan="1" colspan="1">
5628 <p class="Tbl-Body">
5629 This gives the file extension of
5630 the output file (if there is one).
5631 </p>
5632 </td>
5633 </tr>
5634
5635 <tr>
5636 <td rowspan="1" colspan="2">
5637 <p class="TblCode">
5638 The output file can be referenced
5639 as a generic output file, or it can be referenced as
5640 a component file using one of the following
5641 variables. If it does not match the specific type the
5642 value will be empty.
5643 </p>
5644 </td>
5645 </tr>
5646
5647 <tr>
5648 <td rowspan="1" colspan="1">
5649 <p class="TblCode">
5650 <em class=
5651 "TableCode">&lt;%documentation_file%&gt;</em>
5652 </p>
5653 </td>
5654
5655 <td rowspan="1" colspan="1">
5656 <p class="Tbl-Body">
5657 The output file if it is a
5658 documentation file.
5659 </p>
5660 </td>
5661 </tr>
5662
5663 <tr>
5664 <td rowspan="1" colspan="1">
5665 <p class="TblCode">
5666 <em class=
5667 "TableCode">&lt;%header_file%&gt;</em>
5668 </p>
5669 </td>
5670
5671 <td rowspan="1" colspan="1">
5672 <p class="Tbl-Body">
5673 The output file if it has a
5674 header file extension.
5675 </p>
5676 </td>
5677 </tr>
5678
5679 <tr>
5680 <td rowspan="1" colspan="1">
5681 <p class="TblCode">
5682 <em class=
5683 "TableCode">&lt;%inline_file%&gt;</em>
5684 </p>
5685 </td>
5686
5687 <td rowspan="1" colspan="1">
5688 <p class="Tbl-Body">
5689 The output file if it has an
5690 inline file extension.
5691 </p>
5692 </td>
5693 </tr>
5694
5695 <tr>
5696 <td rowspan="1" colspan="1">
5697 <p class="TblCode">
5698 <em class=
5699 "TableCode">&lt;%resource_file%&gt;</em> (<em class=
5700 "TableCode">&lt;%resx_file%&gt;</em> for C# and
5701 VB)
5702 </p>
5703 </td>
5704
5705 <td rowspan="1" colspan="1">
5706 <p class="Tbl-Body">
5707 The output file if it has a
5708 resource file extension.
5709 </p>
5710 </td>
5711 </tr>
5712
5713 <tr>
5714 <td rowspan="1" colspan="1">
5715 <p class="TblCode">
5716 <em class=
5717 "TableCode">&lt;%source_file%&gt;</em>
5718 </p>
5719 </td>
5720
5721 <td rowspan="1" colspan="1">
5722 <p class="Tbl-Body">
5723 The output file if it has a
5724 source file extension.
5725 </p>
5726 </td>
5727 </tr>
5728
5729 <tr>
5730 <td rowspan="1" colspan="1">
5731 <p class="TblCode">
5732 <em class=
5733 "TableCode">&lt;%template_file%&gt;</em>
5734 </p>
5735 </td>
5736
5737 <td rowspan="1" colspan="1">
5738 <p class="Tbl-Body">
5739 The output file if it is a
5740 template file.
5741 </p>
5742 </td>
5743 </tr>
5744
5745 <tr>
5746 <td rowspan="1" colspan="1">
5747 <p class="TblCode">
5748 <em class=
5749 "TableCode">&lt;%documentation_file_noext%&gt;</em>
5750 </p>
5751 </td>
5752
5753 <td rowspan="1" colspan="1">
5754 <p class="Tbl-Body">
5755 The output file without an
5756 extension if it is a documentation file.
5757 </p>
5758 </td>
5759 </tr>
5760
5761 <tr>
5762 <td rowspan="1" colspan="1">
5763 <p class="TblCode">
5764 <em class=
5765 "TableCode">&lt;%header_file_noext%&gt;</em>
5766 </p>
5767 </td>
5768
5769 <td rowspan="1" colspan="1">
5770 <p class="Tbl-Body">
5771 The output file without an
5772 extension if it has a header file extension.
5773 </p>
5774 </td>
5775 </tr>
5776
5777 <tr>
5778 <td rowspan="1" colspan="1">
5779 <p class="TblCode">
5780 <em class=
5781 "TableCode">&lt;%inline_file_noext%&gt;</em>
5782 </p>
5783 </td>
5784
5785 <td rowspan="1" colspan="1">
5786 <p class="Tbl-Body">
5787 The output file without an
5788 extension if it has an inline file extension.
5789 </p>
5790 </td>
5791 </tr>
5792
5793 <tr>
5794 <td rowspan="1" colspan="1">
5795 <p class="TblCode">
5796 <em class=
5797 "TableCode">&lt;%resource_file_noext%&gt;</em>
5798 (<em class="TableCode">&lt;%resx_file_noext%&gt;</em>
5799 for C# and VB)
5800 </p>
5801 </td>
5802
5803 <td rowspan="1" colspan="1">
5804 <p class="Tbl-Body">
5805 The output file without an
5806 extension if it has a resource file extension.
5807 </p>
5808 </td>
5809 </tr>
5810
5811 <tr>
5812 <td rowspan="1" colspan="1">
5813 <p class="TblCode">
5814 <em class=
5815 "TableCode">&lt;%source_file_noext%&gt;</em>
5816 </p>
5817 </td>
5818
5819 <td rowspan="1" colspan="1">
5820 <p class="Tbl-Body">
5821 The output file without an
5822 extension if it has a source file extension.
5823 </p>
5824 </td>
5825 </tr>
5826
5827 <tr>
5828 <td rowspan="1" colspan="1">
5829 <p class="TblCode">
5830 <em class=
5831 "TableCode">&lt;%template_file_noext%&gt;</em>
5832 </p>
5833 </td>
5834
5835 <td rowspan="1" colspan="1">
5836 <p class="Tbl-Body">
5837 The output file without an
5838 extension if it is a template file.
5839 </p>
5840 </td>
5841 </tr>
5842
5843 <tr>
5844 <td rowspan="1" colspan="2">
5845 <p class="TblCode">
5846 The extensions of the input and
5847 output files are also available as pseudo
5848 variables.
5849 </p>
5850 </td>
5851 </tr>
5852
5853 <tr>
5854 <td rowspan="1" colspan="1">
5855 <p class="TblCode">
5856 <em class=
5857 "TableCode">&lt;%input_ext%&gt;</em>
5858 </p>
5859 </td>
5860
5861 <td rowspan="1" colspan="1">
5862 <p class="Tbl-Body">
5863 The extension of the input file
5864 (if it has one).
5865 </p>
5866 </td>
5867 </tr>
5868
5869 <tr>
5870 <td rowspan="1" colspan="1">
5871 <p class="TblCode">
5872 <em class=
5873 "TableCode">&lt;%output_ext%&gt;</em>
5874 </p>
5875 </td>
5876
5877 <td rowspan="1" colspan="1">
5878 <p class="Tbl-Body">
5879 The extension of the output file
5880 (if it has one).
5881 </p>
5882 </td>
5883 </tr>
5884 </table>
5885 </p>
5886
5887
5888
5889 <p class="Body">
5890 The following table describes the pseudo
5891 template variables that can be used in the <em class=
5892 "Code">command</em>, <em class="Code">commandflags</em>,
5893 <em class="Code">dependent</em>, <em class=
5894 "Code">output_option</em> and <em class=
5895 "Code">postcommand</em> settings.
5896 </p>
5897
5898 <p style="list-style: none">
5899 <h6 class="NumberedTableTitle">
5900 <a name=
5901 "Common_Pseudo_Variables"></a>Common Pseudo Variables
5902 </h6>
5903
5904 <table border="1" summary="Common Pseudo Variables">
5905 <tr>
5906 <th rowspan="1" colspan="1">
5907 <p class="Tbl-Heading">Variable</p>
5908 </th>
5909
5910 <th rowspan="1" colspan="1">
5911 <p class="Tbl-Heading">Description</p>
5912 </th>
5913 </tr>
5914
5915 <tr>
5916 <td rowspan="1" colspan="1">
5917 <p class="TblCode">
5918 <em class=
5919 "TableCode">&lt;%and%&gt;</em>
5920 </p>
5921 </td>
5922
5923 <td rowspan="1" colspan="1">
5924 <p class="Tbl-Body">
5925 A platform and project
5926 non-specific representation of a command conditional
5927 and.
5928 </p>
5929 </td>
5930 </tr>
5931
5932 <tr>
5933 <td rowspan="1" colspan="1">
5934 <p class="TblCode">
5935 <em class=
5936 "TableCode">&lt;%cat%&gt;</em>
5937 </p>
5938 </td>
5939
5940 <td rowspan="1" colspan="1">
5941 <p class="Tbl-Body">
5942 A platform non-specific command
5943 to print a file to the terminal.
5944 </p>
5945 </td>
5946 </tr>
5947
5948 <tr>
5949 <td rowspan="1" colspan="1">
5950 <p class="TblCode">
5951 <em class=
5952 "TableCode">&lt;%cmdsep%&gt;</em>
5953 </p>
5954 </td>
5955
5956 <td rowspan="1" colspan="1">
5957 <p class="Tbl-Body">
5958 A project and platform
5959 non-specific command separator which always runs
5960 right-hand side of the command. For example, in the
5961 following pseudo command string, both the <em class=
5962 "Code">&lt;%cat%&gt;</em> and <em class=
5963 "Code">&lt;%mv%&gt;</em> commands would be run.
5964 <em class="Code">
5965 &lt;%cat%&gt; &lt;%source_file%&gt;
5966 &lt;%gt%&gt; foo &lt;%cmdsep%&gt; &lt;%mv%&gt; foo
5967 other_dir
5968 </em>
5969 </p>
5970 </td>
5971 </tr>
5972
5973 <tr>
5974 <td rowspan="1" colspan="1">
5975 <p class="TblCode">
5976 <em class=
5977 "TableCode">&lt;%cmp%&gt;</em>
5978 </p>
5979 </td>
5980
5981 <td rowspan="1" colspan="1">
5982 <p class="Tbl-Body">
5983 A platform non-specific command
5984 to compare two files.
5985 </p>
5986 </td>
5987 </tr>
5988
5989 <tr>
5990 <td rowspan="1" colspan="1">
5991 <p class="TblCode">
5992 <em class=
5993 "TableCode">&lt;%cp%&gt;</em>
5994 </p>
5995 </td>
5996
5997 <td rowspan="1" colspan="1">
5998 <p class="Tbl-Body">
5999 A platform non-specific command
6000 to copy a file.
6001 </p>
6002 </td>
6003 </tr>
6004
6005 <tr>
6006 <td rowspan="1" colspan="1">
6007 <p class="TblCode">
6008 <em class=
6009 "TableCode">&lt;%crlf%&gt;</em>
6010 </p>
6011 </td>
6012
6013 <td rowspan="1" colspan="1">
6014 <p class="Tbl-Body">
6015 A platform non-specific line
6016 ending.
6017 </p>
6018 </td>
6019 </tr>
6020
6021 <tr>
6022 <td rowspan="1" colspan="1">
6023 <p class="TblCode">
6024 <em class=
6025 "TableCode">&lt;%equote%&gt;</em>
6026 </p>
6027 </td>
6028
6029 <td rowspan="1" colspan="1">
6030 <p class="Tbl-Body">
6031 A project non-specific escaped
6032 double quote.
6033 </p>
6034 </td>
6035 </tr>
6036
6037 <tr>
6038 <td rowspan="1" colspan="1">
6039 <p class="TblCode">
6040 <em class=
6041 "TableCode">&lt;%gendir%&gt;</em>
6042 </p>
6043 </td>
6044
6045 <td rowspan="1" colspan="1">
6046 <p class="Tbl-Body">
6047 The output directory specified by
6048 the <em class="Code">gendir</em> setting. This
6049 variable is not available to <em class=
6050 "Code">postbuild</em>, <em class=
6051 "Code">postclean</em>, or<em class=
6052 "Code">prebuild.</em>
6053 </p>
6054 </td>
6055 </tr>
6056
6057 <tr>
6058 <td rowspan="1" colspan="1">
6059 <p class="TblCode">
6060 <em class=
6061 "TableCode">&lt;%gt%&gt;</em>
6062 </p>
6063 </td>
6064
6065 <td rowspan="1" colspan="1">
6066 <p class="Tbl-Body">
6067 A platform and project
6068 non-specific representation of a greater than
6069 sign.
6070 </p>
6071 </td>
6072 </tr>
6073
6074 <tr>
6075 <td rowspan="1" colspan="1">
6076 <p class="TblCode">
6077 <em class=
6078 "TableCode">&lt;%lt%&gt;</em>
6079 </p>
6080 </td>
6081
6082 <td rowspan="1" colspan="1">
6083 <p class="Tbl-Body">
6084 A platform and project
6085 non-specific representation of a less than sign.
6086 </p>
6087 </td>
6088 </tr>
6089
6090 <tr>
6091 <td rowspan="1" colspan="1">
6092 <p class="TblCode">
6093 <em class=
6094 "TableCode">&lt;%mkdir%&gt;</em>
6095 </p>
6096 </td>
6097
6098 <td rowspan="1" colspan="1">
6099 <p class="Tbl-Body">
6100 A platform non-specific command
6101 to make a directory.
6102 </p>
6103 </td>
6104 </tr>
6105
6106 <tr>
6107 <td rowspan="1" colspan="1">
6108 <p class="TblCode">
6109 <em class=
6110 "TableCode">&lt;%mv%&gt;</em>
6111 </p>
6112 </td>
6113
6114 <td rowspan="1" colspan="1">
6115 <p class="Tbl-Body">
6116 A platform non-specific command
6117 to move a file.
6118 </p>
6119 </td>
6120 </tr>
6121
6122 <tr>
6123 <td rowspan="1" colspan="1">
6124 <p class="TblCode">
6125 <em class=
6126 "TableCode">&lt;%nul%&gt;</em>
6127 </p>
6128 </td>
6129
6130 <td rowspan="1" colspan="1">
6131 <p class="Tbl-Body">
6132 A platform non-specific null
6133 device.
6134 </p>
6135 </td>
6136 </tr>
6137
6138 <tr>
6139 <td rowspan="1" colspan="1">
6140 <p class="TblCode">
6141 <em class=
6142 "TableCode">&lt;%pathsep%&gt;</em>
6143 </p>
6144 </td>
6145
6146 <td rowspan="1" colspan="1">
6147 <p class="Tbl-Body">
6148 A platform non-specific path
6149 separator (; or :).
6150 </p>
6151 </td>
6152 </tr>
6153
6154 <tr>
6155 <td rowspan="1" colspan="1">
6156 <p class="TblCode">
6157 <em class=
6158 "TableCode">&lt;%or%&gt;</em>
6159 </p>
6160 </td>
6161
6162 <td rowspan="1" colspan="1">
6163 <p class="Tbl-Body">
6164 A platform and project
6165 non-specific representation of a command conditional
6166 or.
6167 </p>
6168 </td>
6169 </tr>
6170
6171 <tr>
6172 <td rowspan="1" colspan="1">
6173 <p class="TblCode">
6174 <em class=
6175 "TableCode">&lt;%os%&gt;</em>
6176 </p>
6177 </td>
6178
6179 <td rowspan="1" colspan="1">
6180 <p class="Tbl-Body">Returns either win32 or unix.</p>
6181 </td>
6182 </tr>
6183
6184 <tr>
6185 <td rowspan="1" colspan="1">
6186 <p class="TblCode">
6187 <em class=
6188 "TableCode">&lt;%prj_type%&gt;</em>
6189 </p>
6190 </td>
6191
6192 <td rowspan="1" colspan="1">
6193 <p class="Tbl-Body">
6194 The project type as supplied
6195 by the -type command line option.
6196 </p>
6197 </td>
6198 </tr>
6199
6200 <tr>
6201 <td rowspan="1" colspan="1">
6202 <p class="TblCode">
6203 <em class=
6204 "TableCode">&lt;%quote%&gt;</em>
6205 </p>
6206 </td>
6207
6208 <td rowspan="1" colspan="1">
6209 <p class="Tbl-Body">
6210 A project non-specific
6211 representation of a double quote.
6212 </p>
6213 </td>
6214 </tr>
6215
6216 <tr>
6217 <td rowspan="1" colspan="1">
6218 <p class="TblCode">
6219 <em class=
6220 "TableCode">&lt;%rm%&gt;</em>
6221 </p>
6222 </td>
6223
6224 <td rowspan="1" colspan="1">
6225 <p class="Tbl-Body">
6226 A platform non-specific command
6227 to delete a file.
6228 </p>
6229 </td>
6230 </tr>
6231
6232 <tr>
6233 <td rowspan="1" colspan="1">
6234 <p class="TblCode">
6235 <em class=
6236 "TableCode">&lt;%rmdir%&gt;</em>
6237 </p>
6238 </td>
6239
6240 <td rowspan="1" colspan="1">
6241 <p class="Tbl-Body">
6242 A platform non-specific recursive
6243 directory delete command.
6244 </p>
6245 </td>
6246 </tr>
6247
6248 <tr>
6249 <td rowspan="1" colspan="1">
6250 <p class="TblCode">
6251 <em class=
6252 "TableCode">&lt;%slash%&gt;</em>
6253 </p>
6254 </td>
6255
6256 <td rowspan="1" colspan="1">
6257 <p class="Tbl-Body">
6258 A platform non-specific directory
6259 separator.
6260 </p>
6261 </td>
6262 </tr>
6263
6264 <tr>
6265 <td rowspan="1" colspan="1">
6266 <p class="TblCode">
6267 <em class=
6268 "TableCode">&lt;%temporary%&gt;</em>
6269 </p>
6270 </td>
6271
6272 <td rowspan="1" colspan="1">
6273 <p class="Tbl-Body">
6274 A temporary file name. The
6275 generated temporary file name contains no directory
6276 portion and is the same for each use within the same
6277 variable setting.
6278 </p>
6279 </td>
6280 </tr>
6281
6282 <tr>
6283 <td rowspan="1" colspan="2">
6284 <p class="TblCode">
6285 The following variables will
6286 be set to the known extension for Windows based
6287 project types and empty on non-Windows based
6288 project types.
6289 </p>
6290 </td>
6291 </tr>
6292
6293 <tr>
6294 <td rowspan="1" colspan="1">
6295 <p class="TblCode">
6296 <em class=
6297 "TableCode">&lt;%bat%&gt;</em>
6298 </p>
6299 </td>
6300
6301 <td rowspan="1" colspan="1">
6302 <p class="Tbl-Body">
6303 The extension for batch
6304 files.
6305 </p>
6306 </td>
6307 </tr>
6308
6309 <tr>
6310 <td rowspan="1" colspan="1">
6311 <p class="TblCode">
6312 <em class=
6313 "TableCode">&lt;%cmd%&gt;</em>
6314 </p>
6315 </td>
6316
6317 <td rowspan="1" colspan="1">
6318 <p class="Tbl-Body">
6319 The extension for command
6320 files.
6321 </p>
6322 </td>
6323 </tr>
6324
6325 <tr>
6326 <td rowspan="1" colspan="1">
6327 <p class="TblCode">
6328 <em class=
6329 "TableCode">&lt;%exe%&gt;</em>
6330 </p>
6331 </td>
6332
6333 <td rowspan="1" colspan="1">
6334 <p class="Tbl-Body">
6335 The extension for executable
6336 files.
6337 </p>
6338 </td>
6339 </tr>
6340 </table>
6341 </p>
6342
6343 </div>
6344 </div>
6345 </div>
6346
6347 <div>
6348 <a name="TheFeatureFile" id="TheFeatureFile"></a>
6349
6350 <h5 class="Head4">The Feature File</h5>
6351
6352
6353 <p class="BodyNoLead">
6354 The term feature, as used by MPC,
6355 describes different concepts or external software that a project
6356 may require in order to build properly. The feature file
6357 determines which features are enabled or disabled which has a
6358 direct effect on whether or not MPC generates a project.
6359 </p>
6360
6361 <p class="Body">
6362 It supports the standard comment (<em class=
6363 "Code">//</em> ) and assignment of numbers to feature names.
6364 These feature names will correspond to values given to the
6365 <em class="Code">requires</em> and <em class="Code">avoids</em>
6366 keywords in mpc files.
6367 </p>
6368
6369 <p class="Body">
6370 If a feature is not listed in the feature file
6371 or is listed with a boolean value of true (1), that feature is
6372 enabled. If a feature is listed and has a boolean value of false
6373 (0), that feature is disabled.
6374 </p>
6375
6376 <p class="Body">
6377 If a feature name is listed in the <em class=
6378 "Code">requires</em> value for a particular project and that
6379 feature is enabled, that project will be generated. If the
6380 feature is not enabled, the project will not be generated.
6381 </p>
6382
6383 <p class="Body">
6384 The opposite holds true for the <em class=
6385 "Code">avoids</em> keyword. If a feature name is listed in the
6386 <em class="Code">avoids</em> value for a project and the feature
6387 is disabled, that project will be generated. If the feature is
6388 enabled, the project will not be generated.
6389 </p>
6390
6391 <p class="Body">
6392 The global feature file for MPC contains the
6393 following values.
6394 </p>
6395
6396 <blockquote>
6397
6398 <p class="Code">boost = 0</p>
6399
6400 <p class="Code">bzip2 = 0</p>
6401
6402 <p class="Code">erlang = 0</p>
6403
6404 <p class="Code">java = 0</p>
6405
6406 <p class="Code">mfc = 0</p>
6407
6408 <p class="Code">libpng = 0</p>
6409
6410 <p class="Code">openssl11 = 0</p>
6411
6412 <p class="Code">python = 0</p>
6413
6414 <p class="Code">qt = 0</p>
6415
6416 <p class="Code">qt4 = 0</p>
6417
6418 <p class="Code">qt5 = 0</p>
6419
6420 <p class="Code">rpc = 0</p>
6421
6422 <p class="Code">swig_java = 0</p>
6423
6424 <p class="Code">swig_perl = 0</p>
6425
6426 <p class="Code">swig_php = 0</p>
6427
6428 <p class="Code">swig_python = 0</p>
6429
6430 <p class="Code">swig_ruby = 0</p>
6431
6432 <p class="Code">swig_tcl = 0</p>
6433
6434 <p class="Code">uses_wchar = 0</p>
6435
6436 <p class="Code">wireshark_any = 0</p>
6437
6438 <p class="Code">wireshark = 0</p>
6439
6440 <p class="Code">wireshark_cmake = 0</p>
6441
6442 <p class="Code">xalanc = 0</p>
6443
6444 <p class="Code">xerces = 0</p>
6445
6446 <p class="Code">xerces2 = 0</p>
6447
6448 <p class="Code">xerces3 = 0</p>
6449
6450 <p class="Code">ziparchive = 0</p>
6451
6452 <p class="Code">zlib = 0</p>
6453
6454 <p class="Code">zzip = 0</p>
6455
6456
6457 </blockquote>
6458
6459 <p class="Body">
6460 In the above contents, all of these features are
6461 disabled for each project generated. If these values do not suit
6462 your needs, then you must do one of the following:
6463 </p>
6464
6465 <p class="BodyNoLead">
6466 <ul>
6467 <li>
6468 Create a project specific feature file in the <em class=
6469 "Code">config</em> directory (ex., <em class=
6470 "Code">make.features</em> for the <em class="Code">make</em>
6471 project type) to set features for a particular project
6472 type.
6473 </li>
6474
6475 <li>
6476 Create a <em class="Code">default.features</em> file in
6477 the <em class="Code">config</em> directory that contains the
6478 feature set you need. These will be applied to all project
6479 types.
6480 </li>
6481
6482 <li>
6483 Create a feature file anywhere you like with the features
6484 you want and use the <em class="Code">-feature_file</em>
6485 option to specify the location.
6486 </li>
6487
6488 <li>
6489 Use the <em class="Code">-features</em> option to
6490 dynamically modify the feature settings.
6491 </li>
6492 </ul>
6493 </p>
6494
6495 <p class="Body">
6496 Generated projects will have a combination of
6497 features specified in the <em class="Code">global.features</em>
6498 file as well as in your feature file. Therefore, if a feature is
6499 disabled in the global file and you want to enable it, you must
6500 explicitly enable it in your feature file.
6501 </p>
6502
6503 </div>
6504
6505 <div>
6506 <h5 class="Head4">Feature Projects</h5>
6507
6508
6509 <p class="Body">
6510 A feature project contains information as
6511 a project would, but can only be a base project and will only be
6512 added to a sub project if the features that it requires are
6513 enabled or the features that it avoids are disabled.
6514 </p>
6515
6516 <p class="Body">
6517 A feature definition requires at least one
6518 feature name. A name by itself specifies that the feature must be
6519 enabled. A &rsquo;!&rsquo; in front of the feature name indicates
6520 that the feature must be disabled. There may be more than one
6521 comma separated feature listed between the parenthesis.
6522 </p>
6523
6524 <p class="Body">
6525 The following example show how to declare a
6526 feature project.
6527 </p>
6528
6529 <blockquote>
6530
6531 <p class="Code">// ziparchive.mpb</p>
6532
6533 <p class="Code">feature(ziparchive) {</p>
6534
6535 <p class="Code">&nbsp;&nbsp;includes += $(ZIPARCHIVEROOT)</p>
6536
6537 <p class="Code">
6538 &nbsp;&nbsp;libpaths +=
6539 $(ZIPARCHIVEROOT)/lib
6540 </p>
6541
6542 <p class="Code">
6543 &nbsp;&nbsp;libs &nbsp;&nbsp;&nbsp;&nbsp;+=
6544 ziparch
6545 </p>
6546
6547 <p class="Code">}</p>
6548
6549 <p class="Code">&nbsp;</p>
6550 </blockquote>
6551
6552 <p class="Body">
6553 With this example, any project that inherits
6554 from the <em class="Code">ziparchive</em> base feature project
6555 will contain the project information only if the <em class=
6556 "Code">ziparchive</em> feature is enabled.
6557 </p>
6558
6559 </div>
6560 </div>
6561
6562 <div>
6563 <h4 class="Head3">Defaults</h4>
6564
6565
6566 <p class="BodyNoLead">
6567 MPC has been designed to minimize the amount
6568 of maintenance that goes into keeping build tool files up-to-date
6569 with the project. If your source code is organized <em class=
6570 "Emphasis">properly</em>, the maintenance of your mpc files should
6571 be minimal.
6572 </p>
6573
6574 <p class="Body">
6575 With the use of inheritance and proper code
6576 arrangement, an mpc file for a TAO related project may be as simple
6577 as:
6578 </li>
6579
6580 <blockquote>
6581
6582 <p class="Code">project: taoserver {</p>
6583
6584 <p class="Code">}</p>
6585
6586
6587 </blockquote>
6588
6589 <p class="Body">
6590 This project definition could be used to generate
6591 a project for a TAO server with multiple idl, header and source
6592 files.
6593 </p>
6594
6595 <p class="Body">
6596 The idea of <em class="Emphasis">proper</em>
6597 source layout is basically summarized as <em class="Emphasis">
6598 one
6599 directory per binary target.
6600 </em> If only the files that pertain to
6601 a single target are located in the directory with the mpc file,
6602 then the MPC defaults will satisfy most project needs.
6603 </p>
6604
6605 <p class="Body">
6606 Of course, it will not always be possible or
6607 desirable to organize your project code in this fashion, so all
6608 defaulting behavior can be overridden. The next sections describe
6609 the default behaviors of MPC and how to override them.
6610 </p>
6611
6612
6613 <div>
6614 <h5 class="Head4">Source Files</h5>
6615
6616 <p class="BodyNoLead">
6617 New source files are added and others are
6618 removed quite often in a developing project. If the <em class=
6619 "Code">Source_Files</em> component is left out of an mpc file,
6620 then MPC will assume that any file matching one of the <em class=
6621 "Emphasis">source</em> extensions is to be included in the
6622 project. For most project types, the source extensions are:
6623 <em class="Code">.cpp</em>, <em class="Code">.cxx</em>,
6624 <em class="Code">.cc</em>, <em class="Code">.c</em> and
6625 <em class="Code">.C</em>. Only the following extensions are
6626 considered source extensions: <em class="Code">.cpp</em>,
6627 <em class="Code">.cxx</em> and <em class="Code">.c</em> for the
6628 <em class="Code">em3</em> and <em class="Code">vc6</em> project
6629 types as eMbedded Visual C++ and Visual C++ 6.0 do not understand
6630 files with the <em class="Code">.cc</em> or <em class=
6631 "Code">.C</em> extension.
6632 </p>
6633
6634 </div>
6635
6636 <div>
6637 <h5 class="Head4">Template Files</h5>
6638
6639
6640 <p class="BodyNoLead">
6641 MPC assumes that any file matching one of
6642 the <em class="Emphasis">template</em> extensions is to be
6643 included in the project if the <em class=
6644 "Code">Template_Files</em> component is left out of an mpc file.
6645 For most project types, the template extensions are: <em class=
6646 "Code">_T.cpp</em>, <em class="Code">_T.cxx</em>, <em class=
6647 "Code">_T.cc</em>, <em class="Code">_T.c</em>, and <em class=
6648 "Code">_T.C</em>. However, only the <em class="Code">_T.cpp</em>
6649 and <em class="Code">_T.cxx</em> extensions are considered
6650 template extensions for the <em class="Code">em3</em> and
6651 <em class="Code">vc6</em> project types.
6652 </p>
6653
6654 <p class="Body">
6655 If the <em class="Code">Source_Files</em>
6656 component is defaulted, and a file is explicitly listed in the
6657 Template_Files section that happens to appear to MPC as a source
6658 file (i.e., has a source file extension, but does not have
6659 <em class="Code">_T</em> directly before it), MPC will
6660 automatically exclude it from the <em class=
6661 "Code">Source_Files</em> component.
6662 </p>
6663
6664 </div>
6665
6666 <div>
6667 <h5 class="Head4">Inline Files</h5>
6668
6669 <p class="BodyNoLead">
6670 As with source files, the <em class=
6671 "Code">Inline_Files</em> component can be left out of an mpc file
6672 to allow it to generate defaults. Files that match the <em class=
6673 "Code">.i</em> and <em class="Code">.inl</em> extensions are
6674 considered inline files.
6675 </p>
6676
6677 <p class="Body">
6678 The <em class="Code">Inline_Files</em> component
6679 has a special interaction with the <em class=
6680 "Code">Source_Files</em> component. If the <em class=
6681 "Code">Source_Files</em> component has files listed and the
6682 <em class="Code">Inline_Files</em> component is omitted, then
6683 each source file is <em class="Emphasis">matched</em> to an
6684 inline file. If the matching inline file is found or would be
6685 generated from a custom command, it is added to the <em class=
6686 "Code">Inline_Files</em> component list.
6687 </p>
6688
6689 </div>
6690
6691 <div>
6692 <h5 class="Head4">Header Files</h5>
6693
6694 <p class="BodyNoLead">
6695 As with source files, the <em class=
6696 "Code">Header_Files</em> component can be left out of an mpc file
6697 to allow it to generate defaults. Files that match the <em class=
6698 "Code">.h</em>, <em class="Code">.hpp</em>, <em class=
6699 "Code">.hxx</em>, and <em class="Code">.hh</em> extensions are
6700 considered header files.
6701 </p>
6702
6703 <p class="Body">
6704 The <em class="Code">Header_Files</em> component
6705 has a special interaction with the <em class=
6706 "Code">Source_Files</em> component. If the <em class=
6707 "Code">Source_Files</em> component has files listed and the
6708 <em class="Code">Header_Files</em> component is omitted, then
6709 each source file is <em class="Emphasis">matched</em> to a header
6710 file. If the matching header file is found or would be generated
6711 from a custom command, then it is added to the <em class=
6712 "Code">Header_Files</em> component list.
6713 </p>
6714
6715 </div>
6716
6717 <div>
6718 <h5 class="Head4">Documentation Files</h5>
6719
6720 <p class="BodyNoLead">
6721 The <em class=
6722 "Code">Documentation_Files</em> component, if omitted, will
6723 default to all files that end in the following: <em class=
6724 "Code">README</em>, <em class="Code">readme</em>, <em class=
6725 "Code">.doc</em>, <em class="Code">.html</em> and <em class=
6726 "Code">.txt</em>.
6727 </p>
6728
6729 </div>
6730
6731 <div>
6732 <h5 class="Head4">Resource Files</h5>
6733
6734
6735 <p class="BodyNoLead">
6736 The <em class="Code">Resource_Files</em>
6737 component, if omitted, will default to only the files that end in
6738 <em class="Code">.rc</em> and are similar to the name of the
6739 project. For example, if a directory contains three <em class=
6740 "Code">.rc</em> files and the project name is <em class=
6741 "Code">foo</em>, only the <em class="Code">.rc</em> files that
6742 contain the word <em class="Code">foo</em> will automatically be
6743 added to the <em class="Code">Resource_Files</em> component
6744 list.
6745 </p>
6746
6747 </div>
6748
6749 <div>
6750 <h5 class="Head4">Custom Defined Files</h5>
6751
6752
6753 <p class="BodyNoLead">
6754 The <em class="Code">
6755 Custom Defined
6756 Files
6757 </em> components have a special interaction with the
6758 <em class="Code">Source_Files</em> component. If the custom
6759 command generates source files and has the <em class=
6760 "Code">automatic_out</em> setting set to 1, they will
6761 automatically be added to the <em class="Code">Source_Files</em>
6762 component list. If any of the files listed in the <em class=
6763 "Code">Source_Files</em> components list match any of the
6764 generated source file names, then none of the generated source
6765 file names will be automatically added to the <em class=
6766 "Code">Source_Files</em> components list.
6767 </p>
6768
6769 </div>
6770
6771 <div>
6772 <a name="ExampleMPCFile" id="ExampleMPCFile"></a>
6773
6774 <h5 class="Head4">Example MPC File</h5>
6775
6776 <p class="BodyNoLead">
6777 The example below uses the directory
6778 contents of <em class=
6779 "Code">$TAO_ROOT/orbsvcs/performance-tests/RTEvent/lib</em> to
6780 illustrate the simplicity of mpc files:
6781 </p>
6782
6783 <blockquote>
6784
6785 <p class="Code">
6786 Auto_Disconnect.cpp Loopback_Supplier.h
6787 RTEC_Initializer.cpp
6788 </p>
6789
6790 <p class="Code">
6791 Auto_Disconnect.h Low_Priority_Setup.cpp
6792 RTEC_Initializer.h
6793 </p>
6794
6795 <p class="Code">
6796 Auto_Disconnect.inl Low_Priority_Setup.h
6797 rtec_perf_export.h
6798 </p>
6799
6800 <p class="Code">
6801 Auto_Functor.cpp Low_Priority_Setup.inl
6802 RTEC_Perf.mpc
6803 </p>
6804
6805 <p class="Code">Auto_Functor.h Makefile RTPOA_Setup.cpp</p>
6806
6807 <p class="Code">
6808 Auto_Functor.inl ORB_Holder.cpp
6809 RTPOA_Setup.h
6810 </p>
6811
6812 <p class="Code">
6813 Client_Group.cpp ORB_Holder.h
6814 RTPOA_Setup.inl
6815 </p>
6816
6817 <p class="Code">
6818 Client_Group.h ORB_Holder.inl
6819 RTServer_Setup.cpp
6820 </p>
6821
6822 <p class="Code">
6823 Client_Group.inl ORB_Shutdown.cpp
6824 RTServer_Setup.h
6825 </p>
6826
6827 <p class="Code">
6828 Client_Options.cpp ORB_Shutdown.h
6829 RTServer_Setup.inl
6830 </p>
6831
6832 <p class="Code">
6833 Client_Options.h ORB_Shutdown.inl
6834 Send_Task.cpp
6835 </p>
6836
6837 <p class="Code">
6838 Client_Pair.cpp ORB_Task_Activator.cpp
6839 Send_Task.h
6840 </p>
6841
6842 <p class="Code">
6843 Client_Pair.h ORB_Task_Activator.h
6844 Send_Task_Stopper.cpp
6845 </p>
6846
6847 <p class="Code">
6848 Client_Pair.inl ORB_Task_Activator.inl
6849 Send_Task_Stopper.h
6850 </p>
6851
6852 <p class="Code">
6853 Consumer.cpp ORB_Task.cpp
6854 Send_Task_Stopper.inl
6855 </p>
6856
6857 <p class="Code">Consumer.h ORB_Task.h Servant_var.cpp</p>
6858
6859 <p class="Code">Control.cpp ORB_Task.inl Servant_var.h</p>
6860
6861 <p class="Code">Control.h Peer_Base.cpp Servant_var.inl</p>
6862
6863 <p class="Code">EC_Destroyer.cpp Peer_Base.h Shutdown.cpp</p>
6864
6865 <p class="Code">
6866 EC_Destroyer.h PriorityBand_Setup.cpp
6867 Shutdown.h
6868 </p>
6869
6870 <p class="Code">
6871 EC_Destroyer.inl PriorityBand_Setup.h
6872 Shutdown.inl
6873 </p>
6874
6875 <p class="Code">
6876 Federated_Test.idl PriorityBand_Setup.inl
6877 Supplier.cpp
6878 </p>
6879
6880 <p class="Code">
6881 Implicit_Deactivator.cpp RIR_Narrow.cpp
6882 Supplier.h
6883 </p>
6884
6885 <p class="Code">
6886 Implicit_Deactivator.h RIR_Narrow.h
6887 SyncScope_Setup.cpp
6888 </p>
6889
6890 <p class="Code">
6891 Implicit_Deactivator.inl RT_Class.cpp
6892 SyncScope_Setup.h
6893 </p>
6894
6895 <p class="Code">
6896 Loopback_Consumer.cpp RT_Class.h
6897 SyncScope_Setup.inl
6898 </p>
6899
6900 <p class="Code">
6901 Loopback_Consumer.h RT_Class.inl
6902 TAO_RTEC_Perf.dsp
6903 </p>
6904
6905 <p class="Code">
6906 Loopback.cpp RTClient_Setup.cpp
6907 TAO_RTEC_Perf.dsw
6908 </p>
6909
6910 <p class="Code">
6911 Loopback.h RTClient_Setup.h
6912 Task_Activator.cpp
6913 </p>
6914
6915 <p class="Code">
6916 Loopback_Pair.cpp RTClient_Setup.inl
6917 Task_Activator.h
6918 </p>
6919
6920 <p class="Code">
6921 Loopback_Pair.h RTCORBA_Setup.cpp
6922 Task_Activator.inl
6923 </p>
6924
6925 <p class="Code">Loopback_Pair.inl RTCORBA_Setup.h</p>
6926
6927 <p class="Code">Loopback_Supplier.cpp RTCORBA_Setup.inl</p>
6928
6929 </blockquote>
6930
6931 <p class="Body">
6932 The following .mpc file (<em class=
6933 "Code">RTEC_Perf.mpc</em> ) shows the simple and small number of
6934 lines required to generate usable build tool project files.
6935 </p>
6936
6937 <blockquote>
6938
6939 <p class="Code">
6940 project(RTEC_Perf): strategies, rtcorbaevent,
6941 minimum_corba {
6942 </p>
6943
6944 <p class="Code">&nbsp;&nbsp;sharedname = TAO_RTEC_Perf</p>
6945
6946 <p class="Code">
6947 &nbsp;&nbsp;idlflags +=
6948 -Wb,export_macro=TAO_RTEC_Perf_Export \
6949 </p>
6950
6951 <p class="Code">
6952 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-Wb,export_include=rtec_perf_export.h
6953 </p>
6954
6955 <p class="Code">
6956 &nbsp;&nbsp;dllflags +=
6957 TAO_RTEC_PERF_BUILD_DLL
6958 </p>
6959
6960 <p class="Code">&nbsp;</p>
6961
6962 <p class="Code">&nbsp;&nbsp;Template_Files {</p>
6963
6964 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;Auto_Disconnect.cpp</p>
6965
6966 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;Auto_Functor.cpp</p>
6967
6968 <p class="Code">
6969 &nbsp;&nbsp;&nbsp;&nbsp;Low_Priority_Setup.cpp
6970 </p>
6971
6972 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;RIR_Narrow.cpp</p>
6973
6974 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;Servant_var.cpp</p>
6975
6976 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;Shutdown.cpp</p>
6977
6978 <p class="Code">&nbsp;&nbsp;&nbsp;&nbsp;Task_Activator.cpp</p>
6979
6980 <p class="Code">&nbsp;&nbsp;}</p>
6981
6982 <p class="Code">}</p>
6983
6984
6985 </blockquote>
6986
6987 <p class="Body">
6988 A line-by-line explanation of the example mpc
6989 file is listed below.
6990 </p>
6991
6992 <blockquote>
6993
6994 <p class="Code">
6995 project(RTEC_Perf): strategies, rtcorbaevent,
6996 minimum_corba {
6997 </p>
6998
6999
7000 </blockquote>
7001
7002 <p class="Body">
7003 The first line declares a project named
7004 <em class="Code">RTEC_Perf</em> that inherits from the base
7005 projects listed after the colon.
7006 </p>
7007
7008 <blockquote>
7009
7010 <p class="Code">sharedname = TAO_RTEC_Perf</p>
7011
7012
7013 </blockquote>
7014
7015 <p class="Body">
7016 Line two determines that the project is a
7017 library and the library name is <em class=
7018 "Code">TAO_RTEC_Perf</em>.
7019 </p>
7020
7021 <blockquote>
7022
7023 <p class="Code">
7024 idlflags +=
7025 -Wb,export_macro=TAO_RTEC_Perf_Export \
7026 </p>
7027
7028 <p class="Code">-Wb,export_include=rtec_perf_export.h</p>
7029
7030
7031 </blockquote>
7032
7033 <p class="Body">
7034 Lines three and four add to the flags passed to
7035 the IDL compiler when processing the idl files.
7036 </p>
7037
7038 <blockquote>
7039
7040 <p class="Code">dllflags += TAO_RTEC_PERF_BUILD_DLL</p>
7041
7042
7043 </blockquote>
7044
7045 <p class="Body">
7046 Line five adds <em class=
7047 "Code">TAO_RTEC_PERF_BUILD_DLL</em> to the <em class=
7048 "Code">dllflags</em>, which defines a macro that is used by the
7049 <em class="Code">rtec_perf_export.h</em> header file when
7050 building shared libraries on platforms that support symbol
7051 visibility.
7052 </p>
7053
7054 <blockquote>
7055
7056 <p class="Code">Template_Files {</p>
7057
7058 <p class="Code">&nbsp;&nbsp;Auto_Disconnect.cpp</p>
7059
7060 <p class="Code">&nbsp;&nbsp;Auto_Functor.cpp</p>
7061
7062 <p class="Code">&nbsp;&nbsp;Low_Priority_Setup.cpp</p>
7063
7064 <p class="Code">&nbsp;&nbsp;RIR_Narrow.cpp</p>
7065
7066 <p class="Code">&nbsp;&nbsp;Servant_var.cpp</p>
7067
7068 <p class="Code">&nbsp;&nbsp;Shutdown.cpp</p>
7069
7070 <p class="Code">&nbsp;&nbsp;Task_Activator.cpp</p>
7071
7072 <p class="Code">}</p>
7073
7074
7075 </blockquote>
7076
7077 <p class="Body">
7078 Lines 7 through 15 name the listed cpp files as
7079 part of the <em class="Code">Template_Files</em>. <br/><strong>Note:</strong>
7080 This usage of Template_Files refers to files containing C++ template declaration and
7081 definition source code and should not be confused with MPC <a href ="#MPD_Syntax">template files</a>
7082 which are used to define the structure of generated project files.
7083 </p>
7084
7085 <p class="Body">
7086 You may have noticed that there isn&rsquo;t much
7087 to the file above. With the default behaviors that are built into
7088 MPC, there does not need to be. We rely on the defaults to
7089 determine the values of <em class="Code">IDL_Files</em>,
7090 <em class="Code">Source_Files</em>, <em class=
7091 "Code">Inline_Files</em> , and <em class=
7092 "Code">Header_Files</em>. Since the template files in this example C++ project
7093 do not follow the naming convention assumed by the MPC built-in defaults
7094 (_T.cpp, _T.cxx, _T.cc, _T.C),
7095 we must explicitly list them. We also
7096 rely on inheritance to get many of the TAO-related options.
7097 </p>
7098
7099
7100 </div>
7101 </div>
7102 </div>
7103
7104 <div>
7105 <h3 class="Head2">Adding a New Type</h3>
7106 <hr>
7107
7108 <p class="Body">
7109 If MPC does not support a particular build tool, you
7110 may want to consider adding a new project type. For instance, support
7111 could be added to MPC for Boost Jam, Xcode and many others. To do so
7112 will require knowledge of the MPC input files, as well as Object
7113 Oriented Perl.
7114 </p>
7115
7116
7117 <div>
7118 <h4 class="Head3">Input File Syntax</h4>
7119
7120 <p class="BodyNoLead">
7121 This section describes the syntax of the
7122 files that are used during project generation.
7123 </p>
7124
7125
7126 <div>
7127 <h5 class="Head4">
7128 <a name="MPD_Syntax"></a>Template Files
7129 (mpd)
7130 </h5>
7131
7132 <p class ="Body">
7133 Template files make up the bulk of what
7134 MPC puts into each generated project file. They provide the plain
7135 text and the layout of the data provided by the mpc files, using
7136 various template directives.
7137 </p>
7138
7139 <p class="Body">
7140 Template directives are declared using a
7141 <em class="Code">&lt;% %&gt;</em> construct. This construct is
7142 used to create if statements, for loops and to access variables.
7143 One thing to note is that any text, including white space, that
7144 is not enclosed within <em class="Code">&lt;% %&gt;</em> is left
7145 untouched and is passed directly into the generated project
7146 file.
7147 </p>
7148
7149 <p class="Body">
7150 An <em class="Code">if</em> statement can appear
7151 on a single line or it can span multiple lines. For example, the
7152 following line:
7153 </p>
7154
7155 <blockquote>
7156
7157 <p class="Code">
7158 &lt;%if(exename)%&gt;BIN =
7159 &lt;%exename%&gt;&lt;%else%&gt;LIB =
7160 &lt;%sharedname%&gt;&lt;%endif%&gt;
7161 </p>
7162
7163
7164 </blockquote>
7165
7166 <p class="Body">
7167 is equivalent to:</li>
7168
7169 <blockquote>
7170
7171 <p class="Code">&lt;%if(exename)%&gt;</p>
7172
7173 <p class="Code">BIN = &lt;%exename%&gt;</p>
7174
7175 <p class="Code">&lt;%else%&gt;</p>
7176
7177 <p class="Code">LIB = &lt;%sharedname%&gt;</p>
7178
7179 <p class="Code">&lt;%endif%&gt;</p>
7180
7181
7182 </blockquote>
7183
7184 <p class="Body">
7185 <a name="foreach_syntax"></a> A <em class=
7186 "Code">foreach</em> statement can also appear on a single line or
7187 can span multiple lines. As described below in the keywords
7188 section, the <em class="Code">foreach</em> statement evaluates
7189 the variable in a space-separated list context.
7190 </p>
7191
7192 <p class="Body">
7193 There are a couple of ways to write a <em class=
7194 "Code">foreach</em> loop. The first and preferred way is to name
7195 the loop variable and then list each variable to be
7196 evaluated.
7197 </p>
7198
7199 <blockquote>
7200
7201 <p class="Code">
7202 FILES=&lt;%foreach(fvar, idl_files source_files
7203 header_files)%&gt; &lt;%fvar%&gt;&lt;%endfor%&gt;
7204 </p>
7205
7206
7207 </blockquote>
7208
7209 <p class="Body">
7210 The second way is to let the <em class=
7211 "Code">foreach</em> statement determine the loop variable. With
7212 this style, each value can be accessed via the first variable
7213 name passed to the <em class="Code">foreach</em> with the
7214 trailing &rsquo;<em class="Code">s</em> &rsquo; removed.
7215 </p>
7216
7217 <blockquote>
7218
7219 <p class="Code">
7220 FILES=&lt;%foreach(idl_files source_files
7221 header_files)%&gt; &lt;%idl_file%&gt;&lt;%endfor%&gt;
7222 </p>
7223
7224
7225 </blockquote>
7226
7227 <p class="Body">
7228 Note that the <em class=
7229 "Code">&lt;%idl_file%&gt;</em> variable will contain each
7230 individual value of the <em class="Code">idl_files</em>,
7231 <em class="Code">source_files</em> and <em class=
7232 "Code">header_files</em> list. If the variable in the <em class=
7233 "Code">foreach</em> does not end in &rsquo;<em class=
7234 "Code">s</em> &rsquo;, the variable of the same name within the
7235 <em class="Code">foreach</em> will contain each individual value,
7236 e.g.,
7237 </p>
7238
7239 <blockquote>
7240
7241 <p class="Code">
7242 &lt;%foreach(filelist)%&gt;
7243 &lt;%filelist%&gt;&lt;%endfor%&gt;
7244 </p>
7245
7246
7247 </blockquote>
7248
7249 <p class="Body">
7250 The following table lists keywords that can
7251 appear in template files.
7252 </p>
7253
7254 <p class ="Body">
7255 <a name="38037"></a>
7256
7257 <h6 class="NumberedTableTitle">Template File Keywords</h6>
7258
7259 <table border="1" summary="Template File Keywords">
7260 <tr>
7261 <th rowspan="1" colspan="1">
7262 <p class="Tbl-Heading">Keyword</p>
7263 </th>
7264
7265 <th rowspan="1" colspan="1">
7266 <p class="Tbl-Heading">Description</p>
7267 </th>
7268 </tr>
7269
7270 <tr>
7271 <td rowspan="1" colspan="1">
7272 <p class="Tbl-Body">
7273 <em class=
7274 "TableCode">basename</em>
7275 </p>
7276 </td>
7277
7278 <td rowspan="1" colspan="1">
7279 <p class="Tbl-Body">
7280 Evaluates the variable name and
7281 removes the directory portion from that value.
7282 </p>
7283 </td>
7284 </tr>
7285
7286 <tr>
7287 <td rowspan="1" colspan="1">
7288 <p class="Tbl-Body">
7289 <em class=
7290 "TableCode">basenoextension</em>
7291 </p>
7292 </td>
7293
7294 <td rowspan="1" colspan="1">
7295 <p class="Tbl-Body">
7296 This is similar to <em class=
7297 "Code">basename</em> except that the extension is also
7298 removed from the variable name value.
7299 </p>
7300 </td>
7301 </tr>
7302
7303 <tr>
7304 <td rowspan="1" colspan="1">
7305 <p class="Tbl-Body">
7306 <em class=
7307 "TableCode">comment</em>
7308 </p>
7309 </td>
7310
7311 <td rowspan="1" colspan="1">
7312 <p class="Tbl-Body">
7313 The value passed to comment is
7314 ignored and can be any set of characters, except a new
7315 line or a closing parenthesis.
7316 </p>
7317 </td>
7318 </tr>
7319
7320 <tr>
7321 <td rowspan="1" colspan="1">
7322 <p class="Tbl-Body">
7323 <em class=
7324 "TableCode">compares</em>
7325 </p>
7326 </td>
7327
7328 <td rowspan="1" colspan="1">
7329 <p class="Tbl-Body">
7330 This function returns true if the
7331 variable value (first parameter) is equal to the string
7332 value (second parameter).
7333 </p>
7334 </td>
7335 </tr>
7336
7337 <tr>
7338 <td rowspan="1" colspan="1">
7339 <p class="Tbl-Body">
7340 <em class=
7341 "TableCode">contains</em>
7342 </p>
7343 </td>
7344
7345 <td rowspan="1" colspan="1">
7346 <p class="Tbl-Body">
7347 This function returns true if the
7348 variable value (first parameter) contains the regular
7349 expression (second parameter).
7350 </p>
7351 </td>
7352 </tr>
7353
7354 <tr>
7355 <td rowspan="1" colspan="1">
7356 <p class="Tbl-Body">
7357 <em class=
7358 "TableCode">deref</em>
7359 </p>
7360 </td>
7361
7362 <td rowspan="1" colspan="1">
7363 <p class="Tbl-Body">
7364 Dereference the variable passed as
7365 a parameter, treating its value as another variable
7366 name and returning that variable's value.
7367 </p>
7368 </td>
7369 </tr>
7370
7371 <tr>
7372 <td rowspan="1" colspan="1">
7373 <p class="Tbl-Body">
7374 <em class=
7375 "TableCode">dirname</em>
7376 </p>
7377 </td>
7378
7379 <td rowspan="1" colspan="1">
7380 <p class="Tbl-Body">
7381 Evaluates the variable name and
7382 removes the <em class="Code">basename</em> from that
7383 value.
7384 </p>
7385 </td>
7386 </tr>
7387
7388 <tr>
7389 <td rowspan="1" colspan="1">
7390 <p class="Tbl-Body">
7391 <em class=
7392 "TableCode">duplicate_index</em>
7393 </p>
7394 </td>
7395
7396 <td rowspan="1" colspan="1">
7397 <p class="Tbl-Body">
7398 This function returns a number based
7399 on the number of times a file with the same name (but
7400 different directory) is seen within a project. The
7401 function returns false upon the first occurrence of a
7402 file.
7403 </p>
7404 </td>
7405 </tr>
7406
7407 <tr>
7408 <td rowspan="1" colspan="1">
7409 <p class="Tbl-Body">
7410 <em class="TableCode">else</em>
7411 </p>
7412 </td>
7413
7414 <td rowspan="1" colspan="1">
7415 <p class="Tbl-Body">
7416 Used with the <em class=
7417 "Code">if</em> statement. An <em class="Code">else</em>
7418 block will be evaluated if the statement does not
7419 evaluate to true.
7420 </p>
7421 </td>
7422 </tr>
7423
7424 <tr>
7425 <td rowspan="1" colspan="1">
7426 <p class="Tbl-Body">
7427 <em class="TableCode">endfor</em>
7428 </p>
7429 </td>
7430
7431 <td rowspan="1" colspan="1">
7432 <p class="Tbl-Body">
7433 Used with <em class=
7434 "Code">foreach</em>. This ends <em class=
7435 "Code">foreach</em> block.
7436 </p>
7437 </td>
7438 </tr>
7439
7440 <tr>
7441 <td rowspan="1" colspan="1">
7442 <p class="Tbl-Body">
7443 <em class="TableCode">endif</em>
7444 </p>
7445 </td>
7446
7447 <td rowspan="1" colspan="1">
7448 <p class="Tbl-Body">
7449 Used with the <em class=
7450 "Code">if</em> statement. This ends an <em class=
7451 "Code">if</em> or <em class="Code">if/else</em>
7452 block.
7453 </p>
7454 </td>
7455 </tr>
7456
7457 <tr>
7458 <td rowspan="1" colspan="1">
7459 <p class="Tbl-Body">
7460 <em class=
7461 "TableCode">ends_with</em>
7462 </p>
7463 </td>
7464
7465 <td rowspan="1" colspan="1">
7466 <p class="Tbl-Body">
7467 This function returns true if the
7468 variable value (first parameter) ends with the regular
7469 expression (second parameter).
7470 </p>
7471 </td>
7472 </tr>
7473
7474 <tr>
7475 <td rowspan="1" colspan="1">
7476 <p class="Tbl-Body">
7477 <em class="TableCode">eval</em>
7478 </p>
7479 </td>
7480
7481 <td rowspan="1" colspan="1">
7482 <p class="Tbl-Body">
7483 This is similar to eval in perl. The
7484 template variable passed to this function will be
7485 evaluated within the context of the current template.
7486 </p>
7487 </td>
7488 </tr>
7489
7490 <tr>
7491 <td rowspan="1" colspan="1">
7492 <p class="Tbl-Body">
7493 <em class=
7494 "TableCode">extensions</em>
7495 </p>
7496 </td>
7497
7498 <td rowspan="1" colspan="1">
7499 <p class="Tbl-Body">
7500 Returns a list of extensions based on
7501 the component name parameter (e.g., source_files,
7502 header_files, etc.)
7503 </p>
7504 </td>
7505 </tr>
7506
7507 <tr>
7508 <td rowspan="1" colspan="1">
7509 <p class="Tbl-Body">
7510 <em class=
7511 "TableCode">flag_overrides</em>
7512 </p>
7513 </td>
7514
7515 <td rowspan="1" colspan="1">
7516 <p class="Tbl-Body">
7517 This is directly related to
7518 overriding the project-wide settings in an mpc file. It
7519 takes two variable names that are comma separated. The
7520 first corresponds to a file name and the second is any
7521 variable name.
7522 </p>
7523 </td>
7524 </tr>
7525
7526 <tr>
7527 <td rowspan="1" colspan="1">
7528 <p class="Tbl-Body">
7529 <em class=
7530 "TableCode">foreach</em>
7531 </p>
7532 </td>
7533
7534 <td rowspan="1" colspan="1">
7535 <p class="Tbl-Body">
7536 The given variable names are
7537 evaluated in a list context which is space separated.
7538 </p>
7539 </td>
7540 </tr>
7541
7542 <tr>
7543 <td rowspan="1" colspan="1">
7544 <p class="Tbl-Body">
7545 <em class=
7546 "TableCode">forfirst</em>
7547 </p>
7548 </td>
7549
7550 <td rowspan="1" colspan="1">
7551 <p class="Tbl-Body">
7552 Used with <em class=
7553 "Code">foreach</em>. The literal value passed to
7554 <em class="Code">forfirst</em> will be placed on the
7555 first iteration of <em class="Code">foreach</em>.
7556 </p>
7557 </td>
7558 </tr>
7559
7560 <tr>
7561 <td rowspan="1" colspan="1">
7562 <p class="Tbl-Body">
7563 <em class=
7564 "TableCode">forlast</em>
7565 </p>
7566 </td>
7567
7568 <td rowspan="1" colspan="1">
7569 <p class="Tbl-Body">
7570 Used with <em class=
7571 "Code">foreach</em>. The literal value passed to
7572 <em class="Code">forlast</em> will be placed on the last
7573 iteration of <em class="Code">foreach</em>.
7574 </p>
7575 </td>
7576 </tr>
7577
7578 <tr>
7579 <td rowspan="1" colspan="1">
7580 <p class="Tbl-Body">
7581 <em class=
7582 "TableCode">fornotfirst</em>
7583 </p>
7584 </td>
7585
7586 <td rowspan="1" colspan="1">
7587 <p class="Tbl-Body">
7588 Used with <em class=
7589 "Code">foreach</em>. The literal value passed to
7590 <em class="Code">fornotfirst</em> will be placed on each
7591 iteration of <em class="Code">foreach</em> except for the
7592 first.
7593 </p>
7594 </td>
7595 </tr>
7596
7597 <tr>
7598 <td rowspan="1" colspan="1">
7599 <p class="Tbl-Body">
7600 <em class=
7601 "TableCode">fornotlast</em>
7602 </p>
7603 </td>
7604
7605 <td rowspan="1" colspan="1">
7606 <p class="Tbl-Body">
7607 Used with <em class=
7608 "Code">foreach</em>. The literal value passed to
7609 <em class="Code">fornotlast</em> will be placed on each
7610 iteration of <em class="Code">foreach</em> except for the
7611 last.
7612 </p>
7613 </td>
7614 </tr>
7615
7616 <tr>
7617 <td rowspan="1" colspan="1">
7618 <p class="Tbl-Body">
7619 <em class=
7620 "TableCode">full_path</em>
7621 </p>
7622 </td>
7623
7624 <td rowspan="1" colspan="1">
7625 <p class="Tbl-Body">
7626 Returns full path of the value of the
7627 variable name passed a the parameter.
7628 </p>
7629 </td>
7630 </tr>
7631
7632 <tr>
7633 <td rowspan="1" colspan="1">
7634 <p class="Tbl-Body">
7635 <em class=
7636 "TableCode">has_extension</em>
7637 </p>
7638 </td>
7639
7640 <td rowspan="1" colspan="1">
7641 <p class="Tbl-Body">
7642 Returns true is the variable value
7643 has a file extension.
7644 </p>
7645 </td>
7646 </tr>
7647
7648 <tr>
7649 <td rowspan="1" colspan="1">
7650 <p class="Tbl-Body">
7651 <em class="TableCode">if</em>
7652 </p>
7653 </td>
7654
7655 <td rowspan="1" colspan="1">
7656 <p class="Tbl-Body">
7657 Used to determine if a variable is
7658 defined. The not operator (<em class="Code">!</em> ) can
7659 be used to invert the if check. This construct will only
7660 check for values defined within an mpc or mpt file.
7661 Default values (even those implemented by the project
7662 creators) are not considered in the <em class=
7663 "Code">if</em> statement.
7664 </p>
7665 </td>
7666 </tr>
7667
7668 <tr>
7669 <td rowspan="1" colspan="1">
7670 <p class="Tbl-Body">
7671 <em class=
7672 "TableCode">keyname_used</em>
7673 </p>
7674 </td>
7675
7676 <td rowspan="1" colspan="1">
7677 <p class="Tbl-Body">
7678 This function is used to associate a
7679 key with a variable value. If the key has been associated
7680 with a variable value more than once, either through
7681 physical repetition of the key in the template or through
7682 evaluation of a foreach context, the count of association
7683 will be appended to the output.
7684 </p>
7685 </td>
7686 </tr>
7687
7688 <tr>
7689 <td rowspan="1" colspan="1">
7690 <p class="Tbl-Body">
7691 <em class="TableCode">lc</em>
7692 </p>
7693 </td>
7694
7695 <td rowspan="1" colspan="1">
7696 <p class="Tbl-Body">
7697 Return the given variable value in
7698 all lower case characters.
7699 </p>
7700 </td>
7701 </tr>
7702
7703 <tr>
7704 <td rowspan="1" colspan="1">
7705 <p class="Tbl-Body">
7706 <em class="TableCode">marker</em>
7707 </p>
7708 </td>
7709
7710 <td rowspan="1" colspan="1">
7711 <p class="Tbl-Body">
7712 This is directly related to the
7713 <em class="Code">verbatim</em> keyword from the mpc
7714 syntax. This can be used to designate markers within a
7715 template. Ex. <em class=
7716 "Code">&lt;%marker(local)%&gt;</em>.
7717 </p>
7718 </td>
7719 </tr>
7720
7721 <tr>
7722 <td rowspan="1" colspan="1">
7723 <p class="Tbl-Body">
7724 <em class=
7725 "TableCode">multiple</em>
7726 </p>
7727 </td>
7728
7729 <td rowspan="1" colspan="1">
7730 <p class="Tbl-Body">
7731 This function returns true if the
7732 array parameter contains multiple values.
7733 </p>
7734 </td>
7735 </tr>
7736
7737 <tr>
7738 <td rowspan="1" colspan="1">
7739 <p class="Tbl-Body">
7740 <em class=
7741 "TableCode">noextension</em>
7742 </p>
7743 </td>
7744
7745 <td rowspan="1" colspan="1">
7746 <p class="Tbl-Body">
7747 Evaluates the variable name value as
7748 a file name and removes the extension from that value
7749 including the period.
7750 </p>
7751 </td>
7752 </tr>
7753
7754 <tr>
7755 <td rowspan="1" colspan="1">
7756 <p class="Tbl-Body">
7757 <em class=
7758 "TableCode">normalize</em>
7759 </p>
7760 </td>
7761
7762 <td rowspan="1" colspan="1">
7763 <p class="Tbl-Body">
7764 Convert spaces, dashes, slashes,
7765 dollar signs, parenthesis and dots in the given variable
7766 value to underscores.
7767 </p>
7768 </td>
7769 </tr>
7770
7771 <tr>
7772 <td rowspan="1" colspan="1">
7773 <p class="Tbl-Body">
7774 <em class=
7775 "TableCode">remove_from</em>
7776 </p>
7777 </td>
7778
7779 <td rowspan="1" colspan="1">
7780 <p class="Tbl-Body">
7781 This function will remove a file in a
7782 component list. It requires three parameters. The first
7783 parameter is a component name (e.g., Source_Files), the
7784 second parameter is a regular expression pattern and
7785 the third parameter is a project or template variable
7786 name. The fourth and optional parameter allows you to
7787 alter the project or template variable value by
7788 removing the end matching portion. If the value of
7789 the project or template variable (i.e., parameter
7790 three) after being modified by parameter four and
7791 having the regular expression pattern (i.e.,
7792 parameter two) appended to it matches any value
7793 within the component list (named by parameter one), it
7794 will be removed from that component list and passed
7795 back.
7796 any
7797 </p>
7798 </td>
7799 </tr>
7800
7801 <tr>
7802 <td rowspan="1" colspan="1">
7803 <p class="Tbl-Body">
7804 <em class=
7805 "TableCode">reverse</em>
7806 </p>
7807 </td>
7808
7809 <td rowspan="1" colspan="1">
7810 <p class="Tbl-Body">
7811 This function reverses the order of
7812 the array parameter values.
7813 </p>
7814 </td>
7815 </tr>
7816
7817 <tr>
7818 <td rowspan="1" colspan="1">
7819 <p class="Tbl-Body">
7820 <em class="TableCode">scope</em>
7821 </p>
7822 </td>
7823
7824 <td rowspan="1" colspan="1">
7825 <p class="Tbl-Body">
7826 This is used to set the scope of
7827 execution of a function that will operate on the template
7828 output. A scope is begun by passing "enter" as the first
7829 parameter and a function name as the second parameter.
7830 Currently, the only function name supported is "escape".
7831 The third parameter specifies a string on which the
7832 function will operate. Any template text that matches the
7833 string parameter while within this scope will be
7834 transformed by the function parameter. A scope is then
7835 ended by passing "leave".
7836 </p>
7837 </td>
7838 </tr>
7839
7840 <tr>
7841 <td rowspan="1" colspan="1">
7842 <p class="Tbl-Body">
7843 <em class="TableCode">set</em>
7844 </p>
7845 </td>
7846
7847 <td rowspan="1" colspan="1">
7848 <p class="Tbl-Body">
7849 This function is used to set or
7850 create a template variable. This function takes two
7851 parameters; the first is the template variable name
7852 and the second is the variable value.
7853 </p>
7854 </td>
7855 </tr>
7856
7857 <tr>
7858 <td rowspan="1" colspan="1">
7859 <p class="Tbl-Body">
7860 <em class="TableCode">sort</em>
7861 </p>
7862 </td>
7863
7864 <td rowspan="1" colspan="1">
7865 <p class="Tbl-Body">
7866 This function sorts the array
7867 parameter values.
7868 </p>
7869 </td>
7870 </tr>
7871
7872 <tr>
7873 <td rowspan="1" colspan="1">
7874 <p class="Tbl-Body">
7875 <em class=
7876 "TableCode">starts_with</em>
7877 </p>
7878 </td>
7879
7880 <td rowspan="1" colspan="1">
7881 <p class="Tbl-Body">
7882 This function returns true if the
7883 variable value (first parameter) starts with the regular
7884 expression (second parameter).
7885 </p>
7886 </td>
7887 </tr>
7888
7889 <tr>
7890 <td rowspan="1" colspan="1">
7891 <p class="Tbl-Body">
7892 <em class=
7893 "TableCode">transdir</em>
7894 </p>
7895 </td>
7896
7897 <td rowspan="1" colspan="1">
7898 <p class="Tbl-Body">
7899 Replaces values within the directory
7900 portion of a variable value with something that can be
7901 used as a relative path. The current working directory is
7902 removed and ".." is replaced with "dotdot".
7903 </p>
7904 </td>
7905 </tr>
7906
7907 <tr>
7908 <td rowspan="1" colspan="1">
7909 <p class="Tbl-Body">
7910 <em class="TableCode">translate_vars</em>
7911 </p>
7912 </td>
7913
7914 <td rowspan="1" colspan="1">
7915 <p class="Tbl-Body">
7916 The first parameter to this function
7917 is the name of a variable. The second, optional,
7918 parameter is the operating system for which the
7919 project is being generated (e.g., linux, solaris,
7920 win32, etc.) It replaces $(...) found within the
7921 value of the variable with the equivalent environment
7922 variable reference based on the operating system.
7923 </p>
7924 </td>
7925 </tr>
7926
7927 <tr>
7928 <td rowspan="1" colspan="1">
7929 <p class="Tbl-Body">
7930 <em class="TableCode">uc</em>
7931 </p>
7932 </td>
7933
7934 <td rowspan="1" colspan="1">
7935 <p class="Tbl-Body">
7936 Return the given variable value in
7937 all upper case characters.
7938 </p>
7939 </td>
7940 </tr>
7941
7942 <tr>
7943 <td rowspan="1" colspan="1">
7944 <p class="Tbl-Body">
7945 <em class="TableCode">ucw</em>
7946 </p>
7947 </td>
7948
7949 <td rowspan="1" colspan="1">
7950 <p class="Tbl-Body">
7951 Return the given variable value with
7952 the first letter of each word in upper case. Words are
7953 separated by spaces or underscores.
7954 </p>
7955 </td>
7956 </tr>
7957
7958 <tr>
7959 <td rowspan="1" colspan="1">
7960 <p class="Tbl-Body">
7961 <em class="TableCode">uniq</em>
7962 </p>
7963 </td>
7964
7965 <td rowspan="1" colspan="1">
7966 <p class="Tbl-Body">
7967 This function returns the unique set
7968 of the array parameter values.
7969 </p>
7970 </td>
7971 </tr>
7972 </table>
7973 </p>
7974
7975 <p class="Body">
7976 The following table lists special names that can
7977 be used as variables in some template files. The variables listed
7978 in the <a href=
7979 "MakeProjectCreator.html#Common_Pseudo_Variables" class=
7980 "XRef">Common_Pseudo_Variables</a> table can be used as well
7981 (except for <em class="Code">&lt;%temporary%&gt;</em>).
7982 </p>
7983
7984 <p style="list-style: none">
7985 <h6 class="NumberedTableTitle">
7986 Special Values used in Template
7987 Files
7988 </h6>
7989
7990 <table border="1" summary=
7991 "Special Values used in Template Files">
7992 <tr>
7993 <th rowspan="1" colspan="1">
7994 <p class="Tbl-Heading">Value</p>
7995 </th>
7996
7997 <th rowspan="1" colspan="1">
7998 <p class="Tbl-Heading">Description</p>
7999 </th>
8000 </tr>
8001
8002 <tr>
8003 <td rowspan="1" colspan="1">
8004 <p class="Tbl-Body">
8005 <em class=
8006 "TableCode">am_version</em>
8007 </p>
8008 </td>
8009
8010 <td rowspan="1" colspan="1">
8011 <p class="Tbl-Body">
8012 Implemented by the Automake project
8013 creator module, converts the <em class=
8014 "Code">version</em> setting into a suitable value for
8015 automake.
8016 </p>
8017 </td>
8018 </tr>
8019
8020 <tr>
8021 <td rowspan="1" colspan="1">
8022 <p class="Tbl-Body">
8023 <em class="TableCode">ciao</em>
8024 </p>
8025 </td>
8026
8027 <td rowspan="1" colspan="1">
8028 <p class="Tbl-Body">
8029 Implemented by the GNUACE project
8030 creator module, specifies that the project uses CIAO.
8031 </p>
8032 </td>
8033 </tr>
8034
8035 <tr>
8036 <td rowspan="1" colspan="1">
8037 <p class="Tbl-Body">
8038 <em class=
8039 "TableCode">compilers</em>
8040 </p>
8041 </td>
8042
8043 <td rowspan="1" colspan="1">
8044 <p class="Tbl-Body">
8045 Implemented by the Make project
8046 creator module, provides the compiler name based on the
8047 current project language.
8048 </p>
8049 </td>
8050 </tr>
8051
8052 <tr>
8053 <td rowspan="1" colspan="1">
8054 <p class="Tbl-Body">
8055 <em class="TableCode">cppdir</em>
8056 </p>
8057 </td>
8058
8059 <td rowspan="1" colspan="1">
8060 <p class="Tbl-Body">
8061 This value is implemented by the
8062 BMake project creator module. It returns a semicolon
8063 separated list of directories taken from each value in
8064 the <em class="Code">Source_Files</em> list.
8065 </p>
8066 </td>
8067 </tr>
8068
8069 <tr>
8070 <td rowspan="1" colspan="1">
8071 <p class="Tbl-Body">
8072 <em class=
8073 "TableCode">custom_types</em>
8074 </p>
8075 </td>
8076
8077 <td rowspan="1" colspan="1">
8078 <p class="Tbl-Body">
8079 Contains a list of the custom build
8080 types. See <a href=
8081 "MakeProjectCreator.html#Custom_Types" class=
8082 "XRef">Custom Types</a> for more details.
8083 </p>
8084 </td>
8085 </tr>
8086
8087 <tr>
8088 <td rowspan="1" colspan="1">
8089 <p class="Tbl-Body">
8090 <em class="TableCode">cwd</em>
8091 </p>
8092 </td>
8093
8094 <td rowspan="1" colspan="1">
8095 <p class="Tbl-Body">
8096 The full current working
8097 directory.
8098 </p>
8099 </td>
8100 </tr>
8101
8102 <tr>
8103 <td rowspan="1" colspan="1">
8104 <p class="Tbl-Body">
8105 <em class=
8106 "TableCode">forcount</em>
8107 </p>
8108 </td>
8109
8110 <td rowspan="1" colspan="1">
8111 <p class="Tbl-Body">
8112 This only has a value within the
8113 context of a <em class="Code">foreach</em> and provides a
8114 1 based count, by default, of the index of the elements
8115 in <em class="Code">foreach</em>.
8116 </p>
8117 </td>
8118 </tr>
8119
8120 <tr>
8121 <td rowspan="1" colspan="1">
8122 <p class="Tbl-Body">
8123 <em class="TableCode">guid</em>
8124 </p>
8125 </td>
8126
8127 <td rowspan="1" colspan="1">
8128 <p class="Tbl-Body">
8129 This value is implemented by the VC7
8130 and WIX project creator modules. It returns a <em class=
8131 "Code">guid</em> value based on the project that is
8132 usable within VC7, VC71, VC8, VC9, VC10, VC11, VC12, and WIX project
8133 files.
8134 </p>
8135 </td>
8136 </tr>
8137
8138 <tr>
8139 <td rowspan="1" colspan="1">
8140 <p class="Tbl-Body">
8141 <em class=
8142 "TableCode">language</em>
8143 </p>
8144 </td>
8145
8146 <td rowspan="1" colspan="1">
8147 <p class="Tbl-Body">
8148 This value is implemented by the VC7
8149 and Make project creator modules. It returns the current
8150 language setting for the project.
8151 </p>
8152 </td>
8153 </tr>
8154
8155 <tr>
8156 <td rowspan="1" colspan="1">
8157 <p class="Tbl-Body">
8158 <em class=
8159 "TableCode">make_file_name</em>
8160 </p>
8161 </td>
8162
8163 <td rowspan="1" colspan="1">
8164 <p class="Tbl-Body">
8165 This value is implemented by the VC6
8166 and EM3 project creator modules. It returns the project
8167 name with the make file extension that corresponds to the
8168 particular project type.
8169 </p>
8170 </td>
8171 </tr>
8172
8173 <tr>
8174 <td rowspan="1" colspan="1">
8175 <p class="Tbl-Body">
8176 <em class=
8177 "TableCode">project_file</em>
8178 </p>
8179 </td>
8180
8181 <td rowspan="1" colspan="1">
8182 <p class="Tbl-Body">
8183 This variable contains the name of
8184 the output file for the current project being
8185 generated.
8186 </p>
8187 </td>
8188 </tr>
8189
8190 <tr>
8191 <td rowspan="1" colspan="1">
8192 <p class="Tbl-Body">
8193 <em class=
8194 "TableCode">project_name</em>
8195 </p>
8196 </td>
8197
8198 <td rowspan="1" colspan="1">
8199 <p class="Tbl-Body">
8200 This variable contains the name of
8201 the current project being generated.
8202 </p>
8203 </td>
8204 </tr>
8205
8206 <tr>
8207 <td rowspan="1" colspan="1">
8208 <p class="Tbl-Body">
8209 <em class="TableCode">rcdir</em>
8210 </p>
8211 </td>
8212
8213 <td rowspan="1" colspan="1">
8214 <p class="Tbl-Body">
8215 This value is implemented by the
8216 BMake project creator module. It returns a semicolon
8217 separated list of directories taken from each value in
8218 the <em class="Code">Resource_Files</em> list.
8219 </p>
8220 </td>
8221 </tr>
8222
8223 <tr>
8224 <td rowspan="1" colspan="1">
8225 <p class="Tbl-Body">
8226 <em class=
8227 "TableCode">source_directory</em>
8228 </p>
8229 </td>
8230
8231 <td rowspan="1" colspan="1">
8232 <p class="Tbl-Body">
8233 This value is implemented by the WIX
8234 project creator module. It converts the variable portion
8235 of the binary output directory (either <em class=
8236 "Code">exeout</em>, <em class="Code">dllout</em>, or
8237 <em class="Code">libout</em>) to a suitable value for
8238 WIX.
8239 </p>
8240 </td>
8241 </tr>
8242
8243 <tr>
8244 <td rowspan="1" colspan="1">
8245 <p class="Tbl-Body">
8246 <em class="TableCode">tao</em>
8247 </p>
8248 </td>
8249
8250 <td rowspan="1" colspan="1">
8251 <p class="Tbl-Body">
8252 Implemented by the GNUACE project
8253 creator module, specifies that the project uses TAO.
8254 </p>
8255 </td>
8256 </tr>
8257
8258 <tr>
8259 <td rowspan="1" colspan="1">
8260 <p class="Tbl-Body">
8261 <em class=
8262 "TableCode">vcversion</em>
8263 </p>
8264 </td>
8265
8266 <td rowspan="1" colspan="1">
8267 <p class="Tbl-Body">
8268 This value is implemented by the
8269 VC7ProjectCreator. It returns the version number of the
8270 type of project being generated. 7.00 is return for vc7,
8271 7.10 is return for vc71 and 8.00 is returned for vc8,
8272 9.00 is returned for vc9, 10.00 is returned for vc10,
8273 11.00 is returned for vc11, 12.0 is returned for vc12,
8274 14.0 is returned for vc14, 14.1 is returned for vs2017, 14.2 is returned for vs2019, 14.3 is returned for vs2022.
8275 </p>
8276 </td>
8277 </tr>
8278
8279 <tr>
8280 <td rowspan="1" colspan="1">
8281 <p class="Tbl-Body">
8282 <em class="TableCode">vpath</em>
8283 </p>
8284 </td>
8285
8286 <td rowspan="1" colspan="1">
8287 <p class="Tbl-Body">
8288 This value is implemented by the
8289 GNUACEProjectCreator. It returns a value, based on the
8290 location of the source files, that specifies the
8291 <em class="Code">VPATH</em> setting for GNU Make.
8292 </p>
8293 </td>
8294 </tr>
8295 </table>
8296 </p>
8297
8298
8299
8300 <p class="Body">
8301 <h6 class="Head5">
8302 <a name="Document_Template_Script"></a>
8303 Template Variable Documentation
8304 </h6>
8305 </p>
8306
8307 <p class="Body">
8308 Template variables used within the MPC templates
8309 are numerous and vary from template to template; there are far
8310 too many to include in this document. However, you can generate
8311 an HTML document containing all of the template variables used
8312 within a template using the <em class=
8313 "Code">document_template.pl</em> script found in the <em class=
8314 "Code">devtools</em> directory under the MPC root directory. You
8315 may find that some templates and individual template variables
8316 are well documented and, unfortunately, some are not.
8317 </p>
8318
8319 <p class="Body">
8320 The script will generate documentation for an
8321 individual template file. The usage is as follows:
8322 </p>
8323
8324 <blockquote>
8325
8326 <p class="Code">document_template.pl v1.4</p>
8327
8328 <p class="Code">
8329 Usage: document_template.pl &lt;template&gt;
8330 [&lt;outputfile&gt; [language]]
8331 </p>
8332
8333 <p class="Code">&nbsp;</p>
8334
8335 <p class="Code">
8336 template &nbsp;&nbsp;&nbsp;- .mpd file to document. Certain MPC types don't
8337 use a template,
8338 </p>
8339
8340 <p class="Code">
8341 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
8342 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in that case this argument can be the Perl module.
8343 </p>
8344
8345 <p class="Code">
8346 outputfile &nbsp;- This defaults to the name of the
8347 template file with the .mpd
8348 </p>
8349
8350 <p class="Code">
8351 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
8352 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;extension replaced with
8353 '.html' If &lt;outputfile&gt; ends in '.txt',
8354 </p>
8355
8356 <p class="Code">
8357 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
8358 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the output is in text
8359 format similar to what is found in
8360 </p>
8361
8362 <p class="Code">
8363 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
8364 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.../docs/templates.
8365 </p>
8366
8367 <p class="Code">
8368 language &nbsp;&nbsp;&nbsp;- This defaults to
8369 the language for which the template is designed.
8370 </p>
8371
8372 <p class="Code">
8373 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
8374 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It can be any of the valid
8375 language settings for MPC:
8376 </p>
8377
8378 <p class="Code">
8379 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
8380 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cplusplus csharp java
8381 vb
8382 </p>
8383 </blockquote>
8384
8385
8386 <div>
8387 <a name="Custom_Types"></a>
8388
8389 <h6 class="Head5">Custom Types</h6>
8390
8391 <p class="BodyNoLead">
8392 To support multiple custom build types,
8393 a special keyword was introduced. The <em class=
8394 "Code">custom_types</em> keyword is used to access the list of
8395 custom types defined by the user. In a <em class=
8396 "Code">foreach</em> context, each custom type can be accessed
8397 through the <em class="Code">custom_type</em> keyword.
8398 </p>
8399
8400 <p class="Body">
8401 A variety of information is available from
8402 each <em class="Code">custom_type</em> through the <em class=
8403 "Code">-&gt;</em> operator. The input files, input extensions,
8404 command, command output option, command flags, and output file
8405 directory are all accessible through the field names that
8406 correspond to the particular type.
8407 </p>
8408
8409 <p class="Body">
8410 The input files associated with the custom
8411 type are accessed through <em class=
8412 "Code">custom_type-&gt;input_files</em>. Each input file has a
8413 set of output files associated with it which can be accessed in
8414 a <em class="Code">foreach</em> context through c<em class=
8415 "Code">ustom_type-&gt;input_file-&gt;output_files</em>. The
8416 custom type fields are those listed in the <a href=
8417 "MakeProjectCreator.html#32899" class="XRef">
8418 Define_Custom
8419 Keywords
8420 </a> table as well as those listed in the following
8421 table.
8422 </p>
8423
8424 <p style="list-style: none">
8425 <h6 class="NumberedTableTitle">Custom Type Fields</h6>
8426
8427 <table border="1" summary="Custom Type Fields">
8428 <tr>
8429 <th rowspan="1" colspan="1">
8430 <p class="Tbl-Heading">Value</p>
8431 </th>
8432
8433 <th rowspan="1" colspan="1">
8434 <p class="Tbl-Heading">Description</p>
8435 </th>
8436 </tr>
8437
8438 <tr>
8439 <td rowspan="1" colspan="1">
8440 <p class="Tbl-Body">
8441 <em class=
8442 "TableCode">dependencies</em>
8443 </p>
8444 </td>
8445
8446 <td rowspan="1" colspan="1">
8447 <p class="Tbl-Body">
8448 The files on which the processing
8449 of the custom input file depends.
8450 </p>
8451 </td>
8452 </tr>
8453
8454 <tr>
8455 <td rowspan="1" colspan="1">
8456 <p class="Tbl-Body">
8457 <em class=
8458 "TableCode">gendir</em>
8459 </p>
8460 </td>
8461
8462 <td rowspan="1" colspan="1">
8463 <p class="Tbl-Body">
8464 The output directory associated
8465 with a particular input file. This field has no meaning
8466 when accessed directly through the <em class=
8467 "Code">custom_type</em>. It should always be used
8468 within the context of a <em class=
8469 "Code">flag_overrides</em> (see <a href=
8470 "MakeProjectCreator.html#38037" class="XRef">
8471 Template
8472 File Keywords
8473 </a>).
8474 </p>
8475 </td>
8476 </tr>
8477
8478 <tr>
8479 <td rowspan="1" colspan="1">
8480 <p class="Tbl-Body">
8481 <em class=
8482 "TableCode">input_files</em>
8483 </p>
8484 </td>
8485
8486 <td rowspan="1" colspan="1">
8487 <p class="Tbl-Body">
8488 The input files associated with the
8489 custom type.
8490 </p>
8491 </td>
8492 </tr>
8493
8494 <tr>
8495 <td rowspan="1" colspan="1">
8496 <p class="Tbl-Body">
8497 <em class=
8498 "TableCode">inputexts</em>
8499 </p>
8500 </td>
8501
8502 <td rowspan="1" colspan="1">
8503 <p class="Tbl-Body">
8504 The input file extensions
8505 associated with the custom type.
8506 </p>
8507 </td>
8508 </tr>
8509
8510 <tr>
8511 <td rowspan="1" colspan="1">
8512 <p class="Tbl-Body">
8513 <em class=
8514 "TableCode">non_source_output_files</em>
8515 </p>
8516 </td>
8517
8518 <td rowspan="1" colspan="1">
8519 <p class="Tbl-Body">
8520 All output files generated from the
8521 custom input file that are not considered source code
8522 files by MPC.
8523 </p>
8524 </td>
8525 </tr>
8526
8527 <tr>
8528 <td rowspan="1" colspan="1">
8529 <p class="Tbl-Body">
8530 <em class=
8531 "TableCode">output_files</em>
8532 </p>
8533 </td>
8534
8535 <td rowspan="1" colspan="1">
8536 <p class="Tbl-Body">
8537 All output files generated from the
8538 custom input file.
8539 </p>
8540 </td>
8541 </tr>
8542
8543 <tr>
8544 <td rowspan="1" colspan="1">
8545 <p class="Tbl-Body">
8546 <em class=
8547 "TableCode">source_output_files</em>
8548 </p>
8549 </td>
8550
8551 <td rowspan="1" colspan="1">
8552 <p class="Tbl-Body">
8553 All output files generated from the
8554 custom input file that are considered source code files
8555 by MPC.
8556 </p>
8557 </td>
8558 </tr>
8559 </table>
8560 </p>
8561
8562 <p class="Body">
8563 The example below, which creates generic
8564 makefile rules for building custom input files, shows basic use
8565 of the custom type and the various fields that can be accessed.
8566 The main limitation with the <em class="Code">custom_types</em>
8567 keyword, as can be seen below, is that the <em class=
8568 "Code">foreach</em> variable cannot be named as stated <a href=
8569 "MakeProjectCreator.html#foreach_syntax" class=
8570 "XRef">previously</a>.
8571 </lpi>
8572
8573 <blockquote>
8574
8575 <p class="Code">&lt;%if(custom_types)%&gt;</p>
8576
8577 <p class="Code">&lt;%foreach(custom_types)%&gt;</p>
8578
8579 <p class="Code">
8580 &lt;%foreach(custom_type-&gt;input_files)%&gt;
8581 </p>
8582
8583 <p class="Code">
8584 &lt;%foreach(custom_type-&gt;input_file-&gt;output_files)%&gt;
8585 </p>
8586
8587 <p class="Code">
8588 &lt;%custom_type-&gt;input_file-&gt;output_file%&gt;:
8589 &lt;%custom_type-&gt;input_file%&gt;
8590 </p>
8591
8592 <p class="Code">
8593 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;%custom_type-&gt;command%&gt;
8594 &lt;%custom_type-&gt;commandflags%&gt; $@
8595 </p>
8596
8597 <p class="Code">&nbsp;</p>
8598
8599 <p class="Code">&lt;%endfor%&gt;</p>
8600
8601 <p class="Code">&lt;%endfor%&gt;</p>
8602
8603 <p class="Code">&lt;%endfor%&gt;</p>
8604
8605 <p class="Code">&lt;%endif%&gt;</p>
8606
8607
8608 </blockquote>
8609
8610 <p class="Body">
8611 Certain project types don't support the same
8612 input file used by multiple custom types (current examples of
8613 this are vc10, vc11, vc12, vc14, vs*, cdt6, and cdt7). To accommodate these types, MPC
8614 has a capability called "combined custom". With this capability
8615 enabled in the specific ProjectCreator, MPC will "fold together"
8616 the multiple custom steps so that the target tool (Visual Studio
8617 or Eclipse CDT) sees it as a single custom step that happens to
8618 run two or more commands. When "combined custom" is enabled,
8619 the template needs to be written for it by checking if
8620 <em class="Code">custom_type-&gt;input_file-&gt;commands</em> is
8621 non-empty. If it isn't empty, the values in it can be iterated
8622 over with a <em class="Code">&lt;%foreach%&gt;</em>. During that
8623 iteration, the following values can be obtained by the template.
8624 Each one would appear in the template preceded by
8625 <em class="Code">custom_type-&gt;input_file-&gt;</em>
8626 </p>
8627
8628 <p style="list-style: none">
8629 <h6 class="NumberedTableTitle">
8630 Custom Type Fields for Combined
8631 Custom
8632 </h6>
8633 <table border="1"
8634 summary="Custom Type Fields for Combined Custom">
8635 <tr>
8636 <th rowspan="1" colspan="1">
8637 <p class="Tbl-Heading">Value</p>
8638 </th>
8639
8640 <th rowspan="1" colspan="1">
8641 <p class="Tbl-Heading">Description</p>
8642 </th>
8643 </tr>
8644
8645 <tr>
8646 <td rowspan="1" colspan="1">
8647 <p class="Tbl-Body">
8648 <em class=
8649 "TableCode">command</em>
8650 </p>
8651 </td>
8652
8653 <td rowspan="1" colspan="1">
8654 <p class="Tbl-Body">
8655 The effective command, taking into
8656 account the <em class="TableCode">flag_overrides</em>.
8657 </p>
8658 </td>
8659 </tr>
8660
8661 <tr>
8662 <td rowspan="1" colspan="1">
8663 <p class="Tbl-Body">
8664 <em class=
8665 "TableCode">command-&gt;outopt</em>
8666 </p>
8667 </td>
8668
8669 <td rowspan="1" colspan="1">
8670 <p class="Tbl-Body">
8671 The <em class=
8672 "TableCode">output_option</em> for this particular
8673 command, taking into account the
8674 <em class="TableCode">flag_overrides</em>.
8675 </p>
8676 </td>
8677 </tr>
8678
8679 <tr>
8680 <td rowspan="1" colspan="1">
8681 <p class="Tbl-Body">
8682 <em class=
8683 "TableCode">command-&gt;outfile</em>
8684 </p>
8685 </td>
8686
8687 <td rowspan="1" colspan="1">
8688 <p class="Tbl-Body">
8689 The first output file for this
8690 particular command (for use with
8691 <em class="TableCode">outopt</em>).
8692 </p>
8693 </td>
8694 </tr>
8695
8696 <tr>
8697 <td rowspan="1" colspan="1">
8698 <p class="Tbl-Body">
8699 <em class=
8700 "TableCode">command-&gt;flags</em>
8701 </p>
8702 </td>
8703
8704 <td rowspan="1" colspan="1">
8705 <p class="Tbl-Body">
8706 The <em class=
8707 "TableCode">commandflags</em> for this particular
8708 command, taking into account the
8709 <em class="TableCode">flag_overrides</em>.
8710 </p>
8711 </td>
8712 </tr>
8713
8714 <tr>
8715 <td rowspan="1" colspan="1">
8716 <p class="Tbl-Body">
8717 <em class=
8718 "TableCode">command-&gt;gdir</em>
8719 </p>
8720 </td>
8721
8722 <td rowspan="1" colspan="1">
8723 <p class="Tbl-Body">
8724 The <em class=
8725 "TableCode">gendir</em> for this particular
8726 command.
8727 </p>
8728 </td>
8729 </tr>
8730
8731 <tr>
8732 <td rowspan="1" colspan="1">
8733 <p class="Tbl-Body">
8734 <em class=
8735 "TableCode">command-&gt;type</em>
8736 </p>
8737 </td>
8738
8739 <td rowspan="1" colspan="1">
8740 <p class="Tbl-Body">
8741 The original type of file for this command.
8742 </p>
8743 </td>
8744 </tr>
8745
8746 </table>
8747 </p>
8748
8749
8750 </div>
8751
8752 <div>
8753 <h6 class="Head5">Grouped Files</h6>
8754
8755 <p class="Body">
8756 File grouping is part of the syntax of
8757 mpc files. If a set of files are grouped within the mpc file,
8758 they can be accessed as a group within the mpd file.
8759 </p>
8760
8761 <p class="Body">
8762 Files (such as <em class=
8763 "Code">Source_Files</em>, <em class="Code">Header_Files</em> )
8764 can be grouped together as shown <a href=
8765 "MakeProjectCreator.html#MPC%20grouping%20example" class=
8766 "XRef">here</a>. Within the mpd file, the different components
8767 can be accessed by prepending <em class="Code">grouped_</em> to
8768 the component (<em class="Code">grouped_source_files</em>,
8769 <em class="Code">grouped_header_files</em>, etc.)
8770 </p>
8771
8772 <p class="Body">
8773 <h6 class="NumberedTableTitle">Grouped Files Field Names</h6>
8774
8775 <table border="1" summary="Grouped Files Field Names">
8776 <tr>
8777 <th rowspan="1" colspan="1">
8778 <p class="Tbl-Heading">Field Name</p>
8779 </th>
8780
8781 <th rowspan="1" colspan="1">
8782 <p class="Tbl-Heading">Description</p>
8783 </th>
8784 </tr>
8785
8786 <tr>
8787 <td rowspan="1" colspan="1">
8788 <p class="Tbl-Body">
8789 <em class=
8790 "TableCode">files</em>
8791 </p>
8792 </td>
8793
8794 <td rowspan="1" colspan="1">
8795 <p class="Tbl-Body">
8796 The input files associated with the
8797 group.
8798 </p>
8799 </td>
8800 </tr>
8801
8802 <tr>
8803 <td rowspan="1" colspan="1">
8804 <p class="Tbl-Body">
8805 <em class=
8806 "TableCode">component_name</em>
8807 </p>
8808 </td>
8809
8810 <td rowspan="1" colspan="1">
8811 <p class="Tbl-Body">
8812 The name of the set of multiple
8813 groups of files.
8814 </p>
8815 </td>
8816 </tr>
8817 </table>
8818 </p>
8819
8820 <p class="Body">
8821 The example below, which creates make macros
8822 for each file group, shows basic use of grouping and the fields
8823 that can be accessed. The main limitation with file grouping,
8824 as can be seen below, is that the <em class="Code">foreach</em>
8825 variable cannot be named as stated <a href=
8826 "MakeProjectCreator.html#foreach_syntax" class=
8827 "XRef">previously</a>. The following example involves source
8828 files, but any of the <a href="MakeProjectCreator.html#16907"
8829 class="XRef">components</a> listed in the mpc and mpb section
8830 can be used.
8831 </li>
8832
8833 <blockquote>
8834
8835 <p class="Code">&lt;%if(grouped_source_files)%&gt;</p>
8836
8837 <p class="Code">
8838 &lt;%comment(Get back each set of grouped
8839 files)%&gt;
8840 </p>
8841
8842 <p class="Code">&lt;%foreach(grouped_source_files)%&gt;</p>
8843
8844 <p class="Code">
8845 &lt;%comment(This will provide the name of
8846 the group)%&gt;
8847 </p>
8848
8849 <p class="Code">&lt;%grouped_source_file%&gt; = \</p>
8850
8851 <p class="Code">
8852 &lt;%comment(Get all the source files in a
8853 single group)%&gt;
8854 </p>
8855
8856 <p class="Code">
8857 &lt;%foreach(grouped_source_file-&gt;files)%&gt;
8858 </p>
8859
8860 <p class="Code">
8861 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;%grouped_source_file-&gt;file)%&gt;&lt;%fornotlast("
8862 \\")%&gt;
8863 </p>
8864
8865 <p class="Code">&lt;%endfor%&gt;</p>
8866
8867 <p class="Code">&lt;%endfor%&gt;</p>
8868
8869 <p class="Code">&nbsp;</p>
8870
8871 <p class="Code">
8872 ifndef
8873 &lt;%grouped_source_files-&gt;component_name%&gt;
8874 </p>
8875
8876 <p class="Code">
8877 &lt;%grouped_source_files-&gt;component_name%&gt; = \
8878 </p>
8879
8880 <p class="Code">&lt;%foreach(grouped_source_files)%&gt;</p>
8881
8882 <p class="Code">
8883 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;%grouped_source_file%&gt;&lt;%fornotlast("
8884 \\")%&gt;
8885 </p>
8886
8887 <p class="Code">&lt;%endfor%&gt;</p>
8888
8889 <p class="Code">endif</p>
8890
8891 <p class="Code">&lt;%endif%&gt;</p>
8892
8893 <p class="Code">&nbsp;</p>
8894 </blockquote>
8895
8896 </div>
8897 </div>
8898
8899 <div>
8900 <h5 class="Head4">Template Input Files (mpt)</h5>
8901
8902 <p class="BodyNoLead">
8903 Template input files provide build tool
8904 specific information that is common to all projects, such as
8905 compiler switches, intermediate directories, compiler macros,
8906 etc. Each project type can provide template input files for
8907 dynamic libraries, static libraries, dynamic executables and
8908 static executables. However, none of these are actually required
8909 by MPC.
8910 </p>
8911
8912 <p class="Body">
8913 The template input files are more free-form than
8914 the other MPC file types. It is similar to the mpc syntax except
8915 that there is no project definition and there is only one
8916 keyword. The keyword, <em class="Code">conditional_include</em>,
8917 is used to include other mpt files if they can be found in the
8918 MPC include search path. If the name listed in double quotes
8919 after <em class="Code">conditional_include</em> is not found, it
8920 is ignored and no warning is produced. The <em class=
8921 "Code">mpt</em> extension is automatically added to the name
8922 provided.
8923 </p>
8924
8925 <p class="Body">
8926 The template input files contain variable
8927 assignments and collections of variable assignments. A variable
8928 assignment is of the form:
8929 </p>
8930
8931 <blockquote>
8932
8933 <p class="Code">variable_name = value1 "value 2"</p>
8934
8935 <p class="Code">variable_name += another_value</p>
8936
8937 <p class="Code">&nbsp;</p>
8938 </blockquote>
8939
8940 <p class="Body">
8941 This variable can then be used within the
8942 corresponding mpd file.
8943 </p>
8944
8945 <p class="Body">
8946 Variable assignments can be grouped together and
8947 named within the mpt file and used as scoped variables within the
8948 mpd file. The following example shows the use of collections of
8949 variable assignments.
8950 </p>
8951
8952 <blockquote>
8953
8954 <p class="Code">// mpt file</p>
8955
8956 <p class="Code">configurations = Release Debug</p>
8957
8958 <p class="Code">common_defines = WIN32 _CONSOLE</p>
8959
8960 <p class="Code">&nbsp;</p>
8961
8962 <p class="Code">Release {</p>
8963
8964 <p class="Code">
8965 &nbsp;&nbsp;compile_flags = /W3 /GX /O2 /MD
8966 /GR
8967 </p>
8968
8969 <p class="Code">&nbsp;&nbsp;defines = NDEBUG</p>
8970
8971 <p class="Code">}</p>
8972
8973 <p class="Code">&nbsp;</p>
8974
8975 <p class="Code">Debug {</p>
8976
8977 <p class="Code">
8978 &nbsp;&nbsp;compile_flags = /W3 /Gm /GX /Zi /Od
8979 /MDd /GR /Gy
8980 </p>
8981
8982 <p class="Code">&nbsp;&nbsp;defines = _DEBUG</p>
8983
8984 <p class="Code">}</p>
8985
8986 <p class="Code">&nbsp;</p>
8987
8988 <p class="Code">conditional_include "vcfullmacros"</p>
8989
8990 <p class="Code">&nbsp;</p>
8991 </blockquote>
8992
8993 <p class="Body">
8994 Below is the portion of the mpd file that would
8995 use the information provided in the mpt file above.
8996 </p>
8997
8998 <blockquote>
8999
9000 <p class="Code">&lt;%foreach(configurations)%&gt;</p>
9001
9002 <p class="Code">Name = &lt;%configuration%&gt;</p>
9003
9004 <p class="Code">
9005 &lt;%compile_flags%&gt;&lt;%foreach(defines
9006 common_defines)%&gt; /D &lt;%define%&gt;=1&lt;%endfor%&gt;
9007 </p>
9008
9009 <p class="Code">&nbsp;</p>
9010
9011 <p class="Code">&lt;%endfor%&gt;</p>
9012
9013
9014 </blockquote>
9015
9016 <p class="Body">
9017 The following output is generated from the above
9018 example:
9019 </p>
9020
9021 <blockquote>
9022
9023 <p class="Code">Name = Release</p>
9024
9025 <p class="Code">
9026 /W3 /GX /O2 /MD /GR /D NDEBUG=1 /D WIN32=1 /D
9027 _CONSOLE=1
9028 </p>
9029
9030 <p class="Code">&nbsp;</p>
9031
9032 <p class="Code">Name = Debug</p>
9033
9034 <p class="Code">
9035 /W3 /Gm /GX /Zi /Od /MDd /GR /Gy /D _DEBUG=1 /D
9036 WIN32=1 /D _CONSOLE=1
9037 </p>
9038
9039
9040 </blockquote>
9041
9042 <p class="Body">
9043 If a <em class="Code">foreach</em> variable
9044 value corresponds to a variable group name, that variable group
9045 is available within the scope of that <em class=
9046 "Code">foreach</em>.
9047 </p>
9048
9049 <p class="Body">
9050 &nbsp;</li>
9051
9052 </div>
9053 </div>
9054
9055 <div>
9056 <h4 class="Head3">A Simple Example</h4>
9057
9058 <p class="BodyNoLead">
9059 We will discuss what it would take to add
9060 support for a fictional build tool throughout this section. The
9061 <a href="MakeProjectCreator.html#Figure_1-2" class=
9062 "XRef">Generating projects with mpc.pl diagram</a> shows the
9063 relationship between the template and project creator discussed
9064 below.
9065 </p>
9066
9067
9068 <div>
9069 <h5 class="Head4">Template</h5>
9070
9071 <p class="BodyNoLead">
9072 The best thing to do is to start with the
9073 template. The template is the most important piece when adding a
9074 new project type. It basically tells MPC how to lay out all of
9075 the information it gathers while processing an mpc file. The
9076 template file will have a mixture of plain text and the mpd
9077 syntax described in the <a href=
9078 "MakeProjectCreator.html#MPD_Syntax" class="XRef">
9079 Template
9080 Files
9081 </a> section. Here is our sample <em class=
9082 "Code">fictional.mpd</em>.
9083 </p>
9084
9085 <blockquote>
9086 <p class="Code">
9087 //=======================================================================
9088 </p>
9089
9090 <p class="Code">// This project has been generated by MPC.</p>
9091
9092 <p class="Code">
9093 // CAUTION! Hand edit only if you know what you
9094 are doing!
9095 </p>
9096
9097 <p class="Code">
9098 //=======================================================================
9099 </p>
9100
9101 <p class="Code">&nbsp;</p>
9102
9103 <p class="Code">// Section 1 - PROJECT OPTIONS</p>
9104
9105 <p class="Code">ctags:*</p>
9106
9107 <p class="Code">debugSwitches:-nw</p>
9108
9109 <p class="Code">//end-proj-opts</p>
9110
9111 <p class="Code">&nbsp;</p>
9112
9113 <p class="Code">// Section 2 - MAKEFILE</p>
9114
9115 <p class="Code">Makefile.&lt;%project_name%&gt;</p>
9116
9117 <p class="Code">&nbsp;</p>
9118
9119 <p class="Code">// Section 3 - OPTIONS</p>
9120
9121 <p class="Code">//end-options</p>
9122
9123 <p class="Code">&nbsp;</p>
9124
9125 <p class="Code">// Section 4 - TARGET FILE</p>
9126
9127 <p class="Code">&lt;%if(exename)%&gt;</p>
9128
9129 <p class="Code">&lt;%exename%&gt;</p>
9130
9131 <p class="Code">&lt;%else%&gt;</p>
9132
9133 <p class="Code">&lt;%if(sharedname)%&gt;</p>
9134
9135 <p class="Code">&lt;%sharedname%&gt;</p>
9136
9137 <p class="Code">&lt;%else%&gt;</p>
9138
9139 <p class="Code">&lt;%if(staticname)%&gt;</p>
9140
9141 <p class="Code">&lt;%staticname%&gt;</p>
9142
9143 <p class="Code">&lt;%endif%&gt;</p>
9144
9145 <p class="Code">&lt;%endif%&gt;</p>
9146
9147 <p class="Code">&lt;%endif%&gt;</p>
9148
9149 <p class="Code">&nbsp;</p>
9150
9151 <p class="Code">// Section 5 - SOURCE FILES</p>
9152
9153 <p class="Code">&lt;%foreach(source_files)%&gt;</p>
9154
9155 <p class="Code">&lt;%source_file%&gt;</p>
9156
9157 <p class="Code">&lt;%endfor%&gt;</p>
9158
9159 <p class="Code">//end-srcfiles</p>
9160
9161 <p class="Code">&nbsp;</p>
9162
9163 <p class="Code">// Section 6 - INCLUDE DIRECTORIES</p>
9164
9165 <p class="Code">&lt;%foreach(includes)%&gt;</p>
9166
9167 <p class="Code">&lt;%include%&gt;</p>
9168
9169 <p class="Code">&lt;%endfor%&gt;</p>
9170
9171 <p class="Code">//end-include-dirs</p>
9172
9173 <p class="Code">&nbsp;</p>
9174
9175 <p class="Code">// Section 7 - LIBRARY DIRECTORIES</p>
9176
9177 <p class="Code">&lt;%foreach(libpaths)%&gt;</p>
9178
9179 <p class="Code">&lt;%libpath%&gt;</p>
9180
9181 <p class="Code">&lt;%endfor%&gt;</p>
9182
9183 <p class="Code">//end-library-dirs</p>
9184
9185 <p class="Code">&nbsp;</p>
9186
9187 <p class="Code">// Section 8 - DEFINITIONS</p>
9188
9189 <p class="Code">&lt;%foreach(macros defines)%&gt;</p>
9190
9191 <p class="Code">-D&lt;%macro%&gt;</p>
9192
9193 <p class="Code">&lt;%endfor%&gt;</p>
9194
9195 <p class="Code">&lt;%if(pch_header)%&gt;</p>
9196
9197 <p class="Code">&lt;%foreach(pch_defines)%&gt;</p>
9198
9199 <p class="Code">-D&lt;%pch_define%&gt;</p>
9200
9201 <p class="Code">&lt;%endfor%&gt;</p>
9202
9203 <p class="Code">&lt;%endif%&gt;</p>
9204
9205 <p class="Code">//end-defs</p>
9206
9207 <p class="Code">&nbsp;</p>
9208
9209 <p class="Code">// Section 9 - C FLAGS</p>
9210
9211 <p class="Code">&lt;%cflags("-g")%&gt;</p>
9212
9213 <p class="Code">&nbsp;</p>
9214
9215 <p class="Code">// Section 10 - LIBRARY FLAGS</p>
9216
9217 <p class="Code">&lt;%libflags%&gt;</p>
9218
9219 <p class="Code">&nbsp;</p>
9220
9221 <p class="Code">// Section 11 - SRC DIRECTORY</p>
9222
9223 <p class="Code">.</p>
9224
9225 <p class="Code">&nbsp;</p>
9226
9227 <p class="Code">// Section 12 - OBJ DIRECTORY</p>
9228
9229 <p class="Code">&lt;%objdir(".")%&gt;</p>
9230
9231 <p class="Code">&nbsp;</p>
9232
9233 <p class="Code">// Section 13 - BIN DIRECTORY</p>
9234
9235 <p class="Code">
9236 &lt;%if(exeout)%&gt;&lt;%exeout%&gt;&lt;%else%&gt;.&lt;%endif%&gt;
9237 </p>
9238
9239 <p class="Code">&nbsp;</p>
9240
9241 <p class="Code">
9242 // User targets section. Following lines will
9243 be
9244 </p>
9245
9246 <p class="Code">
9247 // inserted into Makefile right after the
9248 generated cleanall target.
9249 </p>
9250
9251 <p class="Code">
9252 // The Project File editor does not edit these
9253 lines - edit the .vpj
9254 </p>
9255
9256 <p class="Code">
9257 // directly. You should know what you are
9258 doing.
9259 </p>
9260
9261 <p class="Code">// Section 14 - USER TARGETS</p>
9262
9263 <p class="Code">&lt;%marker(top)%&gt;</p>
9264
9265 <p class="Code">&lt;%marker(macros)%&gt;</p>
9266
9267 <p class="Code">&lt;%marker(local)%&gt;</p>
9268
9269 <p class="Code">&lt;%marker(bottom)%&gt;</p>
9270
9271 <p class="Code">//end-user-targets</p>
9272
9273 <p class="Code">&nbsp;</p>
9274
9275 <p class="Code">// Section 15 - LIBRARY FILES</p>
9276
9277 <p class="Code">&lt;%foreach(libs lit_libs pure_libs)%&gt;</p>
9278
9279 <p class="Code">&lt;%lib%&gt;</p>
9280
9281 <p class="Code">&lt;%endfor%&gt;</p>
9282
9283 <p class="Code">//end-library-files</p>
9284
9285
9286 </blockquote>
9287
9288 <p class="Body">
9289 Note that output is generated differently
9290 depending upon whether <em class="Code">&lt;%exename%&gt;</em>,
9291 <em class="Code">&lt;%sharedname%&gt;</em> or <em class=
9292 "Code">&lt;%staticname%&gt;</em> is defined due to the if
9293 statements that were used with relation these variable names.
9294 Also, certain portions of the project file are only generated if
9295 particular variables are set.
9296 </p>
9297
9298 </div>
9299
9300 <div>
9301 <h5 class="Head4">Project Creator</h5>
9302
9303 <p class="BodyNoLead">
9304 Next, you would write the <em class=
9305 "Code">FictionalProjectCreator.pm</em>. It may be best to start
9306 with a copy of the <em class="Code">MakeProjectCreator.pm</em>
9307 and edit it. Change the package name to <em class=
9308 "Code">FictionalProjectCreator</em> and have it inherit from
9309 <em class="Code">MakeProjectBase</em> and <em class=
9310 "Code">ProjectCreator</em>. Then, override the methods that are
9311 needed for this particular type.
9312 </p>
9313
9314 <blockquote>
9315 <p class="Code">package FictionalProjectCreator;</p>
9316
9317 <p class="Code">&nbsp;</p>
9318
9319 <p class="Code">
9320 #
9321 ************************************************************
9322 </p>
9323
9324 <p class="Code"># Description : A Fictional Project Creator</p>
9325
9326 <p class="Code"># Author : Chad Elliott</p>
9327
9328 <p class="Code"># Create Date : 10/01/2004</p>
9329
9330 <p class="Code">
9331 #
9332 ************************************************************
9333 </p>
9334
9335 <p class="Code">&nbsp;</p>
9336
9337 <p class="Code">
9338 #
9339 ************************************************************
9340 </p>
9341
9342 <p class="Code"># Pragmas</p>
9343
9344 <p class="Code">
9345 #
9346 ************************************************************
9347 </p>
9348
9349 <p class="Code">&nbsp;</p>
9350
9351 <p class="Code">use strict;</p>
9352
9353 <p class="Code">&nbsp;</p>
9354
9355 <p class="Code">use MakeProjectBase;</p>
9356
9357 <p class="Code">use ProjectCreator;</p>
9358
9359 <p class="Code">&nbsp;</p>
9360
9361 <p class="Code">use vars qw(@ISA);</p>
9362
9363 <p class="Code">@ISA = qw(MakeProjectBase ProjectCreator);</p>
9364
9365 <p class="Code">&nbsp;</p>
9366
9367 <p class="Code">
9368 #
9369 ************************************************************
9370 </p>
9371
9372 <p class="Code"># Subroutine Section</p>
9373
9374 <p class="Code">
9375 #
9376 ************************************************************
9377 </p>
9378
9379 <p class="Code">&nbsp;</p>
9380
9381 <p class="Code">sub convert_slashes {</p>
9382
9383 <p class="Code">&nbsp;&nbsp;#my $self = shift;</p>
9384
9385 <p class="Code">&nbsp;&nbsp;return 0;</p>
9386
9387 <p class="Code">}</p>
9388
9389 <p class="Code">&nbsp;</p>
9390
9391 <p class="Code">&nbsp;</p>
9392
9393 <p class="Code">sub project_file_extension {</p>
9394
9395 <p class="Code">&nbsp;&nbsp;#my $self = shift;</p>
9396
9397 <p class="Code">&nbsp;&nbsp;return '.fic';</p>
9398
9399 <p class="Code">}</p>
9400
9401 <p class="Code">&nbsp;</p>
9402
9403 <p class="Code">&nbsp;</p>
9404
9405 <p class="Code">sub get_dll_exe_template_input_file {</p>
9406
9407 <p class="Code">&nbsp;&nbsp;#my $self = shift;</p>
9408
9409 <p class="Code">&nbsp;&nbsp;return 'fictionalexe';</p>
9410
9411 <p class="Code">}</p>
9412
9413 <p class="Code">&nbsp;</p>
9414
9415 <p class="Code">&nbsp;</p>
9416
9417 <p class="Code">sub get_dll_template_input_file {</p>
9418
9419 <p class="Code">&nbsp;&nbsp;#my $self = shift;</p>
9420
9421 <p class="Code">&nbsp;&nbsp;return 'fictionaldll';</p>
9422
9423 <p class="Code">}</p>
9424
9425 <p class="Code">&nbsp;</p>
9426
9427 <p class="Code">&nbsp;</p>
9428
9429 <p class="Code">sub get_template {</p>
9430
9431 <p class="Code">&nbsp;&nbsp;#my $self = shift;</p>
9432
9433 <p class="Code">&nbsp;&nbsp;return 'fictional';</p>
9434
9435 <p class="Code">}</p>
9436
9437 <p class="Code">&nbsp;</p>
9438
9439 <p class="Code">1;</p>
9440
9441 <p class="Code">&nbsp;</p>
9442 </blockquote>
9443
9444 <p class="Body">
9445 In our example, we inherit from the
9446 MakeProjectBase which provides some methods that are common to
9447 all &ldquo;make&rdquo; based project creators.
9448 </p>
9449
9450 <p class="Body">
9451 We override the <em class=
9452 "Code">convert_slashes</em> method to return 0. A zero return
9453 value tells MPC not to convert slashes to back slashes
9454 (converting slashes is useful for Windows related build
9455 tools).
9456 </p>
9457
9458 <p class="Body">
9459 We then override the <em class=
9460 "Code">project_file_extension</em> method to return the project
9461 file extension which is used by a method defined in the
9462 MakeProjectBase module.
9463 </p>
9464
9465 <p class="Body">
9466 Next, we override the <em class=
9467 "Code">get_dll_exe_template_input_file</em> and <em class=
9468 "Code">get_dll_template_input_file</em> methods. Those methods
9469 return the specific template input file names for a dynamic
9470 executable and dynamic library, respectively.
9471 </p>
9472
9473 <p class="Body">
9474 Lastly, we override the <em class=
9475 "Code">get_template</em> method to return the template file name
9476 for our new project type. In our case, the method returns
9477 <em class="Code">fictional</em> which corresponds to the name of
9478 the template file we created earlier.
9479 </p>
9480
9481 <p class="Body">
9482 There are many other methods that can be
9483 overridden to change the way MPC generates output. For a complete
9484 list, see the &ldquo;Virtual Methods To Be Overridden&rdquo;
9485 section of the <em class="Code">Creator.pm</em> and <em class=
9486 "Code">ProjectCreator.pm</em>.
9487 </p>
9488
9489 </div>
9490
9491 <div>
9492 <h5 class="Head4">Workspace Creator</h5>
9493
9494 <p class="BodyNoLead">
9495 The last part that you would need to write
9496 is the <em class="Code">FictionalWorkspaceCreator.pm</em>. This
9497 module is usually more code-intensive than its Project Creator
9498 counterpart.
9499 </p>
9500
9501 <blockquote>
9502 <p class="Code">package FictionalWorkspaceCreator;</p>
9503
9504 <p class="Code">&nbsp;</p>
9505
9506 <p class="Code">
9507 #
9508 ************************************************************
9509 </p>
9510
9511 <p class="Code">
9512 # Description : A Fictional Workspace
9513 Creator
9514 </p>
9515
9516 <p class="Code"># Author : Chad Elliott</p>
9517
9518 <p class="Code"># Create Date : 10/01/2004</p>
9519
9520 <p class="Code">
9521 #
9522 ************************************************************
9523 </p>
9524
9525 <p class="Code">&nbsp;</p>
9526
9527 <p class="Code">
9528 #
9529 ************************************************************
9530 </p>
9531
9532 <p class="Code"># Pragmas</p>
9533
9534 <p class="Code">
9535 #
9536 ************************************************************
9537 </p>
9538
9539 <p class="Code">&nbsp;</p>
9540
9541 <p class="Code">use strict;</p>
9542
9543 <p class="Code">&nbsp;</p>
9544
9545 <p class="Code">use FictionalProjectCreator;</p>
9546
9547 <p class="Code">use WorkspaceCreator;</p>
9548
9549 <p class="Code">&nbsp;</p>
9550
9551 <p class="Code">use vars qw(@ISA);</p>
9552
9553 <p class="Code">@ISA = qw(WorkspaceCreator);</p>
9554
9555 <p class="Code">&nbsp;</p>
9556
9557 <p class="Code">
9558 #
9559 ************************************************************
9560 </p>
9561
9562 <p class="Code"># Subroutine Section</p>
9563
9564 <p class="Code">
9565 #
9566 ************************************************************
9567 </p>
9568
9569 <p class="Code">&nbsp;</p>
9570
9571 <p class="Code">sub workspace_file_name {</p>
9572
9573 <p class="Code">&nbsp;&nbsp;my $self = shift;</p>
9574
9575 <p class="Code">
9576 &nbsp;&nbsp;return
9577 $self-&gt;get_modified_workspace_name($self-&gt;get_workspace_name(),
9578 '.fws');
9579 </p>
9580
9581 <p class="Code">}</p>
9582
9583 <p class="Code">&nbsp;</p>
9584
9585 <p class="Code">&nbsp;</p>
9586
9587 <p class="Code">sub pre_workspace {</p>
9588
9589 <p class="Code">&nbsp;&nbsp;my($self, $fh) = @_;</p>
9590
9591 <p class="Code">&nbsp;&nbsp;my $crlf = $self-&gt;crlf();</p>
9592
9593 <p class="Code">&nbsp;</p>
9594
9595 <p class="Code">
9596 &nbsp;&nbsp;print $fh '&lt;?xml version="1.0"
9597 encoding="UTF-8"?&gt;', $crlf,
9598 </p>
9599
9600 <p class="Code">
9601 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'&lt;!--
9602 MPC Command --&gt;', $crlf,
9603 </p>
9604
9605 <p class="Code">
9606 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&lt;!--
9607 $0 @ARGV --&gt;", $crlf;
9608 </p>
9609
9610 <p class="Code">}</p>
9611
9612 <p class="Code">&nbsp;</p>
9613
9614 <p class="Code">&nbsp;</p>
9615
9616 <p class="Code">sub write_comps {</p>
9617
9618 <p class="Code">&nbsp;&nbsp;my($self, $fh) = @_;</p>
9619
9620 <p class="Code">
9621 &nbsp;&nbsp;my $projects =
9622 $self-&gt;get_projects();
9623 </p>
9624
9625 <p class="Code">
9626 &nbsp;&nbsp;my @list =
9627 $self-&gt;sort_dependencies($projects);
9628 </p>
9629
9630 <p class="Code">&nbsp;&nbsp;my $crlf = $self-&gt;crlf();</p>
9631
9632 <p class="Code">&nbsp;</p>
9633
9634 <p class="Code">
9635 &nbsp;&nbsp;print $fh '&lt;projects&gt;',
9636 $crlf;
9637 </p>
9638
9639 <p class="Code">&nbsp;&nbsp;foreach my $project (@list) {</p>
9640
9641 <p class="Code">
9642 &nbsp;&nbsp;&nbsp;&nbsp;print $fh " &lt;project
9643 path=\"$project\"/&gt;$crlf";
9644 </p>
9645
9646 <p class="Code">&nbsp;&nbsp;}</p>
9647
9648 <p class="Code">
9649 &nbsp;&nbsp;print $fh
9650 "&lt;/projects&gt;$crlf";
9651 </p>
9652
9653 <p class="Code">}</p>
9654
9655 <p class="Code">&nbsp;</p>
9656
9657 <p class="Code">&nbsp;</p>
9658
9659 <p class="Code">1;</p>
9660
9661 <p class="Code">&nbsp;</p>
9662
9663 <p class="Code">&nbsp;</p>
9664 </blockquote>
9665
9666 <p class="Body">
9667 The first method we override from
9668 WorkspaceCreator.pm is the <em class=
9669 "Code">workspace_file_name</em> method. It is used to determine
9670 the output file for the generated workspace.
9671 </p>
9672
9673 <p class="Body">
9674 Second, we override the <em class=
9675 "Code">pre_workspace</em> method, which we use to print out the
9676 generic unchanging section of our generated workspace.
9677 </p>
9678
9679 <p class="Body">
9680 Lastly, we override the <em class=
9681 "Code">write_comps</em> method. This method is where the bulk of
9682 the work is done in our workspace creator. A workspace creator
9683 has many sets of data available. A reference to the list of
9684 project file names can be obtained through the <em class=
9685 "Code">get_projects</em> method; project-specific information can
9686 be obtained through the <em class="Code">get_project_info</em>
9687 method which returns an array reference where each array element
9688 is an array containing the project name, project dependencies and
9689 a project guid (if applicable).
9690 </p>
9691
9692 </div>
9693 </div>
9694 </div>
9695 </div>
9696 </body>
9697 </html>