1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
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"
15 <body bgcolor=
"#FFFFFF">
17 <h2 class=
"ChapterNum"> </h2>
21 <h1 class=
"Head1">The Makefile, Project, and Workspace Creator (MPC)
</h1>
24 <h3 class=
"Head2">Introduction
</h3>
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.
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.
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">
68 <h3 class=
"Head2">Using MPC
</h3>
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
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.
89 <a name=
"Figure_1-2"></a>This diagram shows a
90 high-level view of project file generation using mpc.pl.
94 <h6 class=
"FigTitle">Generating projects with mpc.pl
</h6>
96 <table border=
"1" summary=
"Generating projects with mpc.pl">
98 <td rowspan=
"1" colspan=
"1">
99 <p class=
"Tbl-Body"> </p>
102 <img src=
"images/mpc.png" alt=
103 "Generating projects with mpc.pl">
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
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.
127 The following diagram shows a high-level view of
128 workspace file generation using mwc.pl.
131 <h6 class=
"FigTitle">Generating workspaces with mwc.pl
</h6>
134 <table border=
"1" summary=
"Generating workspaces with mwc.pl">
136 <td rowspan=
"1" colspan=
"1">
137 <p class=
"Tbl-Body"> </p>
140 <img src=
"images/mwc.png" alt=
141 "Generating workspaces with mwc.pl">
151 <h4 class=
"Head3">Supported Build Tools
</h4>
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
’s
<em class=
"Code">-type
</em> option) and their
158 associated build tools.
162 <h6 class=
"NumberedTableTitle">MPC Types
</h6>
165 <table border=
"1" summary=
"MPC Types">
167 <th rowspan=
"1" colspan=
"1">
168 <p class=
"Tbl-Heading">Type
</p>
171 <th rowspan=
"1" colspan=
"1">
172 <p class=
"Tbl-Heading">Build Tool
</p>
177 <td rowspan=
"1" colspan=
"1">
179 <em class=
"TableCode">automake
</em>
183 <td rowspan=
"1" colspan=
"1">
184 <p class=
"Tbl-Body">GNU Automake.
</p>
189 <td rowspan=
"1" colspan=
"1">
191 <em class=
"TableCode">bcb2007
</em>
195 <td rowspan=
"1" colspan=
"1">
196 <p class=
"Tbl-Body">Borland C++ Builder
2007.
</p>
201 <td rowspan=
"1" colspan=
"1">
203 <em class=
"TableCode">bcb2009
</em>
207 <td rowspan=
"1" colspan=
"1">
208 <p class=
"Tbl-Body">CodeGear C++ Builder
2009.
</p>
213 <td rowspan=
"1" colspan=
"1">
215 <em class=
"TableCode">bds4
</em>
219 <td rowspan=
"1" colspan=
"1">
221 Support for Borland Developer Studio
4
228 <td rowspan=
"1" colspan=
"1">
230 <em class=
"TableCode">bmake
</em>
234 <td rowspan=
"1" colspan=
"1">
235 <p class=
"Tbl-Body">Borland Make.
</p>
240 <td rowspan=
"1" colspan=
"1">
242 <em class=
"TableCode">cc
</em>
246 <td rowspan=
"1" colspan=
"1">
247 <p class=
"Tbl-Body">Code Composer Studio
2.0</p>
252 <td rowspan=
"1" colspan=
"1">
254 <em class=
"TableCode">
255 <a href=
"CDT6.html">cdt6
</a>
260 <td rowspan=
"1" colspan=
"1">
262 Eclipse CDT
6 (for Eclipse
"Galileo" 3.5)
268 <td rowspan=
"1" colspan=
"1">
270 <em class=
"TableCode">
272 <!--CDT6.html describes cdt7 as well
279 <td rowspan=
"1" colspan=
"1">
281 Eclipse CDT
7 (for Eclipse
"Helios" 3.6)
287 <td rowspan=
"1" colspan=
"1">
289 <em class=
"TableCode">cmake
</em>
293 <td rowspan=
"1" colspan=
"1">
294 <p class=
"Tbl-Body">Support for CMake requires user provided modules for custom commands.
</p>
299 <td rowspan=
"1" colspan=
"1">
301 <em class=
"TableCode">em3
</em>
305 <td rowspan=
"1" colspan=
"1">
306 <p class=
"Tbl-Body">eMbedded Visual C++
3.00 and
4.00.
</p>
311 <td rowspan=
"1" colspan=
"1">
313 <em class=
"TableCode">ghs
</em>
317 <td rowspan=
"1" colspan=
"1">
318 <p class=
"Tbl-Body">Green Hills C++ Builder.
</p>
323 <td rowspan=
"1" colspan=
"1">
325 <em class=
"TableCode">gnuace
</em>
329 <td rowspan=
"1" colspan=
"1">
331 GNU Make for ACE/TAO/CIAO only
332 (ACE/TAO/CIAO extension).
338 <td rowspan=
"1" colspan=
"1">
340 <em class=
"TableCode">html
</em>
344 <td rowspan=
"1" colspan=
"1">
346 html pages are generated for
347 visualization of project information.
353 <td rowspan=
"1" colspan=
"1">
355 <em class=
"TableCode">make
</em>
359 <td rowspan=
"1" colspan=
"1">
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
370 <td rowspan=
"1" colspan=
"1">
372 <em class=
"TableCode">nmake
</em>
376 <td rowspan=
"1" colspan=
"1">
377 <p class=
"Tbl-Body">Microsoft NMake.
</p>
382 <td rowspan=
"1" colspan=
"1">
384 <em class=
"TableCode">
385 <a href=
"RpmSpec.html">rpmspec
</a>
390 <td rowspan=
"1" colspan=
"1">
391 <p class=
"Tbl-Body">RPM packaging .spec files.
</p>
396 <td rowspan=
"1" colspan=
"1">
398 <em class=
"TableCode">sle
</em>
402 <td rowspan=
"1" colspan=
"1">
404 Support for Visual SlickEdit is
411 <td rowspan=
"1" colspan=
"1">
413 <em class=
"TableCode">vc6
</em>
417 <td rowspan=
"1" colspan=
"1">
418 <p class=
"Tbl-Body">Visual C++
6.0.
</p>
423 <td rowspan=
"1" colspan=
"1">
425 <em class=
"TableCode">vc7
</em>
429 <td rowspan=
"1" colspan=
"1">
430 <p class=
"Tbl-Body">Visual Studio .NET
2002.
</p>
435 <td rowspan=
"1" colspan=
"1">
437 <em class=
"TableCode">vc71
</em>
441 <td rowspan=
"1" colspan=
"1">
442 <p class=
"Tbl-Body">Visual Studio .NET
2003.
</p>
447 <td rowspan=
"1" colspan=
"1">
449 <em class=
"TableCode">vc8
</em>
453 <td rowspan=
"1" colspan=
"1">
454 <p class=
"Tbl-Body">Visual Studio
2005.
</p>
459 <td rowspan=
"1" colspan=
"1">
461 <em class=
"TableCode">vc9
</em>
465 <td rowspan=
"1" colspan=
"1">
466 <p class=
"Tbl-Body">Visual Studio
2008.
</p>
471 <td rowspan=
"1" colspan=
"1">
473 <em class=
"TableCode">vc10
</em>
477 <td rowspan=
"1" colspan=
"1">
478 <p class=
"Tbl-Body">Visual Studio
2010.
</p>
483 <td rowspan=
"1" colspan=
"1">
485 <em class=
"TableCode">vc11
</em>
489 <td rowspan=
"1" colspan=
"1">
490 <p class=
"Tbl-Body">Visual Studio
2012.
</p>
495 <td rowspan=
"1" colspan=
"1">
497 <em class=
"TableCode">vc12
</em>
501 <td rowspan=
"1" colspan=
"1">
502 <p class=
"Tbl-Body">Visual Studio
2013.
</p>
507 <td rowspan=
"1" colspan=
"1">
509 <em class=
"TableCode">vc14
</em>
513 <td rowspan=
"1" colspan=
"1">
514 <p class=
"Tbl-Body">Visual Studio
2015.
</p>
519 <td rowspan=
"1" colspan=
"1">
521 <em class=
"TableCode">vs2017
</em>
525 <td rowspan=
"1" colspan=
"1">
526 <p class=
"Tbl-Body">Visual Studio
2017.
</p>
531 <td rowspan=
"1" colspan=
"1">
533 <em class=
"TableCode">vs2019
</em>
537 <td rowspan=
"1" colspan=
"1">
538 <p class=
"Tbl-Body">Visual Studio
2019.
</p>
543 <td rowspan=
"1" colspan=
"1">
545 <em class=
"TableCode">vs2022
</em>
549 <td rowspan=
"1" colspan=
"1">
550 <p class=
"Tbl-Body">Visual Studio
2022.
</p>
555 <td rowspan=
"1" colspan=
"1">
557 <em class=
"TableCode">
565 <td rowspan=
"1" colspan=
"1">
566 <p class=
"Tbl-Body">Wind River Workbench
2.6.
</p>
571 <td rowspan=
"1" colspan=
"1">
573 <em class=
"TableCode">
581 <td rowspan=
"1" colspan=
"1">
582 <p class=
"Tbl-Body">Wind River Workbench
3.0.
</p>
587 <td rowspan=
"1" colspan=
"1">
589 <em class=
"TableCode">wix
</em>
593 <td rowspan=
"1" colspan=
"1">
594 <p class=
"Tbl-Body">Wix toolset for .msi creation.
</p>
604 <h4 class=
"Head3">Command Line
</h4>
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
617 The table below describes each option with the
618 more commonly used options in bold and project specific options in
623 <h6 class=
"NumberedTableTitle">
625 "Command%20Line%20Options"></a>Command Line Options
629 <table border=
"1" summary=
"Command Line Options">
631 <th rowspan=
"1" colspan=
"1">
632 <p class=
"Tbl-Heading">Option
</p>
635 <th rowspan=
"1" colspan=
"1">
636 <p class=
"Tbl-Heading">Description
</p>
641 <td rowspan=
"1" colspan=
"1">
643 <em class=
"TableCode">-base
</em>
647 <td rowspan=
"1" colspan=
"1">
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.
658 <td rowspan=
"1" colspan=
"1">
661 "TableCode">-complete
</em>
665 <td rowspan=
"1" colspan=
"1">
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.
676 <td rowspan=
"1" colspan=
"1">
678 <em class=
"TableCode">-exclude
</em>
682 <td rowspan=
"1" colspan=
"1">
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>.
695 <td rowspan=
"1" colspan=
"1">
698 "TableCode">-expand_vars
</em>
702 <td rowspan=
"1" colspan=
"1">
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.
714 <td rowspan=
"1" colspan=
"1">
717 "TableCode">-feature_file
</em>
721 <td rowspan=
"1" colspan=
"1">
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.
738 <td rowspan=
"1" colspan=
"1">
741 "TableCode">-features
</em>
745 <td rowspan=
"1" colspan=
"1">
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.
759 <td rowspan=
"1" colspan=
"1">
762 "TableCode">-for_eclipse
</em>
766 <td rowspan=
"1" colspan=
"1">
768 Allows generated makefiles to be used
775 <td rowspan=
"1" colspan=
"1">
777 <em class=
"TableCode">-gendot
</em>
781 <td rowspan=
"1" colspan=
"1">
783 A .dot file, for use with Graphviz,
784 will be created for each workspace processed.
790 <td rowspan=
"1" colspan=
"1">
792 <em class=
"TableCode">-genins
</em>
796 <td rowspan=
"1" colspan=
"1">
798 This option instructs MPC to generate
799 an
“install
” file after processing each
800 project. These
“install
” 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.
808 <td rowspan=
"1" colspan=
"1">
811 "TableCode">-gfeature_file
</em>
815 <td rowspan=
"1" colspan=
"1">
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.
826 <td rowspan=
"1" colspan=
"1">
828 <em class=
"TableCode">-global
</em>
832 <td rowspan=
"1" colspan=
"1">
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=
838 ACE_wrappers/bin/MakeProjectCreator/global.mpb or
839 MPC/config/global.mpb
846 <td rowspan=
"1" colspan=
"1">
849 "TableCode">-hierarchy
</em>
853 <td rowspan=
"1" colspan=
"1">
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
“make
” based workspace types.
866 <td rowspan=
"1" colspan=
"1">
870 "TableCode">-include
</em>
875 <td rowspan=
"1" colspan=
"1">
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.
886 <td rowspan=
"1" colspan=
"1">
888 <em class=
"TableCode">-into
</em>
892 <td rowspan=
"1" colspan=
"1">
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.
904 <td rowspan=
"1" colspan=
"1">
907 "TableCode">-language
</em>
911 <td rowspan=
"1" colspan=
"1">
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.
923 <td rowspan=
"1" colspan=
"1">
926 "TableCode">-make_coexistence
</em>
930 <td rowspan=
"1" colspan=
"1">
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> ).
947 <td rowspan=
"1" colspan=
"1">
950 "TableCode">-name_modifier
</em>
954 <td rowspan=
"1" colspan=
"1">
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.
969 <td rowspan=
"1" colspan=
"1">
972 "TableCode">-apply_project
</em>
976 <td rowspan=
"1" colspan=
"1">
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.
988 <td rowspan=
"1" colspan=
"1">
991 "TableCode">-nocomments
</em>
995 <td rowspan=
"1" colspan=
"1">
997 Comments will not be placed in the
998 generated workspace files.
1004 <td rowspan=
"1" colspan=
"1">
1005 <p class=
"Tbl-Body">
1007 "TableCode">-noreldefs
</em>
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.
1021 <td rowspan=
"1" colspan=
"1">
1022 <p class=
"Tbl-Body">
1024 "TableCode">-notoplevel
</em>
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.
1041 <td rowspan=
"1" colspan=
"1">
1042 <p class=
"Tbl-Body">
1043 <em class=
"TableCode">-recurse
</em>
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.
1057 <td rowspan=
"1" colspan=
"1">
1058 <p class=
"Tbl-Body">
1061 "TableCode">-relative
</em>
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>.
1080 <td rowspan=
"1" colspan=
"1">
1081 <p class=
"Tbl-Body">
1083 "TableCode">-relative_file
</em>
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.
1097 <td rowspan=
"1" colspan=
"1">
1098 <p class=
"Tbl-Body">
1099 <em class=
"TableCode">-static
</em>
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.
1113 <td rowspan=
"1" colspan=
"1">
1114 <p class=
"Tbl-Body">
1116 "TableCode">-template
</em>
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
1131 <td rowspan=
"1" colspan=
"1">
1132 <p class=
"Tbl-Body">
1133 <em class=
"TableCode">-ti
</em>
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>.
1150 <td rowspan=
"1" colspan=
"1">
1151 <p class=
"Tbl-Body">
1154 "TableCode">-type
</em>
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.
1170 <td rowspan=
"1" colspan=
"1">
1171 <p class=
"Tbl-Body">
1172 <em class=
"TableCode">-use_env
</em>
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.
1187 <td rowspan=
"1" colspan=
"1">
1188 <p class=
"Tbl-Body">
1190 "TableCode">-value_project
</em>
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
1201 "MakeProjectCreator.html#Additional-value_project_information"
1202 class=
"XRef">the -value_project Option
</a>.
1208 <td rowspan=
"1" colspan=
"1">
1209 <p class=
"Tbl-Body">
1211 "TableCode">-value_template
</em>
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>.
1228 <td rowspan=
"1" colspan=
"1">
1229 <p class=
"Tbl-Body">
1230 <em class=
"TableCode">-workers
</em>
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>.
1245 <td rowspan=
"1" colspan=
"1">
1246 <p class=
"Tbl-Body">
1247 <em class=
"TableCode">-workers_dir
</em>
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>.
1265 <td rowspan=
"1" colspan=
"1">
1266 <p class=
"Tbl-Body">
1267 <em class=
"TableCode">-workers_port
</em>
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>.
1283 <td rowspan=
"1" colspan=
"1">
1284 <p class=
"Tbl-Body">
1285 <em class=
"TableCode">-version
</em>
1289 <td rowspan=
"1" colspan=
"1">
1290 <p class=
"Tbl-Body">
1291 The MPC version is printed and no files
1301 <h5 class=
"Head4">Additional Option Descriptions
</h5>
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.
1321 "Additional-relative_information"></a>The -relative Option.
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).
1336 The
<em class=
"Code">-relative
</em> option
1337 takes a single parameter of a name value pair, for
1346 PROJ_TOP=/usr/projects/top
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:
1365 <p class=
"Code">project {
</p>
1367 <p class=
"Code"> includes += $(PROJ_TOP)
</p>
1369 <p class=
"Code">}
</p>
1375 The generated project file would contain text
1380 <p class=
"Code">CPPFLAGS += -I..
</p>
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>
1391 <a name=
"Additional-ti_information"></a>
1393 <h6 class=
"Head5">The -ti Option.
</h6>
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.
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.
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:
1429 mpc.pl -type vc71 -ti lib:vc7dsplib -ti
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
1445 <a name=
"Additional-value_project_information"></a>
1447 <h6 class=
"Head5">The -value_project Option.
</h6>
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
1461 mwc.pl -value_project
1462 includes+=/include/path
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.
1476 <a name=
"Additional-value_template_information"></a>
1478 <h6 class=
"Head5">The -value_template Option.
</h6>
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
1491 mwc.pl -type vc71 -value_template
1492 configurations=Release
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"><%
</em> and
1503 <em class=
"Code">%
></em> or use the
<em class=
1504 "Code">document_template.pl
</em> script described in the
1505 <a href=
"#Document_Template_Script">
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.
1516 <a name=
"Additional-workers_information"></a>
1518 <h6 class=
"Head5">The -workers Option.
</h6>
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:
1531 <p class=
"Code">mwc.pl -type gnuace -workers
4</p>
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.
1553 <a name=
"Additional-workers_dir_information"></a>
1555 <h6 class=
"Head5">The -workers_dir Option.
</h6>
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:
1572 <p class=
"Code">mwc.pl -type gnuace -workers
4 -workers_dir /tmp/mydir
</p>
1580 <a name=
"Additional-workers_port_information"></a>
1582 <h6 class=
"Head5">The -workers_port Option.
</h6>
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:
1595 <p class=
"Code">mwc.pl -type gnuace -workers
2 -workers_port
9876</p>
1605 <h4 class=
"Head3">Configuration Files
</h4>
1609 <h6 class=
"Head5">Codebase Configuration File (base.cfg)
</h6>
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.
1623 The
<em class=
"Code">base.cfg
</em> file allows you to specify which MPC.cfg
1624 file to use with the syntax:
<execution_path_root> =
<mpc_config_path
>.
1625 For a base.cfg file containing the following:
1630 <p class=
"Code">/foo/bar_root = /foo/bar_root/MPC/config
</p>
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>.
1639 For example, if
<em class=
1640 "Code">$MPC_ROOT/mwc.pl
</em> is run under
<em class=
1642 <strong>/foo/bar_root/
</strong>src
1643 </em>, MPC would attempt to open and read
<em class=
1645 <strong>/foo/bar_root/MPC/config/
</strong>MPC.cfg
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.
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.
1670 <h6 class=
"Head5">MPC Configuration File
</h6>
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.
1682 The following keywords are allowed in the
1687 <table border=
"1" summary=
"Configuration File Keywords">
1689 <th rowspan=
"1" colspan=
"1">
1690 <p class=
"Tbl-Heading">Keyword
</p>
1693 <th rowspan=
"1" colspan=
"1">
1694 <p class=
"Tbl-Heading">Description
</p>
1699 <td rowspan=
"1" colspan=
"1">
1700 <p class=
"Tbl-Body">
1702 "TableCode">command_line
</em>
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>.
1717 <td rowspan=
"1" colspan=
"1">
1718 <p class=
"Tbl-Body">
1720 "TableCode">default_type
</em>
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.
1734 <td rowspan=
"1" colspan=
"1">
1735 <p class=
"Tbl-Body">
1737 "TableCode">dynamic_types
</em>
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
1758 <td rowspan=
"1" colspan=
"1">
1759 <p class=
"Tbl-Body">
1760 <em class=
"TableCode">includes
</em>
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
1775 <td rowspan=
"1" colspan=
"1">
1776 <p class=
"Tbl-Body">
1777 <em class=
"TableCode">logging
</em>
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">
1803 <td rowspan=
"1" colspan=
"1">
1804 <p class=
"Tbl-Body">
1806 "TableCode">main_functions
</em>
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
1816 <language
>:
<func name
>[,
1817 <language
>:
<func name
>]*
1818 </em>. A function can
1819 be specified for all languages by only providing the
1826 <td rowspan=
"1" colspan=
"1">
1827 <p class=
"Tbl-Body">
1829 "TableCode">verbose_ordering
</em>
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.
1847 <h4 class=
"Head3">Environment Variables
</h4>
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.
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
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
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
1892 <a name=
"Writing_MPC_Files"></a>
1893 <h3 class=
"Head2">Writing MPC and MWC Files
</h3>
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.
1905 <h4 class=
"Head3">Input Files
</h4>
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.
1915 <h5 class=
"Head4">Project Files (mpc)
</h5>
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
“projects
” each of
1922 which needs to be uniquely named to avoid project generation
1923 errors. Projects represent build targets such as libraries and
1930 <h5 class=
"Head4">Workspace Files (mwc)
</h5>
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 “workspaces,
” 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.
1952 <h5 class=
"Head4">Base Project Files (mpb)
</h5>
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.
1969 <h5 class=
"Head4">Base Workspace Files (mwb)
</h5>
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
1983 <h4 class=
"Head3">General Input File Syntax
</h4>
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.
1994 <h5 class=
"Head4">mwc and mwb files
</h5>
1998 Workspaces can contain individual mpc
1999 files or directories. There can be one or more workspaces defined
2000 within a single mwc file.
2007 workspace(optional name):
2008 optional_base_workspace {
2011 <p class=
"Code"> file.mpc
</p>
2013 <p class=
"Code"> directory
</p>
2015 <p class=
"Code"> other.mwc
</p>
2017 <p class=
"Code"> </p>
2020 exclude(vc6, vc7, vc71, vc8, vc9,
2021 vc10, vc11, vc12, vc14, vs2017, vs2019, vs2022, nmake) {
2024 <p class=
"Code"> this_directory
</p>
2026 <p class=
"Code"> }
</p>
2028 <p class=
"Code"> </p>
2030 <p class=
"Code"> exclude(prop:microsoft) {
</p>
2032 <p class=
"Code"> non_microsoft
</p>
2034 <p class=
"Code"> }
</p>
2036 <p class=
"Code"> </p>
2038 <p class=
"Code"> specific(rpmspec) {
</p>
2040 <p class=
"Code"> rpm_version =
1.0</p>
2042 <p class=
"Code"> }
</p>
2044 <p class=
"Code">}
</p>
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
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
2067 The lines between the curly braces
2068 contain assignments, mpc files, directories, other
2069 workspace files or exclusion sections. For each listed item,
2071 <li>an mpc file will be included in the workspace,
</li>
2074 a directory recursively traversed and any mpc files
2075 found will be included,
2078 <a name=
"AggregatedWorkspace"></a>a workspace file will be aggregated into the main workspace.
2083 A workspace can have assignments interspersed
2084 within the directories and mpc files. These assignments modify
2085 the way projects are generated.
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
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.
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">
2128 class=
"Code">specific
</em> clause.
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.
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
2146 one of the mpc files listed in the
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
2158 <p class=
"Code">workspace {
</p>
2160 <p class=
"Code"> ...
</p>
2162 <p class=
"Code"> static {
</p>
2164 <p class=
"Code"> cmdline += -static
</p>
2166 <p class=
"Code"> directory/foo.mpc
</p>
2168 <p class=
"Code"> }
</p>
2170 <p class=
"Code"> </p>
2172 <p class=
"Code"> exclude(gnuace, make) {
</p>
2174 <p class=
"Code"> some.mpc
</p>
2176 <p class=
"Code"> }
</p>
2178 <p class=
"Code"> </p>
2181 // Associate the name
"other" with
2185 <p class=
"Code"> associate(other) {
</p>
2187 <p class=
"Code"> dir3
</p>
2189 <p class=
"Code"> }
</p>
2191 <p class=
"Code">}
</p>
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
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.
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.
2229 <h5 class=
"Head4">mpc and mpb files
</h5>
2232 <a name=
"Base_Project"></a>
2233 <h6 class=
"Head5">Project Declarations
</h6>
2237 Project declarations are similar to
2238 workspace declarations, but are a bit more complex. An mpc file
2239 can contain one or more
“projects
” and each project
2240 can inherit from base projects.
2244 <p class=
"Code"> </p>
2247 project(optional name): base_project,
2248 another_base_project {
2251 <p class=
"Code"> exename = client
</p>
2254 includes += directory_name
2258 <p class=
"Code"> libpaths += /usr/X11R6/lib
</p>
2260 <p class=
"Code"> </p>
2262 <p class=
"Code"> Header_Files {
</p>
2264 <p class=
"Code"> file1.h
</p>
2266 <p class=
"Code"> file2.h
</p>
2268 <p class=
"Code"> fileN.h
</p>
2270 <p class=
"Code"> }
</p>
2272 <p class=
"Code"> </p>
2274 <p class=
"Code"> Source_Files {
</p>
2276 <p class=
"Code"> file1.cpp
</p>
2278 <p class=
"Code"> file2.cpp
</p>
2280 <p class=
"Code"> fileN.cpp
</p>
2282 <p class=
"Code"> }
</p>
2284 <p class=
"Code">}
</p>
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.
2301 <h6 class=
"Head5">Base Projects
</h6>
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.
2315 <h6 class=
"Head5">Assignment Keywords
</h6>
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
2326 <p style=
"list-style: none">
2327 <h6 class=
"NumberedTableTitle">
2328 <a name=
"82186"></a>Assignment
2333 <table border=
"1" summary=
"Assignment Keywords">
2335 <th rowspan=
"1" colspan=
"1">
2336 <p class=
"Tbl-Heading">Keyword
</p>
2339 <th rowspan=
"1" colspan=
"1">
2340 <p class=
"Tbl-Heading">Description
</p>
2345 <td rowspan=
"1" colspan=
"1">
2346 <p class=
"Tbl-Body">
2349 "TableCode">after
</em>
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.
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">
2364 name[:name=value]
>
2366 These name-value pairs may be used in the creation
2367 of the dependencies of the project.
2375 <td rowspan=
"1" colspan=
"1">
2376 <p class=
"Tbl-Body">
2378 "TableCode">avoids
</em>
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.
2393 <td rowspan=
"1" colspan=
"1">
2394 <p class=
"Tbl-Body">
2396 "TableCode">buildflags
</em>
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.
2412 <td rowspan=
"1" colspan=
"1">
2413 <p class=
"Tbl-Body">
2415 "TableCode">custom_only
</em>
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>.
2431 <td rowspan=
"1" colspan=
"1">
2432 <p class=
"Tbl-Body">
2434 "TableCode">dependent_upon
</em>
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,
2450 <td rowspan=
"1" colspan=
"1">
2451 <p class=
"Tbl-Body">
2453 "TableCode">dllout
</em>
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.
2467 <td rowspan=
"1" colspan=
"1">
2468 <p class=
"Tbl-Body">
2471 "TableCode">dynamicflags
</em>
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.
2485 <td rowspan=
"1" colspan=
"1">
2486 <p class=
"Tbl-Body">
2489 "TableCode">exename
</em>
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
2504 <td rowspan=
"1" colspan=
"1">
2505 <p class=
"Tbl-Body">
2508 "TableCode">exeout
</em>
2513 <td rowspan=
"1" colspan=
"1">
2514 <p class=
"Tbl-Body">
2515 Specifies where executables will be
2522 <td rowspan=
"1" colspan=
"1">
2523 <p class=
"Tbl-Body">
2526 "TableCode">includes
</em>
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
2541 <td rowspan=
"1" colspan=
"1">
2542 <p class=
"Tbl-Body">
2545 "TableCode">libout
</em>
2550 <td rowspan=
"1" colspan=
"1">
2551 <p class=
"Tbl-Body">
2552 Specifies where the dynamic and
2553 static libraries will be placed.
2559 <td rowspan=
"1" colspan=
"1">
2560 <p class=
"Tbl-Body">
2563 "TableCode">libpaths
</em>
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
2578 <td rowspan=
"1" colspan=
"1">
2579 <p class=
"Tbl-Body">
2582 "TableCode">libs
</em>
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
2599 <td rowspan=
"1" colspan=
"1">
2600 <p class=
"Tbl-Body">
2602 "TableCode">lit_libs
</em>
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.
2615 <td rowspan=
"1" colspan=
"1">
2616 <p class=
"Tbl-Body">
2618 "TableCode">macros
</em>
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
2632 <td rowspan=
"1" colspan=
"1">
2633 <p class=
"Tbl-Body">
2635 "TableCode">managed
</em>
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.
2655 <td rowspan=
"1" colspan=
"1">
2656 <p class=
"Tbl-Body">
2658 "TableCode">no_pch
</em>
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
’s setting. This keyword
2667 can only be used as a source component scoped setting
2668 (i.e., inside the scope of Source_Files).
2674 <td rowspan=
"1" colspan=
"1">
2675 <p class=
"Tbl-Body">
2677 "TableCode">pch_header
</em>
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
2691 <td rowspan=
"1" colspan=
"1">
2692 <p class=
"Tbl-Body">
2694 "TableCode">pch_source
</em>
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
2708 <td rowspan=
"1" colspan=
"1">
2709 <p class=
"Tbl-Body">
2711 "TableCode">postbuild
</em>
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"><% %
></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">
2728 </a> for a list of pseudo variables
2729 that are also available.
2735 <td rowspan=
"1" colspan=
"1">
2736 <p class=
"Tbl-Body">
2738 "TableCode">postclean
</em>
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"><% %
></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">
2757 </a> for a list of pseudo variables
2758 that are also available.
2764 <td rowspan=
"1" colspan=
"1">
2765 <p class=
"Tbl-Body">
2767 "TableCode">prebuild
</em>
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">
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">
2787 </a> for a list of pseudo variables
2788 that are also available.
2794 <td rowspan=
"1" colspan=
"1">
2795 <p class=
"Tbl-Body">
2797 "TableCode">pure_libs
</em>
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.
2811 <td rowspan=
"1" colspan=
"1">
2812 <p class=
"Tbl-Body">
2814 "TableCode">recurse
</em>
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
2831 <td rowspan=
"1" colspan=
"1">
2832 <p class=
"Tbl-Body">
2834 "TableCode">recursive_includes
</em>
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.
2850 <td rowspan=
"1" colspan=
"1">
2851 <p class=
"Tbl-Body">
2853 "TableCode">recursive_libpaths
</em>
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
2870 <td rowspan=
"1" colspan=
"1">
2871 <p class=
"Tbl-Body">
2873 "TableCode">requires
</em>
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.
2888 <td rowspan=
"1" colspan=
"1">
2889 <p class=
"Tbl-Body">
2892 "TableCode">sharedname
</em>
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
2908 <td rowspan=
"1" colspan=
"1">
2909 <p class=
"Tbl-Body">
2912 "TableCode">staticflags
</em>
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.
2926 <td rowspan=
"1" colspan=
"1">
2927 <p class=
"Tbl-Body">
2930 "TableCode">staticname
</em>
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
2945 <td rowspan=
"1" colspan=
"1">
2946 <p class=
"Tbl-Body">
2948 "TableCode">tagchecks
</em>
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
2962 <td rowspan=
"1" colspan=
"1">
2963 <p class=
"Tbl-Body">
2965 "TableCode">tagname
</em>
2969 <td rowspan=
"1" colspan=
"1">
2970 <p class=
"Tbl-Body">
2971 Specifies the GNUACE Make macro to
2972 check before building the target.
2978 <td rowspan=
"1" colspan=
"1">
2979 <p class=
"Tbl-Body">
2981 "TableCode">version
</em>
2985 <td rowspan=
"1" colspan=
"1">
2986 <p class=
"Tbl-Body">
2987 Specifies the version number for
2988 the library or executable.
2994 <td rowspan=
"1" colspan=
"1">
2995 <p class=
"Tbl-Body">
2997 "TableCode">webapp
</em>
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.
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.
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).
3033 <p class=
"Code">specific(rpmspec) {
</p>
3034 <p class=
"Code"> rpm_description = \ns {
</p>
3035 <p class=
"Code">This description
</p>
3036 <p class=
"Code">spans multiple lines.
</p>
3037 <p class=
"Code"> }
</p>
3038 <p class=
"Code">}
</p>
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.
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
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.
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.
3084 <a name=
"16907"></a>
3086 <h6 class=
"Head5">Components
</h6>
3089 <p class=
"BodyNoLead">
3090 An mpc file can also specify the files
3091 to be included in the generated
“project
” 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
3098 <p style=
"list-style: none">
3099 <h6 class=
"NumberedTableTitle">
3100 Component Names and Default
3104 <table border=
"1" summary=
3105 "Component Names and Default Values">
3107 <th rowspan=
"1" colspan=
"1">
3108 <p class=
"Tbl-Heading">Name
</p>
3111 <th rowspan=
"1" colspan=
"1">
3112 <p class=
"Tbl-Heading">Default Value
</p>
3117 <td rowspan=
"1" colspan=
"1">
3118 <p class=
"Tbl-Body">
3120 "TableCode">Source_Files
</em>
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>.
3136 <td rowspan=
"1" colspan=
"1">
3137 <p class=
"Tbl-Body">
3139 "TableCode">Header_Files
</em>
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>.
3154 <td rowspan=
"1" colspan=
"1">
3155 <p class=
"Tbl-Body">
3157 "TableCode">Inline_Files
</em>
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=
3172 <td rowspan=
"1" colspan=
"1">
3173 <p class=
"Tbl-Body">
3175 "TableCode">Template_Files
</em>
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>.
3191 <td rowspan=
"1" colspan=
"1">
3192 <p class=
"Tbl-Body">
3194 "TableCode">Documentation_Files
</em>
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>.
3210 <td rowspan=
"1" colspan=
"1">
3211 <p class=
"Tbl-Body">
3213 "TableCode">Resource_Files
</em>
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.
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.
3236 Each component name accepts two forms. The
3237 first form is a simple list of files within the construct.
3243 <p class=
"Code">Source_Files {
</p>
3245 <p class=
"Code"> file1.cpp
</p>
3247 <p class=
"Code"> file2.cpp
</p>
3249 <p class=
"Code">}
</p>
3255 The second form is a complex list of files
3256 within named blocks.
3260 <a name=
"MPC grouping example"></a>
3264 <p class=
"Code">Source_Files(MACRO_NAME) {
</p>
3266 <p class=
"Code"> BlockA {
</p>
3268 <p class=
"Code"> file1.cpp
</p>
3270 <p class=
"Code"> file2.cpp
</p>
3272 <p class=
"Code"> }
</p>
3274 <p class=
"Code"> BlockB {
</p>
3276 <p class=
"Code"> file3.cpp
</p>
3278 <p class=
"Code"> file4.cpp
</p>
3280 <p class=
"Code"> }
</p>
3282 <p class=
"Code">}
</p>
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.
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
3310 <h6 class=
"Head5">Verbatim Clause
</h6>
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
3323 verbatim(
<project type
>,
3327 <p class=
"Code"> ...
</p>
3329 <p class=
"Code">}
</p>
3335 When MPC is generating a project of type
3336 <em class=
"Code"><project type
></em> and encounters a
3337 <em class=
"Code">marker
</em> in the template file (see
<a href=
3338 "MakeProjectCreator.html#38037" class=
"XRef">
3341 </a>) that matches the
<em class=
3342 "Code"><location
></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=
3355 <p class=
"Code">verbatim(gnuace, bottom) {
</p>
3357 <p class=
"Code"> all: foo
</p>
3359 <p class=
"Code">}
</p>
3365 <h6 class=
"Head5">Expand Clause
</h6>
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
3387 <p class=
"Code">expand(VAR_NAME) {
</p>
3389 <p class=
"Code"> $ENV_VAR
</p>
3391 <p class=
"Code"> last_resort_value
</p>
3393 <p class=
"Code">}
</p>
3400 <a name=
"projectSpecific">Specific Clause
</a>
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>.
3418 <p class=
"Code">specific(prop:windows) {
</p>
3420 <p class=
"Code"> lit_libs += qt-mt230nc
</p>
3422 <p class=
"Code">} else {
</p>
3424 <p class=
"Code"> lit_libs += qt-mt
</p>
3426 <p class=
"Code">}
</p>
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
’!
’)
3435 which will cause the specific to be evaluated for all types
3436 except the type specified.
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>).
3449 <a name=
"properties">
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).
3460 <h6 class=
"NumberedTableTitle">
3462 "Property_Table"></a>Property Table
3466 <table border=
"1" summary=
"Property Table">
3468 <th rowspan=
"1" colspan=
"1">
3469 <p class=
"Tbl-Heading">Project Type
</p>
3472 <th rowspan=
"1" colspan=
"1">
3473 <p class=
"Tbl-Heading">borland
</p>
3476 <th rowspan=
"1" colspan=
"1">
3477 <p class=
"Tbl-Heading">make
</p>
3480 <th rowspan=
"1" colspan=
"1">
3481 <p class=
"Tbl-Heading">microsoft
</p>
3484 <th rowspan=
"1" colspan=
"1">
3485 <p class=
"Tbl-Heading">windows
</p>
3490 <td rowspan=
"1" colspan=
"1">
3491 <p class=
"Tbl-Body">
3493 "TableCode">automake
</em>
3497 <td rowspan=
"1" colspan=
"1">
3498 <p class=
"Tbl-Body"> </p>
3501 <td rowspan=
"1" colspan=
"1">
3502 <p class=
"Tbl-Body">Yes
</p>
3505 <td rowspan=
"1" colspan=
"1">
3506 <p class=
"Tbl-Body"> </p>
3509 <td rowspan=
"1" colspan=
"1">
3510 <p class=
"Tbl-Body"> </p>
3515 <td rowspan=
"1" colspan=
"1">
3516 <p class=
"Tbl-Body">
3518 "TableCode">bcb2007
</em>
3522 <td rowspan=
"1" colspan=
"1">
3523 <p class=
"Tbl-Body">Yes
</p>
3526 <td rowspan=
"1" colspan=
"1">
3527 <p class=
"Tbl-Body"> </p>
3530 <td rowspan=
"1" colspan=
"1">
3531 <p class=
"Tbl-Body"> </p>
3534 <td rowspan=
"1" colspan=
"1">
3535 <p class=
"Tbl-Body">Yes
</p>
3540 <td rowspan=
"1" colspan=
"1">
3541 <p class=
"Tbl-Body">
3543 "TableCode">bcb2009
</em>
3547 <td rowspan=
"1" colspan=
"1">
3548 <p class=
"Tbl-Body">Yes
</p>
3551 <td rowspan=
"1" colspan=
"1">
3552 <p class=
"Tbl-Body"> </p>
3555 <td rowspan=
"1" colspan=
"1">
3556 <p class=
"Tbl-Body"> </p>
3559 <td rowspan=
"1" colspan=
"1">
3560 <p class=
"Tbl-Body">Yes
</p>
3565 <td rowspan=
"1" colspan=
"1">
3566 <p class=
"Tbl-Body">
3567 <em class=
"TableCode">bds4
</em>
3571 <td rowspan=
"1" colspan=
"1">
3572 <p class=
"Tbl-Body">Yes
</p>
3575 <td rowspan=
"1" colspan=
"1">
3576 <p class=
"Tbl-Body"> </p>
3579 <td rowspan=
"1" colspan=
"1">
3580 <p class=
"Tbl-Body"> </p>
3583 <td rowspan=
"1" colspan=
"1">
3584 <p class=
"Tbl-Body">Yes
</p>
3589 <td rowspan=
"1" colspan=
"1">
3590 <p class=
"Tbl-Body">
3592 "TableCode">bmake
</em>
3596 <td rowspan=
"1" colspan=
"1">
3597 <p class=
"Tbl-Body">Yes
</p>
3600 <td rowspan=
"1" colspan=
"1">
3601 <p class=
"Tbl-Body">Yes
</p>
3604 <td rowspan=
"1" colspan=
"1">
3605 <p class=
"Tbl-Body"> </p>
3608 <td rowspan=
"1" colspan=
"1">
3609 <p class=
"Tbl-Body">Yes
</p>
3614 <td rowspan=
"1" colspan=
"1">
3615 <p class=
"Tbl-Body">
3616 <em class=
"TableCode">cc
</em>
3620 <td rowspan=
"1" colspan=
"1">
3621 <p class=
"Tbl-Body"> </p>
3624 <td rowspan=
"1" colspan=
"1">
3625 <p class=
"Tbl-Body"> </p>
3628 <td rowspan=
"1" colspan=
"1">
3629 <p class=
"Tbl-Body"> </p>
3632 <td rowspan=
"1" colspan=
"1">
3633 <p class=
"Tbl-Body">Yes
</p>
3638 <td rowspan=
"1" colspan=
"1">
3639 <p class=
"Tbl-Body">
3640 <em class=
"TableCode">em3
</em>
3644 <td rowspan=
"1" colspan=
"1">
3645 <p class=
"Tbl-Body"> </p>
3648 <td rowspan=
"1" colspan=
"1">
3649 <p class=
"Tbl-Body"> </p>
3652 <td rowspan=
"1" colspan=
"1">
3653 <p class=
"Tbl-Body">Yes
</p>
3656 <td rowspan=
"1" colspan=
"1">
3657 <p class=
"Tbl-Body">Yes
</p>
3662 <td rowspan=
"1" colspan=
"1">
3663 <p class=
"Tbl-Body">
3664 <em class=
"TableCode">ghs
</em>
3668 <td rowspan=
"1" colspan=
"1">
3669 <p class=
"Tbl-Body"> </p>
3672 <td rowspan=
"1" colspan=
"1">
3673 <p class=
"Tbl-Body"> </p>
3676 <td rowspan=
"1" colspan=
"1">
3677 <p class=
"Tbl-Body"> </p>
3680 <td rowspan=
"1" colspan=
"1">
3681 <p class=
"Tbl-Body">Depends
</p>
3686 <td rowspan=
"1" colspan=
"1">
3687 <p class=
"Tbl-Body">
3688 <em class=
"TableCode">make
</em>
3692 <td rowspan=
"1" colspan=
"1">
3693 <p class=
"Tbl-Body"> </p>
3696 <td rowspan=
"1" colspan=
"1">
3697 <p class=
"Tbl-Body">Yes
</p>
3700 <td rowspan=
"1" colspan=
"1">
3701 <p class=
"Tbl-Body"> </p>
3704 <td rowspan=
"1" colspan=
"1">
3705 <p class=
"Tbl-Body"> </p>
3710 <td rowspan=
"1" colspan=
"1">
3711 <p class=
"Tbl-Body">
3713 "TableCode">nmake
</em>
3717 <td rowspan=
"1" colspan=
"1">
3718 <p class=
"Tbl-Body"> </p>
3721 <td rowspan=
"1" colspan=
"1">
3722 <p class=
"Tbl-Body">Yes
</p>
3725 <td rowspan=
"1" colspan=
"1">
3726 <p class=
"Tbl-Body">Yes
</p>
3729 <td rowspan=
"1" colspan=
"1">
3730 <p class=
"Tbl-Body">Yes
</p>
3735 <td rowspan=
"1" colspan=
"1">
3736 <p class=
"Tbl-Body">
3737 <em class=
"TableCode">vc6
</em>
3741 <td rowspan=
"1" colspan=
"1">
3742 <p class=
"Tbl-Body"> </p>
3745 <td rowspan=
"1" colspan=
"1">
3746 <p class=
"Tbl-Body"> </p>
3749 <td rowspan=
"1" colspan=
"1">
3750 <p class=
"Tbl-Body">Yes
</p>
3753 <td rowspan=
"1" colspan=
"1">
3754 <p class=
"Tbl-Body">Yes
</p>
3759 <td rowspan=
"1" colspan=
"1">
3760 <p class=
"Tbl-Body">
3761 <em class=
"TableCode">vc7
</em>
3765 <td rowspan=
"1" colspan=
"1">
3766 <p class=
"Tbl-Body"> </p>
3769 <td rowspan=
"1" colspan=
"1">
3770 <p class=
"Tbl-Body"> </p>
3773 <td rowspan=
"1" colspan=
"1">
3774 <p class=
"Tbl-Body">Yes
</p>
3777 <td rowspan=
"1" colspan=
"1">
3778 <p class=
"Tbl-Body">Yes
</p>
3783 <td rowspan=
"1" colspan=
"1">
3784 <p class=
"Tbl-Body">
3785 <em class=
"TableCode">vc71
</em>
3789 <td rowspan=
"1" colspan=
"1">
3790 <p class=
"Tbl-Body"> </p>
3793 <td rowspan=
"1" colspan=
"1">
3794 <p class=
"Tbl-Body"> </p>
3797 <td rowspan=
"1" colspan=
"1">
3798 <p class=
"Tbl-Body">Yes
</p>
3801 <td rowspan=
"1" colspan=
"1">
3802 <p class=
"Tbl-Body">Yes
</p>
3807 <td rowspan=
"1" colspan=
"1">
3808 <p class=
"Tbl-Body">
3809 <em class=
"TableCode">vc8
</em>
3813 <td rowspan=
"1" colspan=
"1">
3814 <p class=
"Tbl-Body"> </p>
3817 <td rowspan=
"1" colspan=
"1">
3818 <p class=
"Tbl-Body"> </p>
3821 <td rowspan=
"1" colspan=
"1">
3822 <p class=
"Tbl-Body">Yes
</p>
3825 <td rowspan=
"1" colspan=
"1">
3826 <p class=
"Tbl-Body">Yes
</p>
3831 <td rowspan=
"1" colspan=
"1">
3832 <p class=
"Tbl-Body">
3833 <em class=
"TableCode">vc9
</em>
3837 <td rowspan=
"1" colspan=
"1">
3838 <p class=
"Tbl-Body"> </p>
3841 <td rowspan=
"1" colspan=
"1">
3842 <p class=
"Tbl-Body"> </p>
3845 <td rowspan=
"1" colspan=
"1">
3846 <p class=
"Tbl-Body">Yes
</p>
3849 <td rowspan=
"1" colspan=
"1">
3850 <p class=
"Tbl-Body">Yes
</p>
3855 <td rowspan=
"1" colspan=
"1">
3856 <p class=
"Tbl-Body">
3857 <em class=
"TableCode">vc10
</em>
3861 <td rowspan=
"1" colspan=
"1">
3862 <p class=
"Tbl-Body"> </p>
3865 <td rowspan=
"1" colspan=
"1">
3866 <p class=
"Tbl-Body"> </p>
3869 <td rowspan=
"1" colspan=
"1">
3870 <p class=
"Tbl-Body">Yes
</p>
3873 <td rowspan=
"1" colspan=
"1">
3874 <p class=
"Tbl-Body">Yes
</p>
3879 <td rowspan=
"1" colspan=
"1">
3880 <p class=
"Tbl-Body">
3881 <em class=
"TableCode">vc11
</em>
3885 <td rowspan=
"1" colspan=
"1">
3886 <p class=
"Tbl-Body"> </p>
3889 <td rowspan=
"1" colspan=
"1">
3890 <p class=
"Tbl-Body"> </p>
3893 <td rowspan=
"1" colspan=
"1">
3894 <p class=
"Tbl-Body">Yes
</p>
3897 <td rowspan=
"1" colspan=
"1">
3898 <p class=
"Tbl-Body">Yes
</p>
3903 <td rowspan=
"1" colspan=
"1">
3904 <p class=
"Tbl-Body">
3905 <em class=
"TableCode">vc12
</em>
3909 <td rowspan=
"1" colspan=
"1">
3910 <p class=
"Tbl-Body"> </p>
3913 <td rowspan=
"1" colspan=
"1">
3914 <p class=
"Tbl-Body"> </p>
3917 <td rowspan=
"1" colspan=
"1">
3918 <p class=
"Tbl-Body">Yes
</p>
3921 <td rowspan=
"1" colspan=
"1">
3922 <p class=
"Tbl-Body">Yes
</p>
3927 <td rowspan=
"1" colspan=
"1">
3928 <p class=
"Tbl-Body">
3929 <em class=
"TableCode">vc14
</em>
3933 <td rowspan=
"1" colspan=
"1">
3934 <p class=
"Tbl-Body"> </p>
3937 <td rowspan=
"1" colspan=
"1">
3938 <p class=
"Tbl-Body"> </p>
3941 <td rowspan=
"1" colspan=
"1">
3942 <p class=
"Tbl-Body">Yes
</p>
3945 <td rowspan=
"1" colspan=
"1">
3946 <p class=
"Tbl-Body">Yes
</p>
3951 <td rowspan=
"1" colspan=
"1">
3952 <p class=
"Tbl-Body">
3953 <em class=
"TableCode">vs2017
</em>
3957 <td rowspan=
"1" colspan=
"1">
3958 <p class=
"Tbl-Body"> </p>
3961 <td rowspan=
"1" colspan=
"1">
3962 <p class=
"Tbl-Body"> </p>
3965 <td rowspan=
"1" colspan=
"1">
3966 <p class=
"Tbl-Body">Yes
</p>
3969 <td rowspan=
"1" colspan=
"1">
3970 <p class=
"Tbl-Body">Yes
</p>
3975 <td rowspan=
"1" colspan=
"1">
3976 <p class=
"Tbl-Body">
3977 <em class=
"TableCode">vs2019
</em>
3981 <td rowspan=
"1" colspan=
"1">
3982 <p class=
"Tbl-Body"> </p>
3985 <td rowspan=
"1" colspan=
"1">
3986 <p class=
"Tbl-Body"> </p>
3989 <td rowspan=
"1" colspan=
"1">
3990 <p class=
"Tbl-Body">Yes
</p>
3993 <td rowspan=
"1" colspan=
"1">
3994 <p class=
"Tbl-Body">Yes
</p>
3999 <td rowspan=
"1" colspan=
"1">
4000 <p class=
"Tbl-Body">
4001 <em class=
"TableCode">vs2022
</em>
4005 <td rowspan=
"1" colspan=
"1">
4006 <p class=
"Tbl-Body"> </p>
4009 <td rowspan=
"1" colspan=
"1">
4010 <p class=
"Tbl-Body"> </p>
4013 <td rowspan=
"1" colspan=
"1">
4014 <p class=
"Tbl-Body">Yes
</p>
4017 <td rowspan=
"1" colspan=
"1">
4018 <p class=
"Tbl-Body">Yes
</p>
4023 <td rowspan=
"1" colspan=
"1">
4024 <p class=
"Tbl-Body">
4025 <em class=
"TableCode">wix
</em>
4029 <td rowspan=
"1" colspan=
"1">
4030 <p class=
"Tbl-Body"> </p>
4033 <td rowspan=
"1" colspan=
"1">
4034 <p class=
"Tbl-Body"> </p>
4037 <td rowspan=
"1" colspan=
"1">
4038 <p class=
"Tbl-Body"> </p>
4041 <td rowspan=
"1" colspan=
"1">
4042 <p class=
"Tbl-Body">Yes
</p>
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.
4059 <h6 class=
"Head5">Conditional Clause
</h6>
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">
4068 </a>). The syntax is as follows:
4072 <p class=
"Code"> </p>
4075 conditional(
<project type|property
> [,
4076 <project type|property
> ...]) {
4079 <p class=
"Code"> source1.cpp
</p>
4081 <p class=
"Code"> ...
</p>
4083 <p class=
"Code">}
</p>
4088 conditional(
<project type|property
> [,
4089 <project type|property
> ...]) {
4092 <p class=
"Code"> source1.cpp
</p>
4094 <p class=
"Code"> ...
</p>
4096 <p class=
"Code">} else {
</p>
4098 <p class=
"Code"> source2.cpp
</p>
4100 <p class=
"Code"> ...
</p>
4102 <p class=
"Code">}
</p>
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
’!
’) which will
4111 cause the conditional to be evaluated for all types except the
4118 <a name=
"Custom_Types_and_Build_Rules"></a>
4120 <h6 class=
"Head5">Custom Types and Build Rules
</h6>
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.
4131 <p class=
"Code">project {
</p>
4133 <p class=
"Code"> Define_Custom(MOC) {
</p>
4135 <p class=
"Code"> automatic_in =
0</p>
4137 <p class=
"Code"> automatic_out =
0</p>
4140 command =
4145 output_option =
4149 <p class=
"Code"> inputext = .h
</p>
4152 pre_extension =
4157 source_outputext =
4162 keyword mocflags =
4166 <p class=
"Code"> }
</p>
4168 <p class=
"Code"> </p>
4170 <p class=
"Code"> // Custom Component
</p>
4172 <p class=
"Code"> MOC_Files {
</p>
4174 <p class=
"Code"> QtReactor.h
</p>
4176 <p class=
"Code"> }
</p>
4178 <p class=
"Code"> </p>
4180 <p class=
"Code"> Source_Files {
</p>
4182 <p class=
"Code"> QtReactor_moc.cpp
</p>
4184 <p class=
"Code"> }
</p>
4186 <p class=
"Code">}
</p>
4188 <p class=
"Code"> </p>
4192 The above example defines a custom file type,
4193 “<em class=
"Code">MOC
</em> ”, 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.
4201 Define_Custom definitions may use single
4202 inheritance. This is useful for creating aliased names:
4205 <p class=
"Code">Define_Custom(QtMOC) : MOC {
</p>
4206 <p class=
"Code">}
</p>
4210 The following table contains the keywords that
4211 can be used within the scope of
<em class=
4212 "Code">Define_Custom
</em>.
4215 <p style=
"list-style: none">
4216 <a name=
"32899"></a>
4218 <h6 class=
"NumberedTableTitle">Define_Custom Keywords
</h6>
4221 <table border=
"1" summary=
"Define_Custom Keywords">
4223 <th rowspan=
"1" colspan=
"1">
4224 <p class=
"Tbl-Heading">Keyword
</p>
4227 <th rowspan=
"1" colspan=
"1">
4228 <p class=
"Tbl-Heading">Description
</p>
4233 <td rowspan=
"1" colspan=
"1">
4234 <p class=
"Tbl-Body">
4236 "TableCode">automatic_in
</em>
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
4252 <td rowspan=
"1" colspan=
"1">
4253 <p class=
"Tbl-Body">
4255 "TableCode">automatic_out
</em>
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.
4277 <td rowspan=
"1" colspan=
"1">
4278 <p class=
"Tbl-Body">
4280 "TableCode">command
</em>
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
4294 <td rowspan=
"1" colspan=
"1">
4295 <p class=
"Tbl-Body">
4297 "TableCode">commandflags
</em>
4301 <td rowspan=
"1" colspan=
"1">
4302 <p class=
"Tbl-Body">
4303 Any options that should be passed
4310 <td rowspan=
"1" colspan=
"1">
4311 <p class=
"Tbl-Body">
4313 "TableCode">dependent
</em>
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.
4328 <td rowspan=
"1" colspan=
"1">
4329 <p class=
"Tbl-Body">
4331 "TableCode">dependent_libs
</em>
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.
4351 <td rowspan=
"1" colspan=
"1">
4352 <p class=
"Tbl-Body">
4354 "TableCode">inputext
</em>
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.
4367 <td rowspan=
"1" colspan=
"1">
4368 <p class=
"Tbl-Body">
4369 <em class=
"TableCode">
4376 <td rowspan=
"1" colspan=
"1">
4377 <p class=
"Tbl-Body">
4378 This is a special assignment that
4379 allows the user to map
<name
> 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.).
4392 <td rowspan=
"1" colspan=
"1">
4393 <p class=
"Tbl-Body">
4395 "TableCode">libpath
</em>
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.
4410 <td rowspan=
"1" colspan=
"1">
4411 <p class=
"Tbl-Body">
4413 "TableCode">output_option
</em>
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.
4427 <td rowspan=
"1" colspan=
"1">
4428 <p class=
"Tbl-Body">
4430 "TableCode">output_follows_input
</em>
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
4447 <td rowspan=
"1" colspan=
"1">
4448 <p class=
"Tbl-Body">
4450 "TableCode">pch_postrule
</em>
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
4465 <td rowspan=
"1" colspan=
"1">
4466 <p class=
"Tbl-Body">
4468 "TableCode">postcommand
</em>
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.
4482 <td rowspan=
"1" colspan=
"1">
4483 <p class=
"Tbl-Body">
4485 "TableCode">pre_extension
</em>
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
4504 <td rowspan=
"1" colspan=
"1">
4505 <p class=
"Tbl-Body">
4507 "TableCode">source_pre_extension
</em>
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.
4520 <td rowspan=
"1" colspan=
"1">
4521 <p class=
"Tbl-Body">
4523 "TableCode">inline_pre_extension
</em>
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.
4536 <td rowspan=
"1" colspan=
"1">
4537 <p class=
"Tbl-Body">
4539 "TableCode">header_pre_extension
</em>
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.
4552 <td rowspan=
"1" colspan=
"1">
4553 <p class=
"Tbl-Body">
4555 "TableCode">template_pre_extension
</em>
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.
4568 <td rowspan=
"1" colspan=
"1">
4569 <p class=
"Tbl-Body">
4571 "TableCode">resource_pre_extension
</em>
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.
4584 <td rowspan=
"1" colspan=
"1">
4585 <p class=
"Tbl-Body">
4587 "TableCode">documentation_pre_extension
</em>
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.
4600 <td rowspan=
"1" colspan=
"1">
4601 <p class=
"Tbl-Body">
4603 "TableCode">generic_pre_extension
</em>
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.
4616 <td rowspan=
"1" colspan=
"1">
4617 <p class=
"Tbl-Body">
4619 "TableCode">pre_filename
</em>
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.
4634 <td rowspan=
"1" colspan=
"1">
4635 <p class=
"Tbl-Body">
4637 "TableCode">source_pre_filename
</em>
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.
4650 <td rowspan=
"1" colspan=
"1">
4651 <p class=
"Tbl-Body">
4653 "TableCode">inline_pre_filename
</em>
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.
4666 <td rowspan=
"1" colspan=
"1">
4667 <p class=
"Tbl-Body">
4669 "TableCode">header_pre_filename
</em>
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.
4682 <td rowspan=
"1" colspan=
"1">
4683 <p class=
"Tbl-Body">
4685 "TableCode">template_pre_filename
</em>
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.
4698 <td rowspan=
"1" colspan=
"1">
4699 <p class=
"Tbl-Body">
4701 "TableCode">resource_pre_filename
</em>
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.
4714 <td rowspan=
"1" colspan=
"1">
4715 <p class=
"Tbl-Body">
4717 "TableCode">documentation_pre_filename
</em>
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.
4730 <td rowspan=
"1" colspan=
"1">
4731 <p class=
"Tbl-Body">
4733 "TableCode">generic_pre_filename
</em>
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.
4746 <td rowspan=
"1" colspan=
"1">
4747 <p class=
"Tbl-Body">
4749 "TableCode">pre_dirname
</em>
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
4767 <td rowspan=
"1" colspan=
"1">
4768 <p class=
"Tbl-Body">
4770 "TableCode">source_pre_dirname
</em>
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.
4783 <td rowspan=
"1" colspan=
"1">
4784 <p class=
"Tbl-Body">
4786 "TableCode">inline_pre_dirname
</em>
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.
4799 <td rowspan=
"1" colspan=
"1">
4800 <p class=
"Tbl-Body">
4802 "TableCode">header_pre_dirname
</em>
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.
4815 <td rowspan=
"1" colspan=
"1">
4816 <p class=
"Tbl-Body">
4818 "TableCode">template_pre_dirname
</em>
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.
4831 <td rowspan=
"1" colspan=
"1">
4832 <p class=
"Tbl-Body">
4834 "TableCode">resource_pre_dirname
</em>
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.
4847 <td rowspan=
"1" colspan=
"1">
4848 <p class=
"Tbl-Body">
4850 "TableCode">documentation_pre_dirname
</em>
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.
4863 <td rowspan=
"1" colspan=
"1">
4864 <p class=
"Tbl-Body">
4866 "TableCode">generic_pre_dirname
</em>
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.
4879 <td rowspan=
"1" colspan=
"1">
4880 <p class=
"Tbl-Body">
4882 "TableCode">source_outputext
</em>
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
4897 <td rowspan=
"1" colspan=
"1">
4898 <p class=
"Tbl-Body">
4900 "TableCode">inline_outputext
</em>
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
4915 <td rowspan=
"1" colspan=
"1">
4916 <p class=
"Tbl-Body">
4918 "TableCode">header_outputext
</em>
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
4933 <td rowspan=
"1" colspan=
"1">
4934 <p class=
"Tbl-Body">
4936 "TableCode">template_outputext
</em>
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
4951 <td rowspan=
"1" colspan=
"1">
4952 <p class=
"Tbl-Body">
4954 "TableCode">resource_outputext
</em>
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
4969 <td rowspan=
"1" colspan=
"1">
4970 <p class=
"Tbl-Body">
4972 "TableCode">documentation_outputext
</em>
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
4987 <td rowspan=
"1" colspan=
"1">
4988 <p class=
"Tbl-Body">
4990 "TableCode">generic_outputext
</em>
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.
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 “automatic
” 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.
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.
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">
5035 </em>, you can represent them with the
<em class=
5036 "Code">>></em> construct.
5040 Below is an example that demonstrates the use
5041 of
<em class=
"Code">>></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>.
5049 <p class=
"Code">project {
</p>
5051 <p class=
"Code"> Define_Custom(Quogen) {
</p>
5053 <p class=
"Code"> automatic_in =
0</p>
5055 <p class=
"Code"> automatic_out =
0</p>
5057 <p class=
"Code"> command = perl quogen.pl
</p>
5060 commandflags = --debuglevel=
1
5065 --kernel_language=c++
5068 <p class=
"Code"> inputext = .prp
</p>
5071 keyword quogenflags =
5075 <p class=
"Code"> }
</p>
5077 <p class=
"Code"> </p>
5079 <p class=
"Code"> Quogen_Files {
</p>
5082 foo.prp
>>
5086 <p class=
"Code"> }
</p>
5088 <p class=
"Code"> </p>
5090 <p class=
"Code"> Source_Files {
</p>
5092 <p class=
"Code"> hello.cpp
</p>
5094 <p class=
"Code"> }
</p>
5096 <p class=
"Code">}
</p>
5098 <p class=
"Code"> </p>
5102 You can use the
<em class=
"Code"><<</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"><<</em> foo.in as shown below.
5111 <p class=
"Code">Quogen_Files {
</p>
5114 foo.prp
>> hello.h
5115 hello.cpp
<< foo.in
5118 <p class=
"Code">}
</p>
5120 <p class=
"Code"> </p>
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
5134 <p class=
"Code">project {
</p>
5136 <p class=
"Code"> Define_Custom(TEST) {
</p>
5139 optional(keyword)
5144 flag_keyword(option) +=
5148 <p class=
"Code"> }
</p>
5150 <p class=
"Code"> }
</p>
5152 <p class=
"Code">}
</p>
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 (!).
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.
5187 <p class=
"Code">Define_Custom(IDL) {
</p>
5189 <p class=
"Code"> ...
</p>
5191 <p class=
"Code"> inputext = .idl
</p>
5193 <p class=
"Code"> source_pre_extension = C, S
</p>
5195 <p class=
"Code"> header_pre_extension = C, S
</p>
5197 <p class=
"Code"> inline_pre_extension = C, S
</p>
5200 source_outputext = .cpp, .cxx,
5205 header_outputext = .h, .hpp,
5209 <p class=
"Code"> inline_outputext = .inl, .i
</p>
5212 keyword idlflags =
5216 <p class=
"Code"> </p>
5219 optional(source_pre_extension)
5224 commandflags(-GA) +=
5228 <p class=
"Code"> }
</p>
5231 optional(template_outputext)
5236 commandflags(!-Sc) +=
5237 S_T.cpp, S_T.cxx, S_T.cc, S_T.C
5240 <p class=
"Code"> }
</p>
5243 optional(header_pre_extension)
5248 commandflags(!-Sc) +=
5252 <p class=
"Code"> }
</p>
5255 optional(inline_pre_extension)
5260 commandflags(!-Sc) +=
5264 <p class=
"Code"> }
</p>
5266 <p class=
"Code">}
</p>
5268 <p class=
"Code"> </p>
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>.
5282 The
<em class=
"Code">recurse
</em> keyword
5283 works as described in
<a href=
"MakeProjectCreator.html#82186"
5284 class=
"XRef">Assignment Keywords
</a>.
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.
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:
5305 <p class=
"Code">MOC_Files {
</p>
5307 <p class=
"Code"> commandflags += -nw
</p>
5309 <p class=
"Code"> gendir = moc_generated
</p>
5311 <p class=
"Code"> QtReactor.h
</p>
5313 <p class=
"Code">}
</p>
5315 <p class=
"Code"> </p>
5317 <p class=
"Code">Source_Files {
</p>
5320 moc_generated/QtReactor_moc.cpp
5323 <p class=
"Code">}
</p>
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.
5344 <h6 class=
"Head6">Modify_Custom
</h6>
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>
5363 <p class=
"Code">project: taoidldefaults {
</p>
5365 <p class=
"Code"> specific(!automake) {
</p>
5368 tao_idlflags += -Sc
5369 -hs _s.h -si _s.i -ss _s.cpp -hc .h -ci .i -cs .cpp
5372 <p class=
"Code"> }
</p>
5374 <p class=
"Code"> </p>
5377 // This allows
"make idl_stubs"
5381 <p class=
"Code"> verbatim(gnuace, macros) {
</p>
5384 IDL_CLIENT_HDR_EXT
5389 IDL_CLIENT_INL_EXT
5394 IDL_CLIENT_SRC_EXT
5399 IDL_SERVER_HDR_EXT
5404 IDL_SERVER_INL_EXT
5409 IDL_SERVER_SRC_EXT
5413 <p class=
"Code"> }
</p>
5415 <p class=
"Code"> </p>
5417 <p class=
"Code"> Modify_Custom(IDL) {
</p>
5420 source_pre_extension = , _s
5424 header_pre_extension = , _s
5428 inline_pre_extension = , _s
5432 inline_outputext
5433 = .i
5436 <p class=
"Code"> }
</p>
5438 <p class=
"Code">}
</p>
5444 <h6 class=
"Head6">Custom Post Command
</h6>
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"><%
</em> and
<em class=
5455 "Code">%
></em> are part of the syntax.
5458 <p style=
"list-style: none">
5459 <h6 class=
"NumberedTableTitle">
5464 <table border=
"1" summary=
"Post Command Pseudo Variables">
5466 <th rowspan=
"1" colspan=
"1">
5467 <p class=
"Tbl-Heading">Variable
</p>
5470 <th rowspan=
"1" colspan=
"1">
5471 <p class=
"Tbl-Heading">Description
</p>
5476 <td rowspan=
"1" colspan=
"1">
5479 "TableCode"><%input%
></em>
5483 <td rowspan=
"1" colspan=
"1">
5484 <p class=
"Tbl-Body">
5485 The input file to the
5492 <td rowspan=
"1" colspan=
"1">
5495 "TableCode"><%input_basename%
></em>
5499 <td rowspan=
"1" colspan=
"1">
5500 <p class=
"Tbl-Body">
5501 The basename of the input file to
5508 <td rowspan=
"1" colspan=
"1">
5511 "TableCode"><%input_dirname%
></em>
5515 <td rowspan=
"1" colspan=
"1">
5516 <p class=
"Tbl-Body">
5517 The directory name of the input
5518 file to the command.
5524 <td rowspan=
"1" colspan=
"1">
5527 "TableCode"><%input_noext%
></em>
5531 <td rowspan=
"1" colspan=
"1">
5532 <p class=
"Tbl-Body">
5533 The input file to the command
5534 with the extension stripped off.
5540 <td rowspan=
"1" colspan=
"1">
5543 "TableCode"><%input_ext%
></em>
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).
5556 <td rowspan=
"1" colspan=
"1">
5559 "TableCode"><%output%
></em>
5563 <td rowspan=
"1" colspan=
"1">
5564 <p class=
"Tbl-Body">
5565 The output file created by the
5572 <td rowspan=
"1" colspan=
"1">
5575 "TableCode"><%output_basename%
></em>
5579 <td rowspan=
"1" colspan=
"1">
5580 <p class=
"Tbl-Body">
5581 The basename of the output file
5588 <td rowspan=
"1" colspan=
"1">
5591 "TableCode"><%output_dirname%
></em>
5595 <td rowspan=
"1" colspan=
"1">
5596 <p class=
"Tbl-Body">
5597 The directory name of the output
5598 file to the command.
5604 <td rowspan=
"1" colspan=
"1">
5607 "TableCode"><%output_noext%
></em>
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.
5620 <td rowspan=
"1" colspan=
"1">
5623 "TableCode"><%output_ext%
></em>
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).
5636 <td rowspan=
"1" colspan=
"2">
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.
5648 <td rowspan=
"1" colspan=
"1">
5651 "TableCode"><%documentation_file%
></em>
5655 <td rowspan=
"1" colspan=
"1">
5656 <p class=
"Tbl-Body">
5657 The output file if it is a
5664 <td rowspan=
"1" colspan=
"1">
5667 "TableCode"><%header_file%
></em>
5671 <td rowspan=
"1" colspan=
"1">
5672 <p class=
"Tbl-Body">
5673 The output file if it has a
5674 header file extension.
5680 <td rowspan=
"1" colspan=
"1">
5683 "TableCode"><%inline_file%
></em>
5687 <td rowspan=
"1" colspan=
"1">
5688 <p class=
"Tbl-Body">
5689 The output file if it has an
5690 inline file extension.
5696 <td rowspan=
"1" colspan=
"1">
5699 "TableCode"><%resource_file%
></em> (
<em class=
5700 "TableCode"><%resx_file%
></em> for C# and
5705 <td rowspan=
"1" colspan=
"1">
5706 <p class=
"Tbl-Body">
5707 The output file if it has a
5708 resource file extension.
5714 <td rowspan=
"1" colspan=
"1">
5717 "TableCode"><%source_file%
></em>
5721 <td rowspan=
"1" colspan=
"1">
5722 <p class=
"Tbl-Body">
5723 The output file if it has a
5724 source file extension.
5730 <td rowspan=
"1" colspan=
"1">
5733 "TableCode"><%template_file%
></em>
5737 <td rowspan=
"1" colspan=
"1">
5738 <p class=
"Tbl-Body">
5739 The output file if it is a
5746 <td rowspan=
"1" colspan=
"1">
5749 "TableCode"><%documentation_file_noext%
></em>
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.
5762 <td rowspan=
"1" colspan=
"1">
5765 "TableCode"><%header_file_noext%
></em>
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.
5778 <td rowspan=
"1" colspan=
"1">
5781 "TableCode"><%inline_file_noext%
></em>
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.
5794 <td rowspan=
"1" colspan=
"1">
5797 "TableCode"><%resource_file_noext%
></em>
5798 (
<em class=
"TableCode"><%resx_file_noext%
></em>
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.
5812 <td rowspan=
"1" colspan=
"1">
5815 "TableCode"><%source_file_noext%
></em>
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.
5828 <td rowspan=
"1" colspan=
"1">
5831 "TableCode"><%template_file_noext%
></em>
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.
5844 <td rowspan=
"1" colspan=
"2">
5846 The extensions of the input and
5847 output files are also available as pseudo
5854 <td rowspan=
"1" colspan=
"1">
5857 "TableCode"><%input_ext%
></em>
5861 <td rowspan=
"1" colspan=
"1">
5862 <p class=
"Tbl-Body">
5863 The extension of the input file
5870 <td rowspan=
"1" colspan=
"1">
5873 "TableCode"><%output_ext%
></em>
5877 <td rowspan=
"1" colspan=
"1">
5878 <p class=
"Tbl-Body">
5879 The extension of the output file
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.
5898 <p style=
"list-style: none">
5899 <h6 class=
"NumberedTableTitle">
5901 "Common_Pseudo_Variables"></a>Common Pseudo Variables
5904 <table border=
"1" summary=
"Common Pseudo Variables">
5906 <th rowspan=
"1" colspan=
"1">
5907 <p class=
"Tbl-Heading">Variable
</p>
5910 <th rowspan=
"1" colspan=
"1">
5911 <p class=
"Tbl-Heading">Description
</p>
5916 <td rowspan=
"1" colspan=
"1">
5919 "TableCode"><%and%
></em>
5923 <td rowspan=
"1" colspan=
"1">
5924 <p class=
"Tbl-Body">
5925 A platform and project
5926 non-specific representation of a command conditional
5933 <td rowspan=
"1" colspan=
"1">
5936 "TableCode"><%cat%
></em>
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.
5949 <td rowspan=
"1" colspan=
"1">
5952 "TableCode"><%cmdsep%
></em>
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"><%cat%
></em> and
<em class=
5963 "Code"><%mv%
></em> commands would be run.
5965 <%cat%
> <%source_file%
>
5966 <%gt%
> foo
<%cmdsep%
> <%mv%
> foo
5974 <td rowspan=
"1" colspan=
"1">
5977 "TableCode"><%cmp%
></em>
5981 <td rowspan=
"1" colspan=
"1">
5982 <p class=
"Tbl-Body">
5983 A platform non-specific command
5984 to compare two files.
5990 <td rowspan=
"1" colspan=
"1">
5993 "TableCode"><%cp%
></em>
5997 <td rowspan=
"1" colspan=
"1">
5998 <p class=
"Tbl-Body">
5999 A platform non-specific command
6006 <td rowspan=
"1" colspan=
"1">
6009 "TableCode"><%crlf%
></em>
6013 <td rowspan=
"1" colspan=
"1">
6014 <p class=
"Tbl-Body">
6015 A platform non-specific line
6022 <td rowspan=
"1" colspan=
"1">
6025 "TableCode"><%equote%
></em>
6029 <td rowspan=
"1" colspan=
"1">
6030 <p class=
"Tbl-Body">
6031 A project non-specific escaped
6038 <td rowspan=
"1" colspan=
"1">
6041 "TableCode"><%gendir%
></em>
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>
6058 <td rowspan=
"1" colspan=
"1">
6061 "TableCode"><%gt%
></em>
6065 <td rowspan=
"1" colspan=
"1">
6066 <p class=
"Tbl-Body">
6067 A platform and project
6068 non-specific representation of a greater than
6075 <td rowspan=
"1" colspan=
"1">
6078 "TableCode"><%lt%
></em>
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.
6091 <td rowspan=
"1" colspan=
"1">
6094 "TableCode"><%mkdir%
></em>
6098 <td rowspan=
"1" colspan=
"1">
6099 <p class=
"Tbl-Body">
6100 A platform non-specific command
6101 to make a directory.
6107 <td rowspan=
"1" colspan=
"1">
6110 "TableCode"><%mv%
></em>
6114 <td rowspan=
"1" colspan=
"1">
6115 <p class=
"Tbl-Body">
6116 A platform non-specific command
6123 <td rowspan=
"1" colspan=
"1">
6126 "TableCode"><%nul%
></em>
6130 <td rowspan=
"1" colspan=
"1">
6131 <p class=
"Tbl-Body">
6132 A platform non-specific null
6139 <td rowspan=
"1" colspan=
"1">
6142 "TableCode"><%pathsep%
></em>
6146 <td rowspan=
"1" colspan=
"1">
6147 <p class=
"Tbl-Body">
6148 A platform non-specific path
6155 <td rowspan=
"1" colspan=
"1">
6158 "TableCode"><%or%
></em>
6162 <td rowspan=
"1" colspan=
"1">
6163 <p class=
"Tbl-Body">
6164 A platform and project
6165 non-specific representation of a command conditional
6172 <td rowspan=
"1" colspan=
"1">
6175 "TableCode"><%os%
></em>
6179 <td rowspan=
"1" colspan=
"1">
6180 <p class=
"Tbl-Body">Returns either win32 or unix.
</p>
6185 <td rowspan=
"1" colspan=
"1">
6188 "TableCode"><%prj_type%
></em>
6192 <td rowspan=
"1" colspan=
"1">
6193 <p class=
"Tbl-Body">
6194 The project type as supplied
6195 by the -type command line option.
6201 <td rowspan=
"1" colspan=
"1">
6204 "TableCode"><%quote%
></em>
6208 <td rowspan=
"1" colspan=
"1">
6209 <p class=
"Tbl-Body">
6210 A project non-specific
6211 representation of a double quote.
6217 <td rowspan=
"1" colspan=
"1">
6220 "TableCode"><%rm%
></em>
6224 <td rowspan=
"1" colspan=
"1">
6225 <p class=
"Tbl-Body">
6226 A platform non-specific command
6233 <td rowspan=
"1" colspan=
"1">
6236 "TableCode"><%rmdir%
></em>
6240 <td rowspan=
"1" colspan=
"1">
6241 <p class=
"Tbl-Body">
6242 A platform non-specific recursive
6243 directory delete command.
6249 <td rowspan=
"1" colspan=
"1">
6252 "TableCode"><%slash%
></em>
6256 <td rowspan=
"1" colspan=
"1">
6257 <p class=
"Tbl-Body">
6258 A platform non-specific directory
6265 <td rowspan=
"1" colspan=
"1">
6268 "TableCode"><%temporary%
></em>
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
6283 <td rowspan=
"1" colspan=
"2">
6285 The following variables will
6286 be set to the known extension for Windows based
6287 project types and empty on non-Windows based
6294 <td rowspan=
"1" colspan=
"1">
6297 "TableCode"><%bat%
></em>
6301 <td rowspan=
"1" colspan=
"1">
6302 <p class=
"Tbl-Body">
6303 The extension for batch
6310 <td rowspan=
"1" colspan=
"1">
6313 "TableCode"><%cmd%
></em>
6317 <td rowspan=
"1" colspan=
"1">
6318 <p class=
"Tbl-Body">
6319 The extension for command
6326 <td rowspan=
"1" colspan=
"1">
6329 "TableCode"><%exe%
></em>
6333 <td rowspan=
"1" colspan=
"1">
6334 <p class=
"Tbl-Body">
6335 The extension for executable
6348 <a name=
"TheFeatureFile" id=
"TheFeatureFile"></a>
6350 <h5 class=
"Head4">The Feature File
</h5>
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.
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.
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.
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.
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.
6392 The global feature file for MPC contains the
6398 <p class=
"Code">boost =
0</p>
6400 <p class=
"Code">bzip2 =
0</p>
6402 <p class=
"Code">erlang =
0</p>
6404 <p class=
"Code">java =
0</p>
6406 <p class=
"Code">mfc =
0</p>
6408 <p class=
"Code">libpng =
0</p>
6410 <p class=
"Code">openssl11 =
0</p>
6412 <p class=
"Code">python =
0</p>
6414 <p class=
"Code">qt =
0</p>
6416 <p class=
"Code">qt4 =
0</p>
6418 <p class=
"Code">qt5 =
0</p>
6420 <p class=
"Code">rpc =
0</p>
6422 <p class=
"Code">swig_java =
0</p>
6424 <p class=
"Code">swig_perl =
0</p>
6426 <p class=
"Code">swig_php =
0</p>
6428 <p class=
"Code">swig_python =
0</p>
6430 <p class=
"Code">swig_ruby =
0</p>
6432 <p class=
"Code">swig_tcl =
0</p>
6434 <p class=
"Code">uses_wchar =
0</p>
6436 <p class=
"Code">wireshark_any =
0</p>
6438 <p class=
"Code">wireshark =
0</p>
6440 <p class=
"Code">wireshark_cmake =
0</p>
6442 <p class=
"Code">xalanc =
0</p>
6444 <p class=
"Code">xerces =
0</p>
6446 <p class=
"Code">xerces2 =
0</p>
6448 <p class=
"Code">xerces3 =
0</p>
6450 <p class=
"Code">ziparchive =
0</p>
6452 <p class=
"Code">zlib =
0</p>
6454 <p class=
"Code">zzip =
0</p>
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:
6465 <p class=
"BodyNoLead">
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
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
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.
6489 Use the
<em class=
"Code">-features
</em> option to
6490 dynamically modify the feature settings.
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.
6506 <h5 class=
"Head4">Feature Projects
</h5>
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.
6517 A feature definition requires at least one
6518 feature name. A name by itself specifies that the feature must be
6519 enabled. A
’!
’ 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.
6525 The following example show how to declare a
6531 <p class=
"Code">// ziparchive.mpb
</p>
6533 <p class=
"Code">feature(ziparchive) {
</p>
6535 <p class=
"Code"> includes += $(ZIPARCHIVEROOT)
</p>
6538 libpaths +=
6539 $(ZIPARCHIVEROOT)/lib
6543 libs
+=
6547 <p class=
"Code">}
</p>
6549 <p class=
"Code"> </p>
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.
6563 <h4 class=
"Head3">Defaults
</h4>
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
6575 With the use of inheritance and proper code
6576 arrangement, an mpc file for a TAO related project may be as simple
6582 <p class=
"Code">project: taoserver {
</p>
6584 <p class=
"Code">}
</p>
6590 This project definition could be used to generate
6591 a project for a TAO server with multiple idl, header and source
6596 The idea of
<em class=
"Emphasis">proper
</em>
6597 source layout is basically summarized as
<em class=
"Emphasis">
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.
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.
6614 <h5 class=
"Head4">Source Files
</h5>
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.
6637 <h5 class=
"Head4">Template Files
</h5>
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.
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.
6667 <h5 class=
"Head4">Inline Files
</h5>
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.
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.
6692 <h5 class=
"Head4">Header Files
</h5>
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.
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.
6718 <h5 class=
"Head4">Documentation Files
</h5>
6720 <p class=
"BodyNoLead">
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=
6732 <h5 class=
"Head4">Resource Files
</h5>
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
6750 <h5 class=
"Head4">Custom Defined Files
</h5>
6753 <p class=
"BodyNoLead">
6754 The
<em class=
"Code">
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.
6772 <a name=
"ExampleMPCFile" id=
"ExampleMPCFile"></a>
6774 <h5 class=
"Head4">Example MPC File
</h5>
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:
6786 Auto_Disconnect.cpp Loopback_Supplier.h
6787 RTEC_Initializer.cpp
6791 Auto_Disconnect.h Low_Priority_Setup.cpp
6796 Auto_Disconnect.inl Low_Priority_Setup.h
6801 Auto_Functor.cpp Low_Priority_Setup.inl
6805 <p class=
"Code">Auto_Functor.h Makefile RTPOA_Setup.cpp
</p>
6808 Auto_Functor.inl ORB_Holder.cpp
6813 Client_Group.cpp ORB_Holder.h
6818 Client_Group.h ORB_Holder.inl
6823 Client_Group.inl ORB_Shutdown.cpp
6828 Client_Options.cpp ORB_Shutdown.h
6833 Client_Options.h ORB_Shutdown.inl
6838 Client_Pair.cpp ORB_Task_Activator.cpp
6843 Client_Pair.h ORB_Task_Activator.h
6844 Send_Task_Stopper.cpp
6848 Client_Pair.inl ORB_Task_Activator.inl
6853 Consumer.cpp ORB_Task.cpp
6854 Send_Task_Stopper.inl
6857 <p class=
"Code">Consumer.h ORB_Task.h Servant_var.cpp
</p>
6859 <p class=
"Code">Control.cpp ORB_Task.inl Servant_var.h
</p>
6861 <p class=
"Code">Control.h Peer_Base.cpp Servant_var.inl
</p>
6863 <p class=
"Code">EC_Destroyer.cpp Peer_Base.h Shutdown.cpp
</p>
6866 EC_Destroyer.h PriorityBand_Setup.cpp
6871 EC_Destroyer.inl PriorityBand_Setup.h
6876 Federated_Test.idl PriorityBand_Setup.inl
6881 Implicit_Deactivator.cpp RIR_Narrow.cpp
6886 Implicit_Deactivator.h RIR_Narrow.h
6891 Implicit_Deactivator.inl RT_Class.cpp
6896 Loopback_Consumer.cpp RT_Class.h
6901 Loopback_Consumer.h RT_Class.inl
6906 Loopback.cpp RTClient_Setup.cpp
6911 Loopback.h RTClient_Setup.h
6916 Loopback_Pair.cpp RTClient_Setup.inl
6921 Loopback_Pair.h RTCORBA_Setup.cpp
6925 <p class=
"Code">Loopback_Pair.inl RTCORBA_Setup.h
</p>
6927 <p class=
"Code">Loopback_Supplier.cpp RTCORBA_Setup.inl
</p>
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.
6940 project(RTEC_Perf): strategies, rtcorbaevent,
6944 <p class=
"Code"> sharedname = TAO_RTEC_Perf
</p>
6947 idlflags +=
6948 -Wb,export_macro=TAO_RTEC_Perf_Export \
6952 -Wb,export_include=rtec_perf_export.h
6956 dllflags +=
6957 TAO_RTEC_PERF_BUILD_DLL
6960 <p class=
"Code"> </p>
6962 <p class=
"Code"> Template_Files {
</p>
6964 <p class=
"Code"> Auto_Disconnect.cpp
</p>
6966 <p class=
"Code"> Auto_Functor.cpp
</p>
6969 Low_Priority_Setup.cpp
6972 <p class=
"Code"> RIR_Narrow.cpp
</p>
6974 <p class=
"Code"> Servant_var.cpp
</p>
6976 <p class=
"Code"> Shutdown.cpp
</p>
6978 <p class=
"Code"> Task_Activator.cpp
</p>
6980 <p class=
"Code"> }
</p>
6982 <p class=
"Code">}
</p>
6988 A line-by-line explanation of the example mpc
6989 file is listed below.
6995 project(RTEC_Perf): strategies, rtcorbaevent,
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.
7010 <p class=
"Code">sharedname = TAO_RTEC_Perf
</p>
7016 Line two determines that the project is a
7017 library and the library name is
<em class=
7018 "Code">TAO_RTEC_Perf
</em>.
7025 -Wb,export_macro=TAO_RTEC_Perf_Export \
7028 <p class=
"Code">-Wb,export_include=rtec_perf_export.h
</p>
7034 Lines three and four add to the flags passed to
7035 the IDL compiler when processing the idl files.
7040 <p class=
"Code">dllflags += TAO_RTEC_PERF_BUILD_DLL
</p>
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
7056 <p class=
"Code">Template_Files {
</p>
7058 <p class=
"Code"> Auto_Disconnect.cpp
</p>
7060 <p class=
"Code"> Auto_Functor.cpp
</p>
7062 <p class=
"Code"> Low_Priority_Setup.cpp
</p>
7064 <p class=
"Code"> RIR_Narrow.cpp
</p>
7066 <p class=
"Code"> Servant_var.cpp
</p>
7068 <p class=
"Code"> Shutdown.cpp
</p>
7070 <p class=
"Code"> Task_Activator.cpp
</p>
7072 <p class=
"Code">}
</p>
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.
7086 You may have noticed that there isn
’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.
7105 <h3 class=
"Head2">Adding a New Type
</h3>
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
7118 <h4 class=
"Head3">Input File Syntax
</h4>
7120 <p class=
"BodyNoLead">
7121 This section describes the syntax of the
7122 files that are used during project generation.
7128 <a name=
"MPD_Syntax"></a>Template Files
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.
7140 Template directives are declared using a
7141 <em class=
"Code"><% %
></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"><% %
></em> is left
7145 untouched and is passed directly into the generated project
7150 An
<em class=
"Code">if
</em> statement can appear
7151 on a single line or it can span multiple lines. For example, the
7158 <%if(exename)%
>BIN =
7159 <%exename%
><%else%
>LIB =
7160 <%sharedname%
><%endif%
>
7167 is equivalent to:
</li>
7171 <p class=
"Code"><%if(exename)%
></p>
7173 <p class=
"Code">BIN =
<%exename%
></p>
7175 <p class=
"Code"><%else%
></p>
7177 <p class=
"Code">LIB =
<%sharedname%
></p>
7179 <p class=
"Code"><%endif%
></p>
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.
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
7202 FILES=
<%foreach(fvar, idl_files source_files
7203 header_files)%
> <%fvar%
><%endfor%
>
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
’<em class=
"Code">s
</em> ’ removed.
7220 FILES=
<%foreach(idl_files source_files
7221 header_files)%
> <%idl_file%
><%endfor%
>
7228 Note that the
<em class=
7229 "Code"><%idl_file%
></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
’<em class=
7234 "Code">s
</em> ’, the variable of the same name within the
7235 <em class=
"Code">foreach
</em> will contain each individual value,
7242 <%foreach(filelist)%
>
7243 <%filelist%
><%endfor%
>
7250 The following table lists keywords that can
7251 appear in template files.
7255 <a name=
"38037"></a>
7257 <h6 class=
"NumberedTableTitle">Template File Keywords
</h6>
7259 <table border=
"1" summary=
"Template File Keywords">
7261 <th rowspan=
"1" colspan=
"1">
7262 <p class=
"Tbl-Heading">Keyword
</p>
7265 <th rowspan=
"1" colspan=
"1">
7266 <p class=
"Tbl-Heading">Description
</p>
7271 <td rowspan=
"1" colspan=
"1">
7272 <p class=
"Tbl-Body">
7274 "TableCode">basename
</em>
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.
7287 <td rowspan=
"1" colspan=
"1">
7288 <p class=
"Tbl-Body">
7290 "TableCode">basenoextension
</em>
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.
7304 <td rowspan=
"1" colspan=
"1">
7305 <p class=
"Tbl-Body">
7307 "TableCode">comment
</em>
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.
7321 <td rowspan=
"1" colspan=
"1">
7322 <p class=
"Tbl-Body">
7324 "TableCode">compares
</em>
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).
7338 <td rowspan=
"1" colspan=
"1">
7339 <p class=
"Tbl-Body">
7341 "TableCode">contains
</em>
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).
7355 <td rowspan=
"1" colspan=
"1">
7356 <p class=
"Tbl-Body">
7358 "TableCode">deref
</em>
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.
7372 <td rowspan=
"1" colspan=
"1">
7373 <p class=
"Tbl-Body">
7375 "TableCode">dirname
</em>
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
7389 <td rowspan=
"1" colspan=
"1">
7390 <p class=
"Tbl-Body">
7392 "TableCode">duplicate_index
</em>
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
7408 <td rowspan=
"1" colspan=
"1">
7409 <p class=
"Tbl-Body">
7410 <em class=
"TableCode">else
</em>
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
7425 <td rowspan=
"1" colspan=
"1">
7426 <p class=
"Tbl-Body">
7427 <em class=
"TableCode">endfor
</em>
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.
7441 <td rowspan=
"1" colspan=
"1">
7442 <p class=
"Tbl-Body">
7443 <em class=
"TableCode">endif
</em>
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>
7458 <td rowspan=
"1" colspan=
"1">
7459 <p class=
"Tbl-Body">
7461 "TableCode">ends_with
</em>
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).
7475 <td rowspan=
"1" colspan=
"1">
7476 <p class=
"Tbl-Body">
7477 <em class=
"TableCode">eval
</em>
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.
7491 <td rowspan=
"1" colspan=
"1">
7492 <p class=
"Tbl-Body">
7494 "TableCode">extensions
</em>
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,
7508 <td rowspan=
"1" colspan=
"1">
7509 <p class=
"Tbl-Body">
7511 "TableCode">flag_overrides
</em>
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
7527 <td rowspan=
"1" colspan=
"1">
7528 <p class=
"Tbl-Body">
7530 "TableCode">foreach
</em>
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.
7543 <td rowspan=
"1" colspan=
"1">
7544 <p class=
"Tbl-Body">
7546 "TableCode">forfirst
</em>
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>.
7561 <td rowspan=
"1" colspan=
"1">
7562 <p class=
"Tbl-Body">
7564 "TableCode">forlast
</em>
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>.
7579 <td rowspan=
"1" colspan=
"1">
7580 <p class=
"Tbl-Body">
7582 "TableCode">fornotfirst
</em>
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
7598 <td rowspan=
"1" colspan=
"1">
7599 <p class=
"Tbl-Body">
7601 "TableCode">fornotlast
</em>
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
7617 <td rowspan=
"1" colspan=
"1">
7618 <p class=
"Tbl-Body">
7620 "TableCode">full_path
</em>
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.
7633 <td rowspan=
"1" colspan=
"1">
7634 <p class=
"Tbl-Body">
7636 "TableCode">has_extension
</em>
7640 <td rowspan=
"1" colspan=
"1">
7641 <p class=
"Tbl-Body">
7642 Returns true is the variable value
7643 has a file extension.
7649 <td rowspan=
"1" colspan=
"1">
7650 <p class=
"Tbl-Body">
7651 <em class=
"TableCode">if
</em>
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.
7669 <td rowspan=
"1" colspan=
"1">
7670 <p class=
"Tbl-Body">
7672 "TableCode">keyname_used
</em>
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.
7689 <td rowspan=
"1" colspan=
"1">
7690 <p class=
"Tbl-Body">
7691 <em class=
"TableCode">lc
</em>
7695 <td rowspan=
"1" colspan=
"1">
7696 <p class=
"Tbl-Body">
7697 Return the given variable value in
7698 all lower case characters.
7704 <td rowspan=
"1" colspan=
"1">
7705 <p class=
"Tbl-Body">
7706 <em class=
"TableCode">marker
</em>
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"><%marker(local)%
></em>.
7722 <td rowspan=
"1" colspan=
"1">
7723 <p class=
"Tbl-Body">
7725 "TableCode">multiple
</em>
7729 <td rowspan=
"1" colspan=
"1">
7730 <p class=
"Tbl-Body">
7731 This function returns true if the
7732 array parameter contains multiple values.
7738 <td rowspan=
"1" colspan=
"1">
7739 <p class=
"Tbl-Body">
7741 "TableCode">noextension
</em>
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.
7755 <td rowspan=
"1" colspan=
"1">
7756 <p class=
"Tbl-Body">
7758 "TableCode">normalize
</em>
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.
7772 <td rowspan=
"1" colspan=
"1">
7773 <p class=
"Tbl-Body">
7775 "TableCode">remove_from
</em>
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
7802 <td rowspan=
"1" colspan=
"1">
7803 <p class=
"Tbl-Body">
7805 "TableCode">reverse
</em>
7809 <td rowspan=
"1" colspan=
"1">
7810 <p class=
"Tbl-Body">
7811 This function reverses the order of
7812 the array parameter values.
7818 <td rowspan=
"1" colspan=
"1">
7819 <p class=
"Tbl-Body">
7820 <em class=
"TableCode">scope
</em>
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".
7841 <td rowspan=
"1" colspan=
"1">
7842 <p class=
"Tbl-Body">
7843 <em class=
"TableCode">set
</em>
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.
7858 <td rowspan=
"1" colspan=
"1">
7859 <p class=
"Tbl-Body">
7860 <em class=
"TableCode">sort
</em>
7864 <td rowspan=
"1" colspan=
"1">
7865 <p class=
"Tbl-Body">
7866 This function sorts the array
7873 <td rowspan=
"1" colspan=
"1">
7874 <p class=
"Tbl-Body">
7876 "TableCode">starts_with
</em>
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).
7890 <td rowspan=
"1" colspan=
"1">
7891 <p class=
"Tbl-Body">
7893 "TableCode">transdir
</em>
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".
7908 <td rowspan=
"1" colspan=
"1">
7909 <p class=
"Tbl-Body">
7910 <em class=
"TableCode">translate_vars
</em>
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.
7928 <td rowspan=
"1" colspan=
"1">
7929 <p class=
"Tbl-Body">
7930 <em class=
"TableCode">uc
</em>
7934 <td rowspan=
"1" colspan=
"1">
7935 <p class=
"Tbl-Body">
7936 Return the given variable value in
7937 all upper case characters.
7943 <td rowspan=
"1" colspan=
"1">
7944 <p class=
"Tbl-Body">
7945 <em class=
"TableCode">ucw
</em>
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.
7959 <td rowspan=
"1" colspan=
"1">
7960 <p class=
"Tbl-Body">
7961 <em class=
"TableCode">uniq
</em>
7965 <td rowspan=
"1" colspan=
"1">
7966 <p class=
"Tbl-Body">
7967 This function returns the unique set
7968 of the array parameter values.
7976 The following table lists special names that can
7977 be used as variables in some template files. The variables listed
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"><%temporary%
></em>).
7984 <p style=
"list-style: none">
7985 <h6 class=
"NumberedTableTitle">
7986 Special Values used in Template
7990 <table border=
"1" summary=
7991 "Special Values used in Template Files">
7993 <th rowspan=
"1" colspan=
"1">
7994 <p class=
"Tbl-Heading">Value
</p>
7997 <th rowspan=
"1" colspan=
"1">
7998 <p class=
"Tbl-Heading">Description
</p>
8003 <td rowspan=
"1" colspan=
"1">
8004 <p class=
"Tbl-Body">
8006 "TableCode">am_version
</em>
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
8021 <td rowspan=
"1" colspan=
"1">
8022 <p class=
"Tbl-Body">
8023 <em class=
"TableCode">ciao
</em>
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.
8036 <td rowspan=
"1" colspan=
"1">
8037 <p class=
"Tbl-Body">
8039 "TableCode">compilers
</em>
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.
8053 <td rowspan=
"1" colspan=
"1">
8054 <p class=
"Tbl-Body">
8055 <em class=
"TableCode">cppdir
</em>
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.
8070 <td rowspan=
"1" colspan=
"1">
8071 <p class=
"Tbl-Body">
8073 "TableCode">custom_types
</em>
8077 <td rowspan=
"1" colspan=
"1">
8078 <p class=
"Tbl-Body">
8079 Contains a list of the custom build
8081 "MakeProjectCreator.html#Custom_Types" class=
8082 "XRef">Custom Types
</a> for more details.
8088 <td rowspan=
"1" colspan=
"1">
8089 <p class=
"Tbl-Body">
8090 <em class=
"TableCode">cwd
</em>
8094 <td rowspan=
"1" colspan=
"1">
8095 <p class=
"Tbl-Body">
8096 The full current working
8103 <td rowspan=
"1" colspan=
"1">
8104 <p class=
"Tbl-Body">
8106 "TableCode">forcount
</em>
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>.
8121 <td rowspan=
"1" colspan=
"1">
8122 <p class=
"Tbl-Body">
8123 <em class=
"TableCode">guid
</em>
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
8139 <td rowspan=
"1" colspan=
"1">
8140 <p class=
"Tbl-Body">
8142 "TableCode">language
</em>
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.
8156 <td rowspan=
"1" colspan=
"1">
8157 <p class=
"Tbl-Body">
8159 "TableCode">make_file_name
</em>
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.
8174 <td rowspan=
"1" colspan=
"1">
8175 <p class=
"Tbl-Body">
8177 "TableCode">project_file
</em>
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
8191 <td rowspan=
"1" colspan=
"1">
8192 <p class=
"Tbl-Body">
8194 "TableCode">project_name
</em>
8198 <td rowspan=
"1" colspan=
"1">
8199 <p class=
"Tbl-Body">
8200 This variable contains the name of
8201 the current project being generated.
8207 <td rowspan=
"1" colspan=
"1">
8208 <p class=
"Tbl-Body">
8209 <em class=
"TableCode">rcdir
</em>
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.
8224 <td rowspan=
"1" colspan=
"1">
8225 <p class=
"Tbl-Body">
8227 "TableCode">source_directory
</em>
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
8244 <td rowspan=
"1" colspan=
"1">
8245 <p class=
"Tbl-Body">
8246 <em class=
"TableCode">tao
</em>
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.
8259 <td rowspan=
"1" colspan=
"1">
8260 <p class=
"Tbl-Body">
8262 "TableCode">vcversion
</em>
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.
8280 <td rowspan=
"1" colspan=
"1">
8281 <p class=
"Tbl-Body">
8282 <em class=
"TableCode">vpath
</em>
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.
8302 <a name=
"Document_Template_Script"></a>
8303 Template Variable Documentation
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.
8320 The script will generate documentation for an
8321 individual template file. The usage is as follows:
8326 <p class=
"Code">document_template.pl v1.4
</p>
8329 Usage: document_template.pl
<template
>
8330 [
<outputfile
> [language]]
8333 <p class=
"Code"> </p>
8336 template
- .mpd file to document. Certain MPC types don't
8341
8342 in that case this argument can be the Perl module.
8346 outputfile
- This defaults to the name of the
8347 template file with the .mpd
8351
8352 extension replaced with
8353 '.html' If
<outputfile
> ends in '.txt',
8357
8358 the output is in text
8359 format similar to what is found in
8363
8364 .../docs/templates.
8368 language
- This defaults to
8369 the language for which the template is designed.
8373
8374 It can be any of the valid
8375 language settings for MPC:
8379
8380 cplusplus csharp java
8387 <a name=
"Custom_Types"></a>
8389 <h6 class=
"Head5">Custom Types
</h6>
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.
8401 A variety of information is available from
8402 each
<em class=
"Code">custom_type
</em> through the
<em class=
8403 "Code">-
></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.
8410 The input files associated with the custom
8411 type are accessed through
<em class=
8412 "Code">custom_type-
>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-
>input_file-
>output_files
</em>. The
8416 custom type fields are those listed in the
<a href=
8417 "MakeProjectCreator.html#32899" class=
"XRef">
8420 </a> table as well as those listed in the following
8424 <p style=
"list-style: none">
8425 <h6 class=
"NumberedTableTitle">Custom Type Fields
</h6>
8427 <table border=
"1" summary=
"Custom Type Fields">
8429 <th rowspan=
"1" colspan=
"1">
8430 <p class=
"Tbl-Heading">Value
</p>
8433 <th rowspan=
"1" colspan=
"1">
8434 <p class=
"Tbl-Heading">Description
</p>
8439 <td rowspan=
"1" colspan=
"1">
8440 <p class=
"Tbl-Body">
8442 "TableCode">dependencies
</em>
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.
8455 <td rowspan=
"1" colspan=
"1">
8456 <p class=
"Tbl-Body">
8458 "TableCode">gendir
</em>
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">
8479 <td rowspan=
"1" colspan=
"1">
8480 <p class=
"Tbl-Body">
8482 "TableCode">input_files
</em>
8486 <td rowspan=
"1" colspan=
"1">
8487 <p class=
"Tbl-Body">
8488 The input files associated with the
8495 <td rowspan=
"1" colspan=
"1">
8496 <p class=
"Tbl-Body">
8498 "TableCode">inputexts
</em>
8502 <td rowspan=
"1" colspan=
"1">
8503 <p class=
"Tbl-Body">
8504 The input file extensions
8505 associated with the custom type.
8511 <td rowspan=
"1" colspan=
"1">
8512 <p class=
"Tbl-Body">
8514 "TableCode">non_source_output_files
</em>
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
8528 <td rowspan=
"1" colspan=
"1">
8529 <p class=
"Tbl-Body">
8531 "TableCode">output_files
</em>
8535 <td rowspan=
"1" colspan=
"1">
8536 <p class=
"Tbl-Body">
8537 All output files generated from the
8544 <td rowspan=
"1" colspan=
"1">
8545 <p class=
"Tbl-Body">
8547 "TableCode">source_output_files
</em>
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
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>.
8575 <p class=
"Code"><%if(custom_types)%
></p>
8577 <p class=
"Code"><%foreach(custom_types)%
></p>
8580 <%foreach(custom_type-
>input_files)%
>
8584 <%foreach(custom_type-
>input_file-
>output_files)%
>
8588 <%custom_type-
>input_file-
>output_file%
>:
8589 <%custom_type-
>input_file%
>
8593 <%custom_type-
>command%
>
8594 <%custom_type-
>commandflags%
> $@
8597 <p class=
"Code"> </p>
8599 <p class=
"Code"><%endfor%
></p>
8601 <p class=
"Code"><%endfor%
></p>
8603 <p class=
"Code"><%endfor%
></p>
8605 <p class=
"Code"><%endif%
></p>
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-
>input_file-
>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"><%foreach%
></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-
>input_file-
></em>
8628 <p style=
"list-style: none">
8629 <h6 class=
"NumberedTableTitle">
8630 Custom Type Fields for Combined
8634 summary=
"Custom Type Fields for Combined Custom">
8636 <th rowspan=
"1" colspan=
"1">
8637 <p class=
"Tbl-Heading">Value
</p>
8640 <th rowspan=
"1" colspan=
"1">
8641 <p class=
"Tbl-Heading">Description
</p>
8646 <td rowspan=
"1" colspan=
"1">
8647 <p class=
"Tbl-Body">
8649 "TableCode">command
</em>
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>.
8662 <td rowspan=
"1" colspan=
"1">
8663 <p class=
"Tbl-Body">
8665 "TableCode">command-
>outopt
</em>
8669 <td rowspan=
"1" colspan=
"1">
8670 <p class=
"Tbl-Body">
8672 "TableCode">output_option
</em> for this particular
8673 command, taking into account the
8674 <em class=
"TableCode">flag_overrides
</em>.
8680 <td rowspan=
"1" colspan=
"1">
8681 <p class=
"Tbl-Body">
8683 "TableCode">command-
>outfile
</em>
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>).
8697 <td rowspan=
"1" colspan=
"1">
8698 <p class=
"Tbl-Body">
8700 "TableCode">command-
>flags
</em>
8704 <td rowspan=
"1" colspan=
"1">
8705 <p class=
"Tbl-Body">
8707 "TableCode">commandflags
</em> for this particular
8708 command, taking into account the
8709 <em class=
"TableCode">flag_overrides
</em>.
8715 <td rowspan=
"1" colspan=
"1">
8716 <p class=
"Tbl-Body">
8718 "TableCode">command-
>gdir
</em>
8722 <td rowspan=
"1" colspan=
"1">
8723 <p class=
"Tbl-Body">
8725 "TableCode">gendir
</em> for this particular
8732 <td rowspan=
"1" colspan=
"1">
8733 <p class=
"Tbl-Body">
8735 "TableCode">command-
>type
</em>
8739 <td rowspan=
"1" colspan=
"1">
8740 <p class=
"Tbl-Body">
8741 The original type of file for this command.
8753 <h6 class=
"Head5">Grouped Files
</h6>
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.
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.)
8773 <h6 class=
"NumberedTableTitle">Grouped Files Field Names
</h6>
8775 <table border=
"1" summary=
"Grouped Files Field Names">
8777 <th rowspan=
"1" colspan=
"1">
8778 <p class=
"Tbl-Heading">Field Name
</p>
8781 <th rowspan=
"1" colspan=
"1">
8782 <p class=
"Tbl-Heading">Description
</p>
8787 <td rowspan=
"1" colspan=
"1">
8788 <p class=
"Tbl-Body">
8790 "TableCode">files
</em>
8794 <td rowspan=
"1" colspan=
"1">
8795 <p class=
"Tbl-Body">
8796 The input files associated with the
8803 <td rowspan=
"1" colspan=
"1">
8804 <p class=
"Tbl-Body">
8806 "TableCode">component_name
</em>
8810 <td rowspan=
"1" colspan=
"1">
8811 <p class=
"Tbl-Body">
8812 The name of the set of multiple
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
8835 <p class=
"Code"><%if(grouped_source_files)%
></p>
8838 <%comment(Get back each set of grouped
8842 <p class=
"Code"><%foreach(grouped_source_files)%
></p>
8845 <%comment(This will provide the name of
8849 <p class=
"Code"><%grouped_source_file%
> = \
</p>
8852 <%comment(Get all the source files in a
8857 <%foreach(grouped_source_file-
>files)%
>
8861 <%grouped_source_file-
>file)%
><%fornotlast(
"
8865 <p class=
"Code"><%endfor%
></p>
8867 <p class=
"Code"><%endfor%
></p>
8869 <p class=
"Code"> </p>
8873 <%grouped_source_files-
>component_name%
>
8877 <%grouped_source_files-
>component_name%
> = \
8880 <p class=
"Code"><%foreach(grouped_source_files)%
></p>
8883 <%grouped_source_file%
><%fornotlast(
"
8887 <p class=
"Code"><%endfor%
></p>
8889 <p class=
"Code">endif
</p>
8891 <p class=
"Code"><%endif%
></p>
8893 <p class=
"Code"> </p>
8900 <h5 class=
"Head4">Template Input Files (mpt)
</h5>
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
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
8926 The template input files contain variable
8927 assignments and collections of variable assignments. A variable
8928 assignment is of the form:
8933 <p class=
"Code">variable_name = value1
"value 2"</p>
8935 <p class=
"Code">variable_name += another_value
</p>
8937 <p class=
"Code"> </p>
8941 This variable can then be used within the
8942 corresponding mpd file.
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.
8954 <p class=
"Code">// mpt file
</p>
8956 <p class=
"Code">configurations = Release Debug
</p>
8958 <p class=
"Code">common_defines = WIN32 _CONSOLE
</p>
8960 <p class=
"Code"> </p>
8962 <p class=
"Code">Release {
</p>
8965 compile_flags = /W3 /GX /O2 /MD
8969 <p class=
"Code"> defines = NDEBUG
</p>
8971 <p class=
"Code">}
</p>
8973 <p class=
"Code"> </p>
8975 <p class=
"Code">Debug {
</p>
8978 compile_flags = /W3 /Gm /GX /Zi /Od
8982 <p class=
"Code"> defines = _DEBUG
</p>
8984 <p class=
"Code">}
</p>
8986 <p class=
"Code"> </p>
8988 <p class=
"Code">conditional_include
"vcfullmacros"</p>
8990 <p class=
"Code"> </p>
8994 Below is the portion of the mpd file that would
8995 use the information provided in the mpt file above.
9000 <p class=
"Code"><%foreach(configurations)%
></p>
9002 <p class=
"Code">Name =
<%configuration%
></p>
9005 <%compile_flags%
><%foreach(defines
9006 common_defines)%
> /D
<%define%
>=
1<%endfor%
>
9009 <p class=
"Code"> </p>
9011 <p class=
"Code"><%endfor%
></p>
9017 The following output is generated from the above
9023 <p class=
"Code">Name = Release
</p>
9026 /W3 /GX /O2 /MD /GR /D NDEBUG=
1 /D WIN32=
1 /D
9030 <p class=
"Code"> </p>
9032 <p class=
"Code">Name = Debug
</p>
9035 /W3 /Gm /GX /Zi /Od /MDd /GR /Gy /D _DEBUG=
1 /D
9036 WIN32=
1 /D _CONSOLE=
1
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>.
9056 <h4 class=
"Head3">A Simple Example
</h4>
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
9069 <h5 class=
"Head4">Template
</h5>
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">
9081 </a> section. Here is our sample
<em class=
9082 "Code">fictional.mpd
</em>.
9087 //=======================================================================
9090 <p class=
"Code">// This project has been generated by MPC.
</p>
9093 // CAUTION! Hand edit only if you know what you
9098 //=======================================================================
9101 <p class=
"Code"> </p>
9103 <p class=
"Code">// Section
1 - PROJECT OPTIONS
</p>
9105 <p class=
"Code">ctags:*
</p>
9107 <p class=
"Code">debugSwitches:-nw
</p>
9109 <p class=
"Code">//end-proj-opts
</p>
9111 <p class=
"Code"> </p>
9113 <p class=
"Code">// Section
2 - MAKEFILE
</p>
9115 <p class=
"Code">Makefile.
<%project_name%
></p>
9117 <p class=
"Code"> </p>
9119 <p class=
"Code">// Section
3 - OPTIONS
</p>
9121 <p class=
"Code">//end-options
</p>
9123 <p class=
"Code"> </p>
9125 <p class=
"Code">// Section
4 - TARGET FILE
</p>
9127 <p class=
"Code"><%if(exename)%
></p>
9129 <p class=
"Code"><%exename%
></p>
9131 <p class=
"Code"><%else%
></p>
9133 <p class=
"Code"><%if(sharedname)%
></p>
9135 <p class=
"Code"><%sharedname%
></p>
9137 <p class=
"Code"><%else%
></p>
9139 <p class=
"Code"><%if(staticname)%
></p>
9141 <p class=
"Code"><%staticname%
></p>
9143 <p class=
"Code"><%endif%
></p>
9145 <p class=
"Code"><%endif%
></p>
9147 <p class=
"Code"><%endif%
></p>
9149 <p class=
"Code"> </p>
9151 <p class=
"Code">// Section
5 - SOURCE FILES
</p>
9153 <p class=
"Code"><%foreach(source_files)%
></p>
9155 <p class=
"Code"><%source_file%
></p>
9157 <p class=
"Code"><%endfor%
></p>
9159 <p class=
"Code">//end-srcfiles
</p>
9161 <p class=
"Code"> </p>
9163 <p class=
"Code">// Section
6 - INCLUDE DIRECTORIES
</p>
9165 <p class=
"Code"><%foreach(includes)%
></p>
9167 <p class=
"Code"><%include%
></p>
9169 <p class=
"Code"><%endfor%
></p>
9171 <p class=
"Code">//end-include-dirs
</p>
9173 <p class=
"Code"> </p>
9175 <p class=
"Code">// Section
7 - LIBRARY DIRECTORIES
</p>
9177 <p class=
"Code"><%foreach(libpaths)%
></p>
9179 <p class=
"Code"><%libpath%
></p>
9181 <p class=
"Code"><%endfor%
></p>
9183 <p class=
"Code">//end-library-dirs
</p>
9185 <p class=
"Code"> </p>
9187 <p class=
"Code">// Section
8 - DEFINITIONS
</p>
9189 <p class=
"Code"><%foreach(macros defines)%
></p>
9191 <p class=
"Code">-D
<%macro%
></p>
9193 <p class=
"Code"><%endfor%
></p>
9195 <p class=
"Code"><%if(pch_header)%
></p>
9197 <p class=
"Code"><%foreach(pch_defines)%
></p>
9199 <p class=
"Code">-D
<%pch_define%
></p>
9201 <p class=
"Code"><%endfor%
></p>
9203 <p class=
"Code"><%endif%
></p>
9205 <p class=
"Code">//end-defs
</p>
9207 <p class=
"Code"> </p>
9209 <p class=
"Code">// Section
9 - C FLAGS
</p>
9211 <p class=
"Code"><%cflags(
"-g")%
></p>
9213 <p class=
"Code"> </p>
9215 <p class=
"Code">// Section
10 - LIBRARY FLAGS
</p>
9217 <p class=
"Code"><%libflags%
></p>
9219 <p class=
"Code"> </p>
9221 <p class=
"Code">// Section
11 - SRC DIRECTORY
</p>
9223 <p class=
"Code">.
</p>
9225 <p class=
"Code"> </p>
9227 <p class=
"Code">// Section
12 - OBJ DIRECTORY
</p>
9229 <p class=
"Code"><%objdir(
".")%
></p>
9231 <p class=
"Code"> </p>
9233 <p class=
"Code">// Section
13 - BIN DIRECTORY
</p>
9236 <%if(exeout)%
><%exeout%
><%else%
>.
<%endif%
>
9239 <p class=
"Code"> </p>
9242 // User targets section. Following lines will
9247 // inserted into Makefile right after the
9248 generated cleanall target.
9252 // The Project File editor does not edit these
9253 lines - edit the .vpj
9257 // directly. You should know what you are
9261 <p class=
"Code">// Section
14 - USER TARGETS
</p>
9263 <p class=
"Code"><%marker(top)%
></p>
9265 <p class=
"Code"><%marker(macros)%
></p>
9267 <p class=
"Code"><%marker(local)%
></p>
9269 <p class=
"Code"><%marker(bottom)%
></p>
9271 <p class=
"Code">//end-user-targets
</p>
9273 <p class=
"Code"> </p>
9275 <p class=
"Code">// Section
15 - LIBRARY FILES
</p>
9277 <p class=
"Code"><%foreach(libs lit_libs pure_libs)%
></p>
9279 <p class=
"Code"><%lib%
></p>
9281 <p class=
"Code"><%endfor%
></p>
9283 <p class=
"Code">//end-library-files
</p>
9289 Note that output is generated differently
9290 depending upon whether
<em class=
"Code"><%exename%
></em>,
9291 <em class=
"Code"><%sharedname%
></em> or
<em class=
9292 "Code"><%staticname%
></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.
9301 <h5 class=
"Head4">Project Creator
</h5>
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.
9315 <p class=
"Code">package FictionalProjectCreator;
</p>
9317 <p class=
"Code"> </p>
9321 ************************************************************
9324 <p class=
"Code"># Description : A Fictional Project Creator
</p>
9326 <p class=
"Code"># Author : Chad Elliott
</p>
9328 <p class=
"Code"># Create Date :
10/
01/
2004</p>
9332 ************************************************************
9335 <p class=
"Code"> </p>
9339 ************************************************************
9342 <p class=
"Code"># Pragmas
</p>
9346 ************************************************************
9349 <p class=
"Code"> </p>
9351 <p class=
"Code">use strict;
</p>
9353 <p class=
"Code"> </p>
9355 <p class=
"Code">use MakeProjectBase;
</p>
9357 <p class=
"Code">use ProjectCreator;
</p>
9359 <p class=
"Code"> </p>
9361 <p class=
"Code">use vars qw(@ISA);
</p>
9363 <p class=
"Code">@ISA = qw(MakeProjectBase ProjectCreator);
</p>
9365 <p class=
"Code"> </p>
9369 ************************************************************
9372 <p class=
"Code"># Subroutine Section
</p>
9376 ************************************************************
9379 <p class=
"Code"> </p>
9381 <p class=
"Code">sub convert_slashes {
</p>
9383 <p class=
"Code"> #my $self = shift;
</p>
9385 <p class=
"Code"> return
0;
</p>
9387 <p class=
"Code">}
</p>
9389 <p class=
"Code"> </p>
9391 <p class=
"Code"> </p>
9393 <p class=
"Code">sub project_file_extension {
</p>
9395 <p class=
"Code"> #my $self = shift;
</p>
9397 <p class=
"Code"> return '.fic';
</p>
9399 <p class=
"Code">}
</p>
9401 <p class=
"Code"> </p>
9403 <p class=
"Code"> </p>
9405 <p class=
"Code">sub get_dll_exe_template_input_file {
</p>
9407 <p class=
"Code"> #my $self = shift;
</p>
9409 <p class=
"Code"> return 'fictionalexe';
</p>
9411 <p class=
"Code">}
</p>
9413 <p class=
"Code"> </p>
9415 <p class=
"Code"> </p>
9417 <p class=
"Code">sub get_dll_template_input_file {
</p>
9419 <p class=
"Code"> #my $self = shift;
</p>
9421 <p class=
"Code"> return 'fictionaldll';
</p>
9423 <p class=
"Code">}
</p>
9425 <p class=
"Code"> </p>
9427 <p class=
"Code"> </p>
9429 <p class=
"Code">sub get_template {
</p>
9431 <p class=
"Code"> #my $self = shift;
</p>
9433 <p class=
"Code"> return 'fictional';
</p>
9435 <p class=
"Code">}
</p>
9437 <p class=
"Code"> </p>
9439 <p class=
"Code">1;
</p>
9441 <p class=
"Code"> </p>
9445 In our example, we inherit from the
9446 MakeProjectBase which provides some methods that are common to
9447 all
“make
” based project creators.
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
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.
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.
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.
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
“Virtual Methods To Be Overridden
”
9485 section of the
<em class=
"Code">Creator.pm
</em> and
<em class=
9486 "Code">ProjectCreator.pm
</em>.
9492 <h5 class=
"Head4">Workspace Creator
</h5>
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
9502 <p class=
"Code">package FictionalWorkspaceCreator;
</p>
9504 <p class=
"Code"> </p>
9508 ************************************************************
9512 # Description : A Fictional Workspace
9516 <p class=
"Code"># Author : Chad Elliott
</p>
9518 <p class=
"Code"># Create Date :
10/
01/
2004</p>
9522 ************************************************************
9525 <p class=
"Code"> </p>
9529 ************************************************************
9532 <p class=
"Code"># Pragmas
</p>
9536 ************************************************************
9539 <p class=
"Code"> </p>
9541 <p class=
"Code">use strict;
</p>
9543 <p class=
"Code"> </p>
9545 <p class=
"Code">use FictionalProjectCreator;
</p>
9547 <p class=
"Code">use WorkspaceCreator;
</p>
9549 <p class=
"Code"> </p>
9551 <p class=
"Code">use vars qw(@ISA);
</p>
9553 <p class=
"Code">@ISA = qw(WorkspaceCreator);
</p>
9555 <p class=
"Code"> </p>
9559 ************************************************************
9562 <p class=
"Code"># Subroutine Section
</p>
9566 ************************************************************
9569 <p class=
"Code"> </p>
9571 <p class=
"Code">sub workspace_file_name {
</p>
9573 <p class=
"Code"> my $self = shift;
</p>
9577 $self-
>get_modified_workspace_name($self-
>get_workspace_name(),
9581 <p class=
"Code">}
</p>
9583 <p class=
"Code"> </p>
9585 <p class=
"Code"> </p>
9587 <p class=
"Code">sub pre_workspace {
</p>
9589 <p class=
"Code"> my($self, $fh) = @_;
</p>
9591 <p class=
"Code"> my $crlf = $self-
>crlf();
</p>
9593 <p class=
"Code"> </p>
9596 print $fh '
<?xml
version=
"1.0"
9597 encoding=
"UTF-8"?
>', $crlf,
9601 '
<!--
9602 MPC Command --
>', $crlf,
9606 "<!--
9607 $0 @ARGV -->", $crlf;
9610 <p class=
"Code">}
</p>
9612 <p class=
"Code"> </p>
9614 <p class=
"Code"> </p>
9616 <p class=
"Code">sub write_comps {
</p>
9618 <p class=
"Code"> my($self, $fh) = @_;
</p>
9621 my $projects =
9622 $self-
>get_projects();
9626 my @list =
9627 $self-
>sort_dependencies($projects);
9630 <p class=
"Code"> my $crlf = $self-
>crlf();
</p>
9632 <p class=
"Code"> </p>
9635 print $fh '
<projects
>',
9639 <p class=
"Code"> foreach my $project (@list) {
</p>
9642 print $fh
" <project
9643 path=\"$project\
"/>$crlf";
9646 <p class=
"Code"> }
</p>
9649 print $fh
9650 "</projects>$crlf";
9653 <p class=
"Code">}
</p>
9655 <p class=
"Code"> </p>
9657 <p class=
"Code"> </p>
9659 <p class=
"Code">1;
</p>
9661 <p class=
"Code"> </p>
9663 <p class=
"Code"> </p>
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.
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.
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).