diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2002-06-26 17:50:18 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2002-06-26 17:50:18 +0000 |
commit | 19b5537e5e2acef59c6780683259a704817015e7 (patch) | |
tree | 30a46271d38272ee2f5124b67de5e0ff0ad09e10 | |
parent | d3489222eb33ddae076e450b996d63016228fa0c (diff) | |
download | ATCD-19b5537e5e2acef59c6780683259a704817015e7.tar.gz |
Added options to generate dynamic or static projects only
-rw-r--r-- | bin/MakeProjectCreator/USAGE | 78 | ||||
-rw-r--r-- | bin/MakeProjectCreator/modules/Driver.pm | 44 | ||||
-rw-r--r-- | bin/MakeProjectCreator/modules/GNUWorkspaceCreator.pm | 4 | ||||
-rw-r--r-- | bin/MakeProjectCreator/modules/NMakeWorkspaceCreator.pm | 4 | ||||
-rw-r--r-- | bin/MakeProjectCreator/modules/ProjectCreator.pm | 40 | ||||
-rw-r--r-- | bin/MakeProjectCreator/modules/VC6WorkspaceCreator.pm | 4 | ||||
-rw-r--r-- | bin/MakeProjectCreator/modules/VC7WorkspaceCreator.pm | 4 | ||||
-rw-r--r-- | bin/MakeProjectCreator/modules/WorkspaceCreator.pm | 16 |
8 files changed, 129 insertions, 65 deletions
diff --git a/bin/MakeProjectCreator/USAGE b/bin/MakeProjectCreator/USAGE index 6f3e12db2ff..3d17ee7f5a5 100644 --- a/bin/MakeProjectCreator/USAGE +++ b/bin/MakeProjectCreator/USAGE @@ -10,21 +10,24 @@ projects for each one found. Usage: mwc.pl [-global <file>] [-include <directory>] - [-template <file>] [-ti <dll | exe | lib>:<file>] + [-ti <dll | lib | dll_exe | lib_exe>:<file>] + [-template <file>] [-dynamic_only] [-static_only] [-type <gnu | nma | vc6 | vc7>] [files] - -global Specifies the global input file. Values stored - within this file are applied to all projects. - -include Specifies a directory to search when looking for base - projects, template input files and templates. This - option can be used multiple times to add directories. - -ti Specifies the template input file (with no extension) - for the specific type as shown above - (ex. -ti exe:vc8exe) - -type Specifies the type of project file to generate. This - option can be used multiple times to generate multiple - types. - + -global Specifies the global input file. Values stored + within this file are applied to all projects. + -include Specifies a directory to search when looking for base + projects, template input files and templates. This + option can be used multiple times to add directories. + -ti Specifies the template input file (with no extension) + for the specific type as shown above + (ex. -ti dll_exe:vc8exe) + -template Specifies the template name (with no extension). + -dynamic_only Specifies that only dynamic projects will be generated. + -static_only Specifies that only static projects will be generated. + -type Specifies the type of project file to generate. This + option can be used multiple times to generate multiple + types. The default global input file (ACE_wrappers/bin/MakeProjectCreator/config/global.mpb) is used if -global @@ -35,11 +38,22 @@ Two include directories are used by default ACE_wrappers/bin/MakeProjectCreator/templates) if -include is not used. Each project creator has a default template input file for each type of -project (exe, dll, lib). You can override the default template input file -name with the -ti option. The file must have a 'mpt' extension and must -reside within the include search directories. NOTE: the 'lib' template -input file is only used if the project creator makes a separate project file -for dynamic libraries and static libraries. +project (dll_exe, lib_exe, dll, lib). You can override the default template +input file name with the -ti option. The file must have a 'mpt' extension +and must reside within the include search directories. NOTE: the 'lib' and +the 'lib_exe' template input files are only used if the project creator makes +a separate project file for dynamic libraries and static libraries. + +The -template option is used to override the default template name. This +file should have a .mpd extension and sit in one of the include search +directores. NOTE: The -template option overrides the template file for all +types specified. + +The -dynamic_only option can be used to avoid generating static project +files. This currently only applies to the vc6 type. + +The -static_only option can be used to avoid generating dynamic project +files. This currently only applies to the vc6 type. The -type option can be used multiple times on the same command line to generate projects of different types per mpc file. NOTE: The -ti option @@ -56,17 +70,21 @@ project in the directory from which the script was started. Usage: mpc.pl [-global <file>] [-include <directory>] - [-template <file>] [-ti <dll | exe | lib>:<file>] + [-ti <dll | lib | dll_exe | lib_exe>:<file>] + [-template <file>] [-dynamic_only] [-static_only] [-type <bor | ghs | gnu | nma | vc6 | vc7>] [files] - -global Specifies the global input file. Values stored - within this file are applied to all projects. - -include Specifies a directory to search when looking for base - projects, template input files and templates. This - option can be used multiple times to add directories. - -ti Specifies the template input file (with no extension) - for the specific type as shown above - (ex. -ti exe:vc8exe) - -type Specifies the type of project file to generate. This - option can be used multiple times to generate multiple - types. + -global Specifies the global input file. Values stored + within this file are applied to all projects. + -include Specifies a directory to search when looking for base + projects, template input files and templates. This + option can be used multiple times to add directories. + -ti Specifies the template input file (with no extension) + for the specific type as shown above + (ex. -ti dll_exe:vc8exe) + -template Specifies the template name (with no extension). + -dynamic_only Specifies that only dynamic projects will be generated. + -static_only Specifies that only static projects will be generated. + -type Specifies the type of project file to generate. This + option can be used multiple times to generate multiple + types. diff --git a/bin/MakeProjectCreator/modules/Driver.pm b/bin/MakeProjectCreator/modules/Driver.pm index 70a6888d07f..9fab7a7a526 100644 --- a/bin/MakeProjectCreator/modules/Driver.pm +++ b/bin/MakeProjectCreator/modules/Driver.pm @@ -23,7 +23,7 @@ sub new { my(@creators) = @_; my($self) = bless {'path' => $path, 'name' => $name, - 'version' => 0.6, + 'version' => 0.7, 'types' => {}, 'creators' => \@creators, }, $class; @@ -41,8 +41,10 @@ sub usageAndExit { } print STDERR "$base v$self->{'version'}\n" . "Usage: $base [-global <file>] [-include <directory>]\n" . - (" " x (length($base) + 8)) . "[-template <file>] " . + (" " x (length($base) + 8)) . "[-ti <dll | lib | dll_exe | lib_exe>:<file>]\n" . + (" " x (length($base) + 8)) . "[-template <file>] " . + "[-dynamic_only] [-static_only]\n" . (" " x (length($base) + 8)) . "[-type <"; my($t) = $self->{'types'}; my(@keys) = sort keys %$t; @@ -55,17 +57,20 @@ sub usageAndExit { print STDERR ">] [files]\n\n"; print STDERR -" -global Specifies the global input file. Values stored\n" . -" within this file are applied to all projects.\n" . -" -include Specifies a directory to search when looking for base\n" . -" projects, template input files and templates. This\n" . -" option can be used multiple times to add directories.\n" . -" -ti Specifies the template input file (with no extension)\n" . -" for the specific type as shown above\n" . -" (ex. -ti dll_exe:vc8exe)\n" . -" -type Specifies the type of project file to generate. This\n" . -" option can be used multiple times to generate multiple\n" . -" types.\n"; +" -global Specifies the global input file. Values stored\n" . +" within this file are applied to all projects.\n" . +" -include Specifies a directory to search when looking for base\n" . +" projects, template input files and templates. This\n" . +" option can be used multiple times to add directories.\n" . +" -ti Specifies the template input file (with no extension)\n" . +" for the specific type as shown above\n" . +" (ex. -ti dll_exe:vc8exe)\n" . +" -template Specifies the template name (with no extension).\n" . +" -dynamic_only Specifies that only dynamic projects will be generated.\n" . +" -static_only Specifies that only static projects will be generated.\n" . +" -type Specifies the type of project file to generate. This\n" . +" option can be used multiple times to generate multiple\n" . +" types.\n"; exit(0); } @@ -101,6 +106,8 @@ sub run { my($default) = undef; my($template) = undef; my(%ti) = (); + my($dynamic) = 1; + my($static) = 1; my($signif) = 3; ## Dynamically load in each perl module and set up @@ -175,6 +182,14 @@ sub run { } } } + elsif ($arg eq '-dynamic_only') { + $static = 0; + $dynamic = 1; + } + elsif ($arg eq '-static_only') { + $static = 1; + $dynamic = 0; + } elsif ($arg =~ /^-/) { $self->usageAndExit(); } @@ -201,7 +216,8 @@ sub run { ## Generate the files foreach my $file (@input) { foreach my $name (@generators) { - my($generator) = $name->new($global, \@include, $template, \%ti); + my($generator) = $name->new($global, \@include, $template, + \%ti, $dynamic, $static); print "Generating output using " . ($file eq "" ? "default input" : $file) . "\n"; print "Start Time: " . scalar(localtime(time())) . "\n"; diff --git a/bin/MakeProjectCreator/modules/GNUWorkspaceCreator.pm b/bin/MakeProjectCreator/modules/GNUWorkspaceCreator.pm index e1f8fa4e398..98344ff3a9f 100644 --- a/bin/MakeProjectCreator/modules/GNUWorkspaceCreator.pm +++ b/bin/MakeProjectCreator/modules/GNUWorkspaceCreator.pm @@ -70,7 +70,9 @@ sub project_creator { return new GNUProjectCreator($self->get_global_cfg(), $self->get_include_path(), $self->get_template_override(), - $self->get_ti_override()); + $self->get_ti_override(), + $self->get_dynamic(), + $self->get_static()); } diff --git a/bin/MakeProjectCreator/modules/NMakeWorkspaceCreator.pm b/bin/MakeProjectCreator/modules/NMakeWorkspaceCreator.pm index b9b13dffbc5..1068aa48319 100644 --- a/bin/MakeProjectCreator/modules/NMakeWorkspaceCreator.pm +++ b/bin/MakeProjectCreator/modules/NMakeWorkspaceCreator.pm @@ -78,7 +78,9 @@ sub project_creator { return new NMakeProjectCreator($self->get_global_cfg(), $self->get_include_path(), $self->get_template_override(), - $self->get_ti_override()); + $self->get_ti_override(), + $self->get_dynamic(), + $self->get_static()); } diff --git a/bin/MakeProjectCreator/modules/ProjectCreator.pm b/bin/MakeProjectCreator/modules/ProjectCreator.pm index 6ebacd4bbed..fc7f552cd5b 100644 --- a/bin/MakeProjectCreator/modules/ProjectCreator.pm +++ b/bin/MakeProjectCreator/modules/ProjectCreator.pm @@ -66,22 +66,26 @@ sub new { my($inc) = shift; my($template) = shift; my($ti) = shift; + my($dynamic) = shift; + my($static) = shift; my($self) = Creator::new($class, $global, $inc, $template, $ti, 'project'); my($typecheck) = $self->{'type_check'}; - $self->{$typecheck} = 0; - $self->{'global_assign'} = {}; - $self->{'files_written'} = []; - $self->{'project_info'} = []; - $self->{'reading_global'} = 0; - $self->{'reading_parent'} = []; - $self->{'dexe_template_input'} = undef; - $self->{'lexe_template_input'} = undef; - $self->{'lib_template_input'} = undef; - $self->{'dll_template_input'} = undef; - $self->{'idl_defaulted'} = 0; - $self->{'writing_type'} = 0; + $self->{$typecheck} = 0; + $self->{'global_assign'} = {}; + $self->{'files_written'} = []; + $self->{'project_info'} = []; + $self->{'reading_global'} = 0; + $self->{'reading_parent'} = []; + $self->{'dexe_template_input'} = undef; + $self->{'lexe_template_input'} = undef; + $self->{'lib_template_input'} = undef; + $self->{'dll_template_input'} = undef; + $self->{'idl_defaulted'} = 0; + $self->{'writing_type'} = 0; + $self->{'want_dynamic_projects'} = $dynamic; + $self->{'want_static_projects'} = $static; ## Valid component names within a project along with the valid file extensions my(%vc) = ('source_files' => [ "\\.cpp", "\\.cxx", "\\.cc", "\\.c", "\\.C", ], @@ -1049,12 +1053,14 @@ sub write_project { my($prjname) = $self->get_assignment('project_name'); ## Writing the non-static file so set it to 0 - $self->{'writing_type'} = 0; - $self->process_assignment('project_name', - $prjname . $self->get_type_append()); - ($status, $error) = $self->write_output_file($name); + if ($self->{'want_dynamic_projects'}) { + $self->{'writing_type'} = 0; + $self->process_assignment('project_name', + $prjname . $self->get_type_append()); + ($status, $error) = $self->write_output_file($name); + } - if ($status && + if ($status && $self->{'want_static_projects'} && $self->separate_static_project()) { ## Set the project name back to what it originally was $self->process_assignment('project_name', $prjname); diff --git a/bin/MakeProjectCreator/modules/VC6WorkspaceCreator.pm b/bin/MakeProjectCreator/modules/VC6WorkspaceCreator.pm index 86d87530357..5a40aa1d836 100644 --- a/bin/MakeProjectCreator/modules/VC6WorkspaceCreator.pm +++ b/bin/MakeProjectCreator/modules/VC6WorkspaceCreator.pm @@ -104,7 +104,9 @@ sub project_creator { return new VC6ProjectCreator($self->get_global_cfg(), $self->get_include_path(), $self->get_template_override(), - $self->get_ti_override()); + $self->get_ti_override(), + $self->get_dynamic(), + $self->get_static()); } diff --git a/bin/MakeProjectCreator/modules/VC7WorkspaceCreator.pm b/bin/MakeProjectCreator/modules/VC7WorkspaceCreator.pm index f6faf60d5ec..8566e142e74 100644 --- a/bin/MakeProjectCreator/modules/VC7WorkspaceCreator.pm +++ b/bin/MakeProjectCreator/modules/VC7WorkspaceCreator.pm @@ -125,7 +125,9 @@ sub project_creator { return new VC7ProjectCreator($self->get_global_cfg(), $self->get_include_path(), $self->get_template_override(), - $self->get_ti_override()); + $self->get_ti_override(), + $self->get_dynamic(), + $self->get_static()); } diff --git a/bin/MakeProjectCreator/modules/WorkspaceCreator.pm b/bin/MakeProjectCreator/modules/WorkspaceCreator.pm index 318bce329d2..78270ac90bd 100644 --- a/bin/MakeProjectCreator/modules/WorkspaceCreator.pm +++ b/bin/MakeProjectCreator/modules/WorkspaceCreator.pm @@ -35,6 +35,8 @@ sub new { my($inc) = shift; my($template) = shift; my($ti) = shift; + my($dynamic) = shift; + my($static) = shift; my($self) = Creator::new($class, $global, $inc, $template, $ti, 'workspace'); my($typecheck) = $self->{'type_check'}; @@ -45,6 +47,8 @@ sub new { $self->{'project_info'} = {}; $self->{'reading_parent'} = []; $self->{'project_files'} = []; + $self->{'dynamic'} = $dynamic; + $self->{'static'} = $static; return $self; } @@ -300,6 +304,18 @@ sub get_project_info { } +sub get_dynamic { + my($self) = shift; + return $self->{'dynamic'}; +} + + +sub get_static { + my($self) = shift; + return $self->{'static'}; +} + + sub sort_dependencies { my($self) = shift; my($projects) = shift; |