Subversion Repositories gelsvn

Rev

Rev 68 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68 Rev 71
1
The Makefile, Project and Workspace Creator.
1
The Makefile, Project and Workspace Creator.
2
Designed by Justin Michel (michel_j@ociweb.com) and Chad Elliott.
2
Designed by Justin Michel (michel_j@ociweb.com) and Chad Elliott.
3
Implemented by Chad Elliott (elliott_c@ociweb.com).
3
Implemented by Chad Elliott (elliott_c@ociweb.com).
4
 
4
 
5
 
-
 
6
A single tool (MPC) can be used to generate tool specific input (i.e.
5
A single tool (MPC) can be used to generate tool specific input (i.e.
7
Makefile, dsp, vcproj, etc).  The generator takes platform and building
6
Makefile, dsp, vcproj, etc).  The generator takes platform and building
8
tool generic files (mpc files) as input which describe basic information
7
tool generic files (mpc files) as input which describe basic information
9
needed to generate a "project" file for various build tools.  These tools
8
needed to generate a "project" file for various build tools.  These tools
10
include Make, NMake, Visual C++ 6, Visual C++ 7, etc.
9
include Make, NMake, Visual C++ 6, Visual C++ 7, etc.
11
 
10
 
12
One of the many unique and useful features of the Makefile, Project and
11
One of the many unique and useful features of the Makefile, Project and
13
Workspace Creator is that the project definition files can employ the idea
12
Workspace Creator is that the project definition files can employ the idea
14
of inheritance.  This feature allows a user to set up a basic base project
13
of inheritance.  This feature allows a user to set up a basic base project
15
(mpb file) that can contain information that is applicable to all
14
(mpb file) that can contain information that is applicable to all
16
sub-projects.  Things such as include paths, library paths and inter-project
15
sub-projects.  Things such as include paths, library paths and inter-project
17
dependencies could be described in this base project and any project that
16
dependencies could be described in this base project and any project that
18
inherits from it would contain this information as well.
17
inherits from it would contain this information as well.
19
 
18
 
20
Another set of files, known as template input files (mpd files), provides
19
Another set of files, known as template input files (mpd files), provides
21
the generator with the necessary information to fill platform and build
20
the generator with the necessary information to fill platform and build tool
22
tool specific information for dynamic and static library and binary
21
specific information for dynamic and static library and binary executable
23
executable projects.
22
projects.
24
 
23
 
25
Together, the generic input files and the template input files are applied
24
Together, the generic input files and the template input files are applied
26
toward a platform and build specific template (mpt file) to create the final
25
toward a platform and build specific template (mpd file) to create the final
27
product (a build tool specific input file).  These templates contain
26
product (a build tool specific input file).  These templates contain
28
"variables" that are filled in by the project creator with information
27
"variables" that are filled in by the project creator with information
29
gathered through the mpc and mpd files and possibly by default values set
28
gathered through the mpc and mpd files and possibly by default values set
30
within the template itself.
29
within the template itself.
31
 
30
 
32
Workspaces are defined by providing a list of mpc files in a single (mwc)
31
Workspaces are defined by providing a list of mpc files in a single (mwc)
33
file.  For each mpc file specified, the workspace creator (mwc.pl) calls
32
file.  For each mpc file specified, the workspace creator (mwc.pl) calls
34
upon the project creator to generate the project.  After all of the projects
33
upon the project creator to generate the project.  After all of the projects
35
are successfully generated, the tool specific workspace is generated
34
are successfully generated, the tool specific workspace is generated
36
containing the projects and any defined inter-project dependency information
35
containing the projects and any defined inter-project dependency information
37
(if supported by the build tool).  If no workspace files are provided to the
36
(if supported by the build tool).  If no workspace files are provided to the
38
workspace creator, then the current directory is traversed and any mpc files
37
workspace creator, then the current directory is traversed and any mpc files
39
located will be part of the workspace that is generated.
38
located will be part of the workspace that is generated.
40
 
39
 
41
 
40
 
42
Workspace Declarations
41
Workspace Declarations
43
----------------------
42
----------------------
44
 
43
 
45
workspace(workspace_name) {
44
workspace(workspace_name) {
46
  file.mpc
45
  file.mpc
47
  directory
46
  directory
48
  relative/path/to/another/mwc_file
47
  relative/path/to/another/mwc_file
49
}
48
}
50
 
49
 
51
Workspaces can contain individual mpc files, directories or other mwc files.
50
Workspaces can contain individual mpc files, directories or other mwc files.
52
In the case of a directory, the workspace creator will traverse it and use
51
In the case of a directory, the workspace creator will traverse it and use
53
any mpc files that are found.  If another workspace file is listed in the
52
any mpc files that are found.  If another workspace file is listed in the
54
workspace files, it will be aggregated into the workspace with paths relative
53
workspace files, it will be aggregated into the workspace with paths relative
55
to the directory in which the main workspace is found.  These "aggregated"
54
to the directory in which the main workspace is found.  These "aggregated"
56
workspaces should not inherit from any other base workspace.  The workspace
55
workspaces should not inherit from any other base workspace.  The workspace
57
files should have an 'mwc' extension.
56
files should have an 'mwc' extension.
58
 
57
 
59
You can exclude directories from a workspace using the 'exclude' scope
58
You can exclude directories from a workspace using the 'exclude' scope
60
operator:
59
operator:
61
 
60
 
62
workspace {
61
workspace {
63
  dir1
62
  dir1
64
  dir2
63
  dir2
65
 
64
 
66
  // exclude this_dir for all project types
65
  // exclude this_dir for all project types
67
  exclude {
66
  exclude {
68
    dir2/this_dir
67
    dir2/this_dir
69
  }
68
  }
70
 
69
 
71
  // exclude other_dir for vc6, vc71 and vc8 types
70
  // exclude other_dir for vc6, vc71 and vc8 types
72
  exclude(vc6, vc71, vc8) {
71
  exclude(vc6, vc71, vc8) {
73
    dir2/other_dir
72
    dir2/other_dir
74
  }
73
  }
75
 
74
 
76
  // exclude unix_only for every type except gnuace and make
75
  // exclude unix_only for every type except gnuace and make
77
  exclude(!gnuace, !make) {
76
  exclude(!gnuace, !make) {
78
    dir2/unix_only
77
    dir2/unix_only
79
  }
78
  }
80
 
79
 
81
  dir3
80
  dir3
82
}
81
}
83
 
82
 
84
 
83
 
85
Project Declarations
84
Project Declarations
86
--------------------
85
--------------------
87
 
86
 
88
project(project_name) : baseproject, anotherbaseproject {
87
project(project_name) : baseproject, anotherbaseproject {
89
  exename   = foo
88
  exename   = foo
90
  includes += "."
89
  includes += "."
91
  libpaths  = directory
90
  libpaths  = directory
92
 
91
 
93
  Source_Files {
92
  Source_Files {
94
    file1.cpp
93
    file1.cpp
95
    file2.cpp
94
    file2.cpp
96
    .
95
    .
97
    .
96
    .
98
    fileN.cpp
97
    fileN.cpp
99
  }
98
  }
100
 
99
 
101
  Header_Files {
100
  Header_Files {
102
    file1.h
101
    file1.h
103
    file2.h
102
    file2.h
104
    .
103
    .
105
    .
104
    .
106
    fileN.h
105
    fileN.h
107
  }
106
  }
108
}
107
}
109
 
108
 
110
 
109
 
111
When listing files within components (Source_Files, Header_Files, etc.), you
110
When listing files within components (Source_Files, Header_Files, etc.), you
112
can use wild cards (*?[]) to include groups of files as can be done in shells.
111
can use wild cards (*?[]) to include groups of files as can be done in shells.
113
You can exclude files by preceding the name (or wild card) with the '!', but
112
You can exclude files by preceding the name (or wild card) with the '!', but
114
this sort of exclusion only pertains to files that exist in the directory at
113
this sort of exclusion only pertains to files that exist in the directory at
115
the time of project generation.  There is an additional syntax similar to
114
the time of project generation.  There is an additional syntax similar to
116
the '!' ('^') which works the same as the '!' except that after all of the
115
the '!' ('^') which works the same as the '!' except that after all of the
117
source files are added to the list (after automatic custom generated files
116
source files are added to the list (after automatic custom generated files
118
are added) these files are explicitly removed from the list.
117
are added) these files are explicitly removed from the list.
119
 
118
 
120
The (project_name) part of the project declaration is optional.  If it is
119
The (project_name) part of the project declaration is optional.  If it is
121
left off, the project name will default to the name of the mpc file without
120
left off, the project name will default to the name of the mpc file without
122
the extension.  Inheritance is optional.
121
the extension.  Inheritance is optional.
123
 
122
 
124
If the project name or workspace name contains an asterisk (*) then the
123
If the project name or workspace name contains an asterisk (*) then the
125
default project (workspace) name will be used in its place.  For example, if
124
default project (workspace) name will be used in its place.  For example, if
126
the mpc file is named example.mpc and it contains the following:
125
the mpc file is named example.mpc and it contains the following:
127
 
126
 
128
project(*client) {
127
project(*client) {
129
 
128
 
130
The project name will be example_client.  If the any part of the modified
129
The project name will be example_client.  If the any part of the modified
131
project (workspace) name contains a capital letter then each word will be
130
project (workspace) name contains a capital letter then each word will be
132
capitalized.  For instance, if the above mpc file example was named
131
capitalized.  For instance, if the above mpc file example was named
133
Example.mpc, then the modified project name would be Example_Client.
132
Example.mpc, then the modified project name would be Example_Client.
134
 
133
 
135
If the value set for exename contains an asterisk then the asterisk portion
134
If the value set for exename contains an asterisk then the asterisk portion
136
of the name will be replaced with the current project name.  The same logic
135
of the name will be replaced with the current project name.  The same logic
137
applies to sharedname and staticname.
136
applies to sharedname and staticname.
138
 
137
 
139
If multiple projects are going to be contained within a single workspace
138
If multiple projects are going to be contained within a single workspace
140
(using mwc.pl), there can be no duplication of project names.  This is
139
(using mwc.pl), there can be no duplication of project names.  This is
141
disallowed due to limitations of some workspace tools.
140
disallowed due to limitations of some workspace tools.
142
 
141
 
143
Project Keywords
142
Project Keywords
144
----------------
143
----------------
145
exename         Specifies the name of the executable that will be created
144
exename         Specifies the name of the executable that will be created
146
sharedname      Specifies the name of the shared library that will be created
145
sharedname      Specifies the name of the shared library that will be created
147
staticname      Specifies the name of the static library that will be created
146
staticname      Specifies the name of the static library that will be created
148
dllout          If defined, specifies where the dynamic libraries will be
147
dllout          If defined, specifies where the dynamic libraries will be
149
                placed.  This overrides libout in the dynamic case.
148
                placed.  This overrides libout in the dynamic case.
150
libout          Specifies where the dynamic and static libraries will be placed
149
libout          Specifies where the dynamic and static libraries will be placed
151
install         Specifies where executables will be installed
150
install         Specifies where executables will be installed
152
pch_header      Specifies the precompiled header file name
151
pch_header      Specifies the precompiled header file name
153
pch_source      Specifies the precompiled source file name
152
pch_source      Specifies the precompiled source file name
154
postbuild       If this is defined in the project, the value will be
153
postbuild       If this is defined in the project, the value will be
155
                interpreted as commands to run after the project has been
154
                interpreted as commands to run after the project has been
156
                successfully built.  The <%..%> construct can be used within
155
                successfully built.  The <%..%> construct can be used within
157
                this value to access template variables and functions of the
156
                this value to access template variables and functions of the
158
                template parser. In addition, the following pseudo variables
157
                template parser. In addition, the following pseudo variables
159
                can be used.
158
                can be used.
160
 
159
 
161
                  <%cat%>   - Platform non-specific command to cat a file.
160
                  <%cat%>   - Platform non-specific command to cat a file.
162
                  <%cp%>    - Platform non-specific copy command.
161
                  <%cp%>    - Platform non-specific copy command.
163
                  <%mkdir%> - Platform non-specific mkdir command.
162
                  <%mkdir%> - Platform non-specific mkdir command.
164
                  <%mv%>    - Platform non-specific move command.
163
                  <%mv%>    - Platform non-specific move command.
165
                  <%rm%>    - Platform non-specific delete command.
164
                  <%rm%>    - Platform non-specific delete command.
166
                  <%nul%>   - Platform non-specific null device.
165
                  <%nul%>   - Platform non-specific null device.
167
                  <%gt%>    - Project non-specific greater than sign.
166
                  <%gt%>    - Project non-specific greater than sign.
168
                  <%lt%>    - Project non-specific less than sign.
167
                  <%lt%>    - Project non-specific less than sign.
169
                  <%and%>   - Project non-specific and sign.
168
                  <%and%>   - Project non-specific and sign.
170
                  <%or%>    - Project non-specific or sign.
169
                  <%or%>    - Project non-specific or sign.
171
                  <%quote%> - Project non-specific double quote.
170
                  <%quote%> - Project non-specific double quote.
172
 
171
 
173
recurse         If set to 1, MPC will recurse into directories listed under
172
recurse         If set to 1, MPC will recurse into directories listed under
174
                component listings and add any component corresponding files
173
                component listings and add any component corresponding files
175
                to the list.  This keyword can be used as a global project
174
                to the list.  This keyword can be used as a global project
176
                setting or a component scoped setting.
175
                setting or a component scoped setting.
177
version         Specifies the version number for the library or executable
176
version         Specifies the version number for the library or executable
178
macros          These values will be passed as macros to the compiler.
177
macros          These values will be passed as macros to the compiler.
179
libpaths        Specifies 1 or more locations to find libraries
178
libpaths        Specifies 1 or more locations to find libraries
180
includes        Specifies 1 or more locations to find include files
179
includes        Specifies 1 or more locations to find include files
181
libs            Specifies 1 or more libraries to link into the exe or library
180
libs            Specifies 1 or more libraries to link into the exe or library
182
lit_libs        Specifies 1 or more libraries to link into the exe or library.
181
lit_libs        Specifies 1 or more libraries to link into the exe or library.
183
                If libraries receive a library decorator, then these will not.
182
                If libraries receive a library decorator, then these will not.
184
pure_libs       Specifies 1 or more libraries to link into the exe or library.
183
pure_libs       Specifies 1 or more libraries to link into the exe or library.
185
                If libraries receive a library decorator, then these will not.
184
                If libraries receive a library decorator, then these will not.
186
                If libraries receive a file extension, then these will not.
185
                If libraries receive a file extension, then these will not.
187
after           Specifies that this project must be built after 1 or more
186
after           Specifies that this project must be built after 1 or more
188
                project names listed.
187
                project names listed.
189
custom_only     Create a project that contains only custom generation
188
custom_only     Create a project that contains only custom generation
190
                targets (any file type described by a Define_Custom section).
189
                targets (any file type described by a Define_Custom section).
191
dynamicflags    Specifies preprocessor flags needed for dynamic libraries
190
dynamicflags    Specifies preprocessor flags needed for dynamic libraries
192
staticflags     Specifies preprocessor flags needed for static libraries
191
staticflags     Specifies preprocessor flags needed for static libraries
193
 
192
 
194
verbatim        This allows arbitrary information to be place in a generated
193
verbatim        This allows arbitrary information to be place in a generated
195
                project file.  The syntax is as follows:
194
                project file.  The syntax is as follows:
196
 
195
 
197
                verbatim(<project type>, <location>) {
196
                verbatim(<project type>, <location>) {
198
                  ..
197
                  ..
199
                  ..
198
                  ..
200
                }
199
                }
201
 
200
 
202
                When MPC is generating a project of type <project type> and
201
                When MPC is generating a project of type <project type> and
203
                comes upon a marker that matches the <location> name, it
202
                comes upon a marker that matches the <location> name, it
204
                will place the text found inside the construct directly into
203
                will place the text found inside the construct directly into
205
                the generated project.  If you need to preserve white space,
204
                the generated project.  If you need to preserve white space,
206
                the line or lines should be placed inside double quotes.
205
                the line or lines should be placed inside double quotes.
207
 
206
 
208
specific        This scope allows assignments that are specific to a
207
specific        This scope allows assignments that are specific to a
209
                particular project type.  The syntax is as follows:
208
                particular project type.  The syntax is as follows:
210
 
209
 
211
                specific(<project type> [, <project type> ...]) {
210
                specific(<project type> [, <project type> ...]) {
212
                  lit_libs += c
211
                  lit_libs += c
213
                  ...
212
                  ...
214
                }
213
                }
215
 
214
 
216
                or
215
                or
217
 
216
 
218
                specific(<project type> [, <project type> ...]) {
217
                specific(<project type> [, <project type> ...]) {
219
                  lit_libs += c
218
                  lit_libs += c
220
                  ...
219
                  ...
221
                } else {
220
                } else {
222
                  list_libs += c_other
221
                  list_libs += c_other
223
                  ...
222
                  ...
224
                }
223
                }
225
 
224
 
226
                Due to limited parsing capabilities, the else is required to
225
                If the else is provided, it is required to be on
227
                be on the same line as the closing curly brace.
226
                the same line as the closing curly brace.  You may
-
 
227
                also negate the project type (using '!') which will cause
-
 
228
                the specific to be evaluated for all types except the type
-
 
229
                specified.
228
 
230
 
229
                If a keyword is not recognized as a valid MPC keyword, it is
231
                If a keyword is not recognized as a valid MPC keyword, it is
230
                interpreted as a template value modifier.  In this
232
                interpreted as a template value modifier.  In this
231
                situation, this construct has the exact same restrictions as
233
                situation, this construct has the exact same restrictions as
232
                the -value_template command line option.  See the USAGE file
234
                the -value_template command line option.  See the USAGE file
233
                for more information.
235
                for more information.
234
 
236
 
235
conditional     This scope allows addition of source files conditionally
237
conditional     This scope allows addition of source files conditionally
236
                based on a particular project type.  The syntax is as
238
                based on a particular project type.  The syntax is as
237
                follows:
239
                follows:
238
 
240
 
239
                conditional(<project type> [, <project type> ...]) {
241
                conditional(<project type> [, <project type> ...]) {
240
                  source1.cpp
242
                  source1.cpp
241
                  ...
243
                  ...
242
                }
244
                }
243
 
245
 
244
                or
246
                or
245
 
247
 
246
                conditional(<project type> [, <project type> ...]) {
248
                conditional(<project type> [, <project type> ...]) {
247
                  source1.cpp
249
                  source1.cpp
248
                  ...
250
                  ...
249
                } else {
251
                } else {
250
                  source2.cpp
252
                  source2.cpp
251
                  ...
253
                  ...
252
                }
254
                }
253
 
255
 
254
                Due to limited parsing capabilities, the else is required to
256
                If the else is provided, it is required to be on
255
                be on the same line as the closing curly brace.
257
                the same line as the closing curly brace.  You may
-
 
258
                also negate the project type (using '!') which will cause
-
 
259
                the conditional to be evaluated for all types except the
-
 
260
                type specified.
256
 
261
 
257
requires        Specifies which features should be enabled in order to
262
requires        Specifies which features should be enabled in order to
258
                generate the project file.
263
                generate the project file.
259
avoids          Specifies which features should be disabled in order to
264
avoids          Specifies which features should be disabled in order to
260
                generate the project file.
265
                generate the project file.
261
 
266
 
262
Custom File Definitions
267
Custom File Definitions
263
-----------------------
268
-----------------------
264
In order to support a variety of custom build rules, MPC allows you to
269
In order to support a variety of custom build rules, MPC allows you to
265
define your own custom file types.  Below is an example of a custom
270
define your own custom file types.  Below is an example of a custom
266
definition.
271
definition.
267
 
272
 
268
project {
273
project {
269
  Define_Custom(MOC) {
274
  Define_Custom(MOC) {
270
    automatic        = 0
275
    automatic        = 0
271
    command          = $(QTDIR)/bin/moc
276
    command          = $(QTDIR)/bin/moc
272
    postcommand      = echo "#include <some.h>" > <%temporary%> && \
277
    postcommand      = echo <%quote%>#include <%lt%>some.h<%gt%><%quote%> <%gt%> <%temporary%> <%and%> \
273
                       <%cat%> <%output%> >> <%temporary%> && \
278
                       <%cat%> <%output%> <%gt%><%gt%> <%temporary%> <%and%> \
274
                       <%mv%> <%temporary%> <%output%>
279
                       <%mv%> <%temporary%> <%output%>
275
    output_option    = -o
280
    output_option    = -o
276
    inputext         = .h
281
    inputext         = .h
277
    pre_extension    = _moc
282
    pre_extension    = _moc
278
    source_outputext = .cpp
283
    source_outputext = .cpp
279
  }
284
  }
280
 
285
 
281
  MOC_Files {
286
  MOC_Files {
282
    QtReactor.h
287
    QtReactor.h
283
  }
288
  }
284
 
289
 
285
  Source_Files {
290
  Source_Files {
286
    QtReactor_moc.cpp
291
    QtReactor_moc.cpp
287
  }
292
  }
288
}
293
}
289
 
294
 
290
The above example defines a custom file type "MOC" which describes basic
295
The above example defines a custom file type "MOC" which describes basic
291
information about how to process the input files and what output files are
296
information about how to process the input files and what output files are
292
created.  Once the custom file type is defined, MOC_Files can be defined in
297
created.  Once the custom file type is defined, MOC_Files can be defined in
293
order to specify the input files for this new file type.
298
order to specify the input files for this new file type.
294
 
299
 
295
Here is a list of keywords that can be used within the scope of
300
Here is a list of keywords that can be used within the scope of
296
Define_Custom:
301
Define_Custom:
297
 
302
 
298
automatic           If set to 1, then attempt to automatically determine
303
automatic           If set to 1, then attempt to automatically determine
299
                    which files belong to the set of input files for the
304
                    which files belong to the set of input files for the
300
                    custom type.  If set to 0, then no files are
305
                    custom type.  If set to 0, then no files are
301
                    automatically added to the input files.  If omitted,
306
                    automatically added to the input files.  If omitted,
302
                    then automatic is assumed to be 1.  Custom file types
307
                    then automatic is assumed to be 1.  Custom file types
303
                    that are automatic will have the side effect of possibly
308
                    that are automatic will have the side effect of possibly
304
                    adding files to Source_Files, Inline_Files, Header_Files
309
                    adding files to Source_Files, Inline_Files, Header_Files
305
                    Template_Files, Resource_Files and Documentation_Files
310
                    Template_Files, Resource_Files and Documentation_Files
306
                    depending on which extension types the command generates.
311
                    depending on which extension types the command generates.
307
dependent           If this is given a value, then a dependency upon that
312
dependent           If this is given a value, then a dependency upon that
308
                    value will be placed upon all of the generated files.
313
                    value will be given to all of the generated files.
309
                    The default for this is unset and no dependency will be
314
                    The default for this is unset and no dependency will be
310
                    generated.
315
                    generated.
311
command             The name of the command that should be used to process
316
command             The name of the command that should be used to process
312
                    the input files for the custom type.
317
                    the input files for the custom type.
313
commandflags        Any options that should be passed to the command go here.
318
commandflags        Any options that should be passed to the command go here.
314
inputext            This is a comma separated list of input file extensions
319
inputext            This is a comma separated list of input file extensions
315
                    that belong to the command.
320
                    that belong to the command.
316
keyword             This is a special assignment that takes the form of the
321
keyword             This is a special assignment that takes the form of the
317
                    following:
322
                    following:
318
 
323
 
319
                    keyword newname = existing_custom_name
324
                    keyword newname = existing_custom_name
320
 
325
 
321
                    This has the effect of mapping newname to be the
326
                    This has the effect of mapping newname to be the
322
                    same as existing_custom_name.  existing_custom_name,
327
                    same as existing_custom_name.  existing_custom_name,
323
                    which is optional, corresponds to one of the keywords
328
                    which is optional, corresponds to one of the keywords
324
                    available within a Define_Custom scope (except for
329
                    available within a Define_Custom scope (except for
325
                    keyword).  This function puts newname into the project
330
                    keyword).  This function puts newname into the project
326
                    level scope such that it can be used outside of the
331
                    level scope such that it can be used outside of the
327
                    scope of the particular custom file type being defined.
332
                    scope of the particular custom file type being defined.
328
                    It should be noted that the mapped keywords can not be
333
                    It should be noted that the mapped keywords can not be
329
                    used within the scope of a 'specific' clause.  It does
334
                    used within the scope of a 'specific' clause.  It does
330
                    not cause an error, but it has absolutely no affect.
335
                    not cause an error, but it has absolutely no affect.
331
                    If existing_custom_name is not supplied, then the only
336
                    If existing_custom_name is not supplied, then the only
332
                    way to utilize the newname value is from within the
337
                    way to utilize the newname value is from within the
333
                    template code. ex. <%newname%>
338
                    template code. ex. <%newname%>
334
libpath             If the command requires an additional library path, add
339
libpath             If the command requires an additional library path, add
335
                    it here.
340
                    it here.
336
output_option       If the command takes an option to specify only a single
341
output_option       If the command takes an option to specify only a single
337
                    file output name, then set it here.  Otherwise, this
342
                    file output name, then set it here.  Otherwise, this
338
                    should be omitted.
343
                    should be omitted.
339
pch_postrule        If this is set to 1, then a rule will be added to the
344
pch_postrule        If this is set to 1, then a rule will be added to the
340
                    custom rule that will modify the source output files to
345
                    custom rule that will modify the source output files to
341
                    include the precompiled header file.
346
                    include the precompiled header file.
342
postcommand         Allows a user to execute arbitrary commands after
347
postcommand         Allows a user to execute arbitrary commands after
343
                    the main command is run to generate the output file.
348
                    the main command is run to generate the output file.
344
                    The following pseudo variables can be accessed from
349
                    The following pseudo variables can be accessed from
345
                    within the postcommand assignment:
350
                    within the postcommand assignment:
346
                    <%input%>     - The input file for the original command.
351
                    <%input%>     - The input file for the original command.
347
                    <%output%>    - The output created by the original command.
352
                    <%output%>    - The output created by the original command.
348
                    <%input_basename%>  - The basename of the input file.
353
                    <%input_basename%>  - The basename of the input file.
349
                    <%input_noext%>     - The input file with no extension.
354
                    <%input_noext%>     - The input file with no extension.
350
                    <%output_basename%> - The basename of the output file.
355
                    <%output_basename%> - The basename of the output file.
351
                    <%output_noext%>    - The output file with no extension.
356
                    <%output_noext%>    - The output file with no extension.
352
                      The output file can be referenced as a generic output
357
                      The output file can be referenced as a generic output
353
                      file using <%output%> or can be referenced as a
358
                      file using <%output%> or can be referenced as a
354
                      component file (if it matches the particular type)
359
                      component file (if it matches the particular type)
355
                      using one of the following:
360
                      using one of the following:
356
 
361
 
357
                        <%source_file%>
362
                        <%source_file%>
358
                        <%template_file%>
363
                        <%template_file%>
359
                        <%header_file%>
364
                        <%header_file%>
360
                        <%inline_file%>
365
                        <%inline_file%>
361
                        <%documentation_file%>
366
                        <%documentation_file%>
362
                        <%resource_file%>
367
                        <%resource_file%>
363
 
368
 
364
                      The output file without an extension can be referenced
369
                      The output file without an extension can be referenced
365
                      as a generic output file using <%output_noext%> or can
370
                      as a generic output file using <%output_noext%> or can
366
                      be referenced as a component file (if it matches the
371
                      be referenced as a component file (if it matches the
367
                      particular type) using one of the following:
372
                      particular type) using one of the following:
368
 
373
 
369
                        <%source_file_noext%>
374
                        <%source_file_noext%>
370
                        <%template_file_noext%>
375
                        <%template_file_noext%>
371
                        <%header_file_noext%>
376
                        <%header_file_noext%>
372
                        <%inline_file_noext%>
377
                        <%inline_file_noext%>
373
                        <%documentation_file_noext%>
378
                        <%documentation_file_noext%>
374
                        <%resource_file_noext%>
379
                        <%resource_file_noext%>
375
 
380
 
376
                      The following are also available for use within the
381
                      The following are also available for use within the
377
                      postcommand setting.  They return the extension (if
382
                      postcommand setting.  They return the extension (if
378
                      there is any) of the input and output files
383
                      there is any) of the input and output files
379
                      respectively:
384
                      respectively:
380
 
385
 
381
                        <%input_ext%>
386
                        <%input_ext%>
382
                        <%output_ext%>
387
                        <%output_ext%>
383
 
388
 
384
                    The following pseudo template variables are valid for
389
                    The following pseudo template variables are valid for
385
                    use within the command, commandflags, dependent,
390
                    use within the command, commandflags, dependent,
386
                    postcommand and output_option settings:
391
                    postcommand and output_option settings:
387
 
392
 
388
                    <%temporary%> - A temporary file name.
393
                    <%temporary%> - A temporary file name.
389
                    <%cat%>       - Platform non-specific command to cat a file.
394
                    <%cat%>       - Platform non-specific command to cat a file.
390
                    <%cp%>        - Platform non-specific copy command.
395
                    <%cp%>        - Platform non-specific copy command.
391
                    <%mkdir%>     - Platform non-specific mkdir command.
396
                    <%mkdir%>     - Platform non-specific mkdir command.
392
                    <%mv%>        - Platform non-specific move command.
397
                    <%mv%>        - Platform non-specific move command.
393
                    <%rm%>        - Platform non-specific delete command.
398
                    <%rm%>        - Platform non-specific delete command.
394
                    <%nul%>       - Platform non-specific null device.
399
                    <%nul%>       - Platform non-specific null device.
395
                    <%gt%>        - Project non-specific greater than sign.
400
                    <%gt%>        - Project non-specific greater than sign.
396
                    <%lt%>        - Project non-specific less than sign.
401
                    <%lt%>        - Project non-specific less than sign.
397
                    <%and%>       - Project non-specific and sign.
402
                    <%and%>       - Project non-specific and sign.
398
                    <%or%>        - Project non-specific or sign.
403
                    <%or%>        - Project non-specific or sign.
399
                    <%quote%>     - Project non-specific double quote.
404
                    <%quote%>     - Project non-specific double quote.
400
 
405
 
401
                    If any referenced pseudo template variable does
406
                    If any referenced pseudo template variable does
402
                    not contain a value, then the particular setting
407
                    not contain a value, then the particular setting
403
                    (command, commandflags, dependent, postcommand or
408
                    (command, commandflags, dependent, postcommand or
404
                    output_option) will not be used.
409
                    output_option) will not be used.
405
pre_extension       If the command produces multiple files of the same
410
pre_extension       If the command produces multiple files of the same
406
                    extension, this comma separated list can be used to
411
                    extension, this comma separated list can be used to
407
                    specify them.  For example, tao_idl creates two types of
412
                    specify them.  For example, tao_idl creates two types of
408
                    files per extension (C.h, S.h, C.cpp, S.cpp, etc).
413
                    files per extension (C.h, S.h, C.cpp, S.cpp, etc).
409
source_pre_extension        This is the same as pre_extension except that it
414
source_pre_extension        This is the same as pre_extension except that it
410
                            only applies to source_outputext.
415
                            only applies to source_outputext.
411
inline_pre_extension        This is the same as pre_extension except that it
416
inline_pre_extension        This is the same as pre_extension except that it
412
                            only applies to inline_outputext.
417
                            only applies to inline_outputext.
413
header_pre_extension        This is the same as pre_extension except that it
418
header_pre_extension        This is the same as pre_extension except that it
414
                            only applies to header_outputext.
419
                            only applies to header_outputext.
415
template_pre_extension      This is the same as pre_extension except that it
420
template_pre_extension      This is the same as pre_extension except that it
416
                            only applies to template_outputext.
421
                            only applies to template_outputext.
417
resource_pre_extension      This is the same as pre_extension except that it
422
resource_pre_extension      This is the same as pre_extension except that it
418
                            only applies to resource_outputext.
423
                            only applies to resource_outputext.
419
documentation_pre_extension This is the same as pre_extension except that it
424
documentation_pre_extension This is the same as pre_extension except that it
420
                            only applies to documentation_outputext.
425
                            only applies to documentation_outputext.
421
pre_filename        This is similar to pre_extension except that the values
426
pre_filename        This is similar to pre_extension except that the values
422
                    are prepended to the file name instead of the extension.
427
                    are prepended to the file name instead of the extension.
423
source_pre_filename         This is the same as pre_filename except that it
428
source_pre_filename         This is the same as pre_filename except that it
424
                            only applies to source_outputext.
429
                            only applies to source_outputext.
425
inline_pre_filename         This is the same as pre_filename except that it
430
inline_pre_filename         This is the same as pre_filename except that it
426
                            only applies to inline_outputext.
431
                            only applies to inline_outputext.
427
header_pre_filename         This is the same as pre_filename except that it
432
header_pre_filename         This is the same as pre_filename except that it
428
                            only applies to header_outputext.
433
                            only applies to header_outputext.
429
template_pre_filename       This is the same as pre_filename except that it
434
template_pre_filename       This is the same as pre_filename except that it
430
                            only applies to template_outputext.
435
                            only applies to template_outputext.
431
resource_pre_filename       This is the same as pre_filename except that it
436
resource_pre_filename       This is the same as pre_filename except that it
432
                            only applies to resource_outputext.
437
                            only applies to resource_outputext.
433
documentation_pre_filename  This is the same as pre_filename except that it
438
documentation_pre_filename  This is the same as pre_filename except that it
434
                            only applies to documentation_outputext.
439
                            only applies to documentation_outputext.
435
source_outputext    This is a comma separated list of possible source file
440
source_outputext    This is a comma separated list of possible source file
436
                    output extensions.  If the command does not produce
441
                    output extensions.  If the command does not produce
437
                    source files, then this can be omitted.
442
                    source files, then this can be omitted.
438
inline_outputext    This is a comma separated list of possible inline file
443
inline_outputext    This is a comma separated list of possible inline file
439
                    output extensions.  If the command does not produce
444
                    output extensions.  If the command does not produce
440
                    inline files, then this can be omitted.
445
                    inline files, then this can be omitted.
441
header_outputext    This is a comma separated list of possible header file
446
header_outputext    This is a comma separated list of possible header file
442
                    output extensions.  If the command does not produce
447
                    output extensions.  If the command does not produce
443
                    header files, then this can be omitted.
448
                    header files, then this can be omitted.
444
template_outputext  This is a comma separated list of possible template file
449
template_outputext  This is a comma separated list of possible template file
445
                    output extensions.  If the command does not produce
450
                    output extensions.  If the command does not produce
446
                    template files, then this can be omitted.
451
                    template files, then this can be omitted.
447
resource_outputext  This is a comma separated list of possible resource file
452
resource_outputext  This is a comma separated list of possible resource file
448
                    output extensions.  If the command does not produce
453
                    output extensions.  If the command does not produce
449
                    resource files, then this can be omitted.
454
                    resource files, then this can be omitted.
450
documentation_outputext  This is a comma separated list of possible
455
documentation_outputext  This is a comma separated list of possible
451
                         documentation file output extensions.  If the
456
                         documentation file output extensions.  If the
452
                         command does not produce documentation files, then
457
                         command does not produce documentation files, then
453
                         this can be omitted.
458
                         this can be omitted.
454
generic_outputext   If the command does not generate any of the other output
459
generic_outputext   If the command does not generate any of the other output
455
                    types listed above, then the extensions should be listed
460
                    types listed above, then the extensions should be listed
456
                    under this.
461
                    under this.
457
 
462
 
458
If the custom output can not be represented with the above output extension
463
If the custom output can not be represented with the above output extension
459
keywords (*_outputext) and you have knowledge of the output files a priori,
464
keywords (*_outputext) and you have knowledge of the output files a priori,
460
you can represent them with the '>>' construct.
465
you can represent them with the '>>' construct.
461
 
466
 
462
Below is an example that demonstrates the use of '>>'.  The command takes an
467
Below is an example that demonstrates the use of '>>'.  The command takes an
463
input file name of foo.prp and produces two files that have a completely
468
input file name of foo.prp and produces two files that have completely
464
unrelated filename (i.e. foo !~ hello).
469
unrelated filenames (i.e. foo !~ hello).
465
 
470
 
466
project {
471
project {
467
  Define_Custom(Quogen) {
472
  Define_Custom(Quogen) {
468
    automatic               = 0
473
    automatic           = 0
469
    command                 = perl quogen.pl
474
    command             = perl quogen.pl
470
    commandflags            = --debuglevel=1 --language=c++ \
475
    commandflags        = --debuglevel=1 --language=c++ \
471
                              --kernel_language=c++
476
                          --kernel_language=c++
472
    inputext                = .prp
477
    inputext            = .prp
473
    keyword quogenflags     = commandflags
478
    keyword quogenflags = commandflags
474
  }
479
  }
475
 
480
 
476
  Quogen_Files {
481
  Quogen_Files {
477
    foo.prp >> hello.h hello.cpp
482
    foo.prp >> hello.h hello.cpp
478
  }
483
  }
479
 
484
 
480
  Source_Files {
485
  Source_Files {
481
    hello.cpp
486
    hello.cpp
482
  }
487
  }
483
}
488
}
484
 
489
 
-
 
490
You can use the '<<' construct to represent dependencies for specific custom
-
 
491
input file.  For instance, in the above example, assume that foo.prp depends
-
 
492
upon foo.in, we would represent this by adding << foo.in as shown below.
-
 
493
 
-
 
494
  Quogen_Files {
-
 
495
    foo.prp >> hello.h hello.cpp << foo.in
-
 
496
  }
-
 
497
 
485
There is a new construct that can be used within a Define_Custom section.
498
There is a construct that can be used within a Define_Custom section
486
It is called 'optional' and can be used to represent optional custom output
499
called 'optional' and can be used to represent optional custom output
487
dependent upon particular command line parameters passed to the custom
500
dependent upon particular command line parameters passed to the custom
488
command.
501
command.
489
 
502
 
490
project {
503
project {
491
  Define_Custom(TEST) {
504
  Define_Custom(TEST) {
492
    optional(keyword) {
505
    optional(keyword) {
493
      flag_keyword(option) += value [, value]
506
      flag_keyword(option) += value [, value]
494
    }
507
    }
495
  }
508
  }
496
}
509
}
497
 
510
 
498
In the above example, keyword can be any of the pre_extension, pre_filename
511
In the above example, keyword can be any of the pre_extension, pre_filename
499
or keywords that end in _outputext.  flag_keyword can be any of the custom
512
or keywords that end in _outputext.  flag_keyword can be any of the custom
500
definition keywords, however only commandflags really make any sense.
513
definition keywords, however only commandflags really make any sense.
501
Inside the parenthesis, the flag_keyword value is searched for the 'option'
514
Inside the parenthesis, the flag_keyword value is searched for the 'option'
502
value.  If it is found, then the 'value' after the += is added to the list
515
value.  If it is found, then the 'value' after the += is added to the list
503
specified by 'keyword'.  This can also be negated by prefixing 'option' with
516
specified by 'keyword'.  This can also be negated by prefixing 'option' with
504
an exclamation point (!).
517
an exclamation point (!).
505
 
518
 
506
project {
519
project {
507
  Define_Custom(IDL) {
520
  Define_Custom(IDL) {
508
    source_pre_extension = C, S
521
    source_pre_extension = C, S
509
    optional(source_pre_extension) {
522
    optional(source_pre_extension) {
510
      commandflags(-GA) += A
523
      commandflags(-GA) += A
511
    }
524
    }
512
  }
525
  }
513
}
526
}
514
 
527
 
515
In the preceding example, the source_pre_extension contains C and S.  The
528
In the preceding example, the source_pre_extension contains C and S.  The
516
optional clause can be read as follows: If 'commandflags' contains -GA then
529
optional clause can be read as follows: If 'commandflags' contains -GA then
517
add A to source_pre_extension.
530
add A to source_pre_extension.
518
 
531
 
519
Particular output extensions are not required.  However at least one output
532
Particular output extensions are not required.  However at least one output
520
extension type is required in order for MPC to generate a target.  Within
533
extension type is required in order for MPC to generate a target.  Within
521
graphical build environments, the custom input file will be listed
534
graphical build environments, the custom input file will be listed
522
regardless of the presence of an extension definition.  In this case, the
535
regardless of the presence of an extension definition.  In this case, the
523
input file will be "excluded" from the build.
536
input file will be "excluded" from the build.
524
 
537
 
525
For custom file types, there are a few keywords that can be used within the
538
For custom file types, there are a few keywords that can be used within the
526
custom file type input lists: command, commandflags, dependent, gendir and
539
custom file type input lists: command, commandflags, dependent, gendir and
527
postcommand.  These keywords (except for gendir) can be used to augment or
540
postcommand.  These keywords (except for gendir) can be used to augment or
528
override the values of the same name defined in a Define_Custom section.
541
override the values of the same name defined in a Define_Custom section.
529
gendir can be used to specify the directory in which the generated
542
gendir can be used to specify the directory in which the generated
530
output will go.  Below is an example:
543
output will go.  Below is an example:
531
 
544
 
532
  MOC_Files {
545
  MOC_Files {
533
    commandflags += -nw
546
    commandflags += -nw
534
    gendir = moc_generated
547
    gendir = moc_generated
535
    QtReactor.h
548
    QtReactor.h
536
  }
549
  }
537
 
550
 
538
  Source_Files {
551
  Source_Files {
539
    moc_generated/QtReactor_moc.cpp
552
    moc_generated/QtReactor_moc.cpp
540
  }
553
  }
541
 
554
 
542
In the above example, the generated file (QtReactor_moc.cpp) is placed in
555
In the above example, the generated file (QtReactor_moc.cpp) is placed in
543
the moc_generated directory and the -nw option is added to commandflags.
556
the moc_generated directory and the -nw option is added to commandflags.
544
It should be noted that if the custom file definition does not set the
557
It should be noted that if the custom file definition does not set the
545
output_option then you must provide the necessary options in
558
output_option then you must provide the necessary options in
546
commandflags to ensure that the generated output goes into the directory
559
commandflags to ensure that the generated output goes into the directory
547
specified by gendir.
560
specified by gendir.
548
 
561
 
549
The following example illustrates the use of the keyword mapping capability
562
The following example illustrates the use of the keyword mapping capability
550
of the Define_Custom:
563
of the Define_Custom:
551
 
564
 
552
project {
565
project {
553
  Define_Custom(CIDL) {
566
  Define_Custom(CIDL) {
554
    automatic         = 0;
567
    automatic         = 0;
555
    command           =  $(CIAO_ROOT)/bin/cidlc
568
    command           =  $(CIAO_ROOT)/bin/cidlc
556
    commandflags      = -I$(TAO_ROOT)/tao -I$(TAO_ROOT)/orbsvcs/orbsvcs --
569
    commandflags      = -I$(TAO_ROOT)/tao -I$(TAO_ROOT)/orbsvcs/orbsvcs --
557
    inputext          = .cidl
570
    inputext          = .cidl
558
    source_outputext  = _svnt.cpp
571
    source_outputext  = _svnt.cpp
559
    generic_outputext = E.idl
572
    generic_outputext = E.idl
560
 
573
 
561
    // Allow cidlflags to be used outside the scope of CIDL_Files
574
    // Allow cidlflags to be used outside the scope of CIDL_Files
562
    keyword cidlflags = commandflags
575
    keyword cidlflags = commandflags
563
  }
576
  }
564
 
577
 
565
  // This will get added to all commandflags for CIDL_Files
578
  // This will get added to all commandflags for CIDL_Files
566
  cidlflags += --some_option
579
  cidlflags += --some_option
567
 
580
 
568
  CIDL_Files {
581
  CIDL_Files {
569
    // This will have a combination of the original commandflags plus
582
    // This will have a combination of the original commandflags plus
570
    // the value added to cidlflags above.
583
    // the value added to cidlflags above.
571
    file.cidl
584
    file.cidl
572
  }
585
  }
573
 
586
 
574
  CIDL_Files {
587
  CIDL_Files {
575
    // This will have a combination of the original commandflags plus
588
    // This will have a combination of the original commandflags plus
576
    // the value added to cidlflags above plus the value added to
589
    // the value added to cidlflags above plus the value added to
577
    // cidlflags here.
590
    // cidlflags here.
578
    cidlflags += --another_option
591
    cidlflags += --another_option
579
    another_file.cidl
592
    another_file.cidl
580
  }
593
  }
581
}
594
}
582
 
595
 
583
Special type of feature project
596
Special type of feature project
584
-------------------------------
597
-------------------------------
585
A feature project contains information as a project would, but can only
598
A feature project contains information as a project would, but can only
586
be a base project and will only be added to a sub project if the features
599
be a base project and will only be added to a sub project if the features
587
that it requires (or avoids) are present.
600
that it requires (or avoids) are present.
588
 
601
 
589
A feature definition requires at least one feature name.  A name by itself
602
A feature definition requires at least one feature name.  A name by itself
590
specifies that the feature is required.  A '!' in front of the feature name
603
specifies that the feature is required.  A '!' in front of the feature name
591
indicates that the feature must be disabled.  There may be more than one
604
indicates that the feature must be disabled.  There may be more than one
592
feature listed between the parenthesis and they must be comma separated.
605
feature listed between the parenthesis and they must be comma separated.
593
 
606
 
594
The following feature definition requires that the qt feature be enabled.
607
The following feature definition requires that the qt feature be enabled.
595
 
608
 
596
feature(qt) {
609
feature(qt) {
597
  Define_Custom(MOC) {
610
  Define_Custom(MOC) {
598
    automatic        = 0
611
    automatic        = 0
599
    command          = $(QTDIR)/bin/moc
612
    command          = $(QTDIR)/bin/moc
600
    output_option    = -o
613
    output_option    = -o
601
    inputext         = .h
614
    inputext         = .h
602
    pre_extension    = _moc
615
    pre_extension    = _moc
603
    source_outputext = .cpp
616
    source_outputext = .cpp
604
  }
617
  }
605
 
618
 
606
  MOC_Files {
619
  MOC_Files {
607
    QtSpecific.h
620
    QtSpecific.h
608
  }
621
  }
609
 
622
 
610
  Source_Files {
623
  Source_Files {
611
    QtSpecific_moc.cpp
624
    QtSpecific_moc.cpp
612
  }
625
  }
613
}
626
}
614
 
627
 
615
Assuming that the above feature definition is stored in a file named
628
Assuming that the above feature definition is stored in a file named
616
qt_specific.mpb, an mpc project could inherit from it and would only receive
629
qt_specific.mpb, an mpc project could inherit from it and would only receive
617
the feature definition if the qt feature was enabled.
630
the feature definition if the qt feature was enabled.
618
 
631
 
619
project: qt_specific {
632
project: qt_specific {
620
  ...
633
  ...
621
}
634
}
622
 
635
 
623
 
636
 
-
 
637
Feature Files
-
 
638
-------------
-
 
639
Features are enabled and disable within feature files or through the use of
-
 
640
the -features option (see USAGE for more details).  The first feature file
-
 
641
read is always global.features found in the config directory.  The second
-
 
642
feature file read is the project type name with .features appended
-
 
643
(ex. vc71.features, make.features, etc.) which must be located in the same
-
 
644
directory as the global.features file.  Lastly, the file specified by the
-
 
645
-feature_file option is read if this option is used.
-
 
646
 
-
 
647
Each successive feature file has precedence over the previous.  That is,
-
 
648
if a feature has already been set previously it is overridden.  The
-
 
649
-features option has precedence over feature files.
-
 
650
 
624
Special Keywords Available to Templates
651
Special Keywords Available to Templates
625
---------------------------------------
652
---------------------------------------
626
project_name    This contains the name of the project.
653
project_name    This contains the name of the project.
627
project_file    This contains the name of the output file.
654
project_file    This contains the name of the output file.
628
guid            This is used by the VC7 project and workspace creator.
655
guid            This is used by the VC7 project and workspace creator.
629
configurations  When used within a foreach context, this info (each
656
configurations  When used within a foreach context, this info (each
630
                configuration) is gathered for use with the VC7 workspace
657
                configuration) is gathered for use with the VC7 workspace
631
                creator.
658
                creator.
632
flag_overrides  Used to determine flags that have been overridden on a per
659
flag_overrides  Used to determine flags that have been overridden on a per
633
                file basis.
660
                file basis.
634
custom_types    The list of custom file types that may have been defined
661
custom_types    The list of custom file types that may have been defined
635
                in the mpc file or a base project.
662
                in the mpc file or a base project.
636
fornotlast      Insert the text on every foreach iteration except the last.
663
fornotlast      Insert the text on every foreach iteration except the last.
637
forlast         Insert the text only on the last foreach iteration.
664
forlast         Insert the text only on the last foreach iteration.
638
fornotfirst     Insert the text on every foreach iteration except the first.
665
fornotfirst     Insert the text on every foreach iteration except the first.
639
forfirst        Insert the text only on the first foreach iteration.
666
forfirst        Insert the text only on the first foreach iteration.
640
forcount        A one based index number of the foreach iterations.
667
forcount        A one based index number of the foreach iterations.
641
 
668
 
642
Project Variable and Template Input Variable Interaction
669
Project Variable and Template Input Variable Interaction
643
--------------------------------------------------------
670
--------------------------------------------------------
644
Project variables and template input variables are separate entities and in
671
Project variables and template input variables are separate entities and in
645
the context of the TemplateParser, template input variables have precedence
672
the context of the TemplateParser, template input variables have precedence
646
over project variables.
673
over project variables.
647
 
674
 
648
This means that if the project keyword 'libout' is set in an MPC project and
675
This means that if the project keyword 'libout' is set in an MPC project and
649
is set as a template input variable, the template input variable value will
676
is set as a template input variable, the template input variable value will
650
be used.  There are exceptions to this rule.  The following list shows the
677
be used.  There are exceptions to this rule.  The following list shows the
651
project keywords that have their MPC project value appended to the template
678
project keywords that have their MPC project value appended to the template
652
input value (if there is a template input value).
679
input value (if there is a template input value).
653
 
680
 
654
libpaths
681
libpaths
655
includes
682
includes
656
libs
683
libs
657
lit_libs
684
lit_libs
658
pure_libs
685
pure_libs
659
dynamicflags
686
dynamicflags
660
staticflags
687
staticflags
661
requires
688
requires
662
avoids
689
avoids
663
macros
690
macros
664
 
691
 
665
Workspaces
692
Workspaces
666
----------
693
----------
667
Workspaces (mwc files) can have assignments similar to projects.  There are
694
Workspaces (mwc files) can have assignments similar to projects.  There are
668
currently only two assignments allowed.
695
currently only two assignments allowed.
669
 
696
 
670
The first is 'cmdline'.  The values given to the cmdline assignment will be
697
The first is 'cmdline'.  The values given to the cmdline assignment will be
671
processed as command line options, but only to the projects that are
698
processed as command line options, but only to the projects that are
672
contained within the workspace (or the scope of the assignment).  The only
699
contained within the workspace (or the scope of the assignment).  The only
673
valid command line options for cmdline are -base, -global, -include, -ti,
700
valid command line options for cmdline are -base, -global, -include, -ti,
674
-template, -static, -relative, -notoplevel, -value_template
701
-template, -static, -relative, -notoplevel, -value_template
675
and -value_project.
702
and -value_project.
676
 
703
 
677
The second assignment is 'implicit'.  This assignment takes two different
704
The second assignment is 'implicit'.  This assignment takes two different
678
types of values.  It takes a boolean value (0 or 1) to indicate that an
705
types of values.  It takes a boolean value (0 or 1) to indicate that an
679
implicit project should be created in directories that contain no mpc file,
706
implicit project should be created in directories that contain no mpc file,
680
but contain project related files (source, headers, etc.).  The default
707
but contain project related files (source, headers, etc.).  The default
681
value for implicit is 0.  It also takes a character string that represents a
708
value for implicit is 0.  It also takes a character string that represents a
682
base project (similar to the -base option).  In this case, implicit is
709
base project (similar to the -base option).  In this case, implicit is
683
enabled and each implicitly generate project file will have the base project
710
enabled and each implicitly generate project file will have the base project
684
or base projects (when addition is used) when the project is created.
711
or base projects (when addition is used) when the project is created.
685
 
712
 
686
Defaulting Behavior
713
Defaulting Behavior
687
-------------------
714
-------------------
688
1) If a project name is not specified
715
1) If a project name is not specified
689
 
716
 
690
   it will be defaulted to the name of the mpc file without the extension
717
   it will be defaulted to the name of the mpc file without the extension
691
 
718
 
692
2) If a particular list is not specified (Source_Files, Header_Files, etc.)
719
2) If a particular list is not specified (Source_Files, Header_Files, etc.)
693
 
720
 
694
   all of the files in the directory will be added to the corresponding list
721
   all of the files in the directory will be added to the corresponding list
695
   by extension
722
   by extension
696
 
723
 
697
3) If custom files (ex. idl files) exist in the directory and
724
3) If the custom type is automatic and custom files (ex. idl files) exist in
698
   the custom files components (ex. IDL_Files) are left defaulted (i.e. not
725
   the directory and the custom files components (ex. IDL_Files) are left
699
   listed) or the custom files components are specified and none of the
726
   defaulted (i.e. not listed) or the custom files components are specified
700
   custom generated files are listed in the corresponding lists
727
   and none of the custom generated files are listed in the corresponding
-
 
728
   lists
701
 
729
 
702
   the custom files are added to the custom files component list if they
730
   the custom files are added to the custom files component list if they
703
   weren't specified and all of the (would be) generated files will be added
731
   weren't specified and all of the (would be) generated files will be added
704
   to the front of the corresponding lists (source, inline and header lists)
732
   to the front of the corresponding lists (source, inline and header lists)
705
 
733
 
706
4) If files are listed in the Source_Files list and
734
4) If files are listed in the Source_Files list and a corresponding header or
707
   a corresponding header or inline file exists
735
   inline file exists
708
 
736
 
709
   the corresponding file will be added to the corresponding list (if it
737
   the corresponding file will be added to the corresponding list (if it
710
   isn't already there)
738
   isn't already there)
711
 
739
 
712
5) If a sharedname is specified and staticname is not
740
5) If a sharedname is specified and staticname is not
713
 
741
 
714
   staticname is assigned the sharedname value (the same applies if
742
   staticname is assigned the sharedname value (the same applies if
715
   staticname is specified and sharedname is not)
743
   staticname is specified and sharedname is not)
716
 
744
 
717
6) If exename is specified then the project target is considered an
745
6) If exename is specified then the project target is considered an
718
   executable.  If neither exename, sharedname or staticname are used and
746
   executable.  If neither exename, sharedname or staticname are used and
719
   any of the source files listed contains a "main", then the project target
747
   any of the source files listed contains a language dependent "main", then
720
   is considered an executable, otherwise it is considered a library.
748
   the project target is considered an executable, otherwise it is considered
-
 
749
   a library.
721
 
750
 
722
7) If pch_header is not specified and a header file matches *_pch.h
751
7) If pch_header is not specified and a header file matches *_pch.h
723
 
752
 
724
   it is assumed to be the precompiled header file (the same applies to
753
   it is assumed to be the precompiled header file (the same applies to
725
   pch_source)
754
   pch_source)
726
 
755
 
727
Processing Order
756
Processing Order
728
----------------
757
----------------
729
1) Project file is read
758
1) Project file is read
730
2) Template input file is read
759
2) Template input file is read
731
3) Template file is read
760
3) Template file is read
732
4) Output project is written
761
4) Output project is written
733
 
762