Subversion Repositories gelsvn

Rev

Rev 68 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68 Rev 71
Line 1... Line 1...
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.
Line 16... Line 15...
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
 
Line 221... Line 220...
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
Line 249... Line 251...
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.
Line 267... Line 272...
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
Line 303... Line 308...
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.
Line 458... Line 463...
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
  }
Line 480... Line 485...
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) {
Line 619... Line 632...
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.
Line 692... Line 719...
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
Line 714... Line 742...
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)