diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2002-09-13 13:59:05 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2002-09-13 13:59:05 +0000 |
commit | b45759a852fc4542f7e9071328ae897fa4e56784 (patch) | |
tree | 8f8add25eae524fd720e86690442ea8dab5bb3c6 | |
parent | cec748185e94752af740feaa77ef23940d530fbd (diff) | |
download | MPC-b45759a852fc4542f7e9071328ae897fa4e56784.tar.gz |
ChangeLogTag: Fri Sep 13 08:57:03 2002 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r-- | modules/Creator.pm | 16 | ||||
-rw-r--r-- | modules/Driver.pm | 126 | ||||
-rw-r--r-- | modules/ProjectCreator.pm | 100 | ||||
-rw-r--r-- | modules/TemplateParser.pm | 64 | ||||
-rw-r--r-- | modules/WorkspaceCreator.pm | 5 | ||||
-rw-r--r-- | templates/em3.mpd | 27 | ||||
-rw-r--r-- | templates/em3vcp.mpd | 27 | ||||
-rw-r--r-- | templates/nmake.mpd | 14 | ||||
-rw-r--r-- | templates/vc6.mpd | 27 | ||||
-rw-r--r-- | templates/vc6dsp.mpd | 27 | ||||
-rw-r--r-- | templates/vc7.mpd | 7 |
11 files changed, 385 insertions, 55 deletions
diff --git a/modules/Creator.pm b/modules/Creator.pm index 83a2a8ed..af4a5de7 100644 --- a/modules/Creator.pm +++ b/modules/Creator.pm @@ -31,6 +31,8 @@ sub new { my($template) = shift; my($ti) = shift; my($relative) = shift; + my($addtemp) = shift; + my($addproj) = shift; my($progress) = shift; my($type) = shift; my($self) = Parser::new($class); @@ -45,6 +47,8 @@ sub new { $self->{'include_path'} = $inc; $self->{'current_input'} = ""; $self->{'progress'} = $progress; + $self->{'addtemp'} = $addtemp; + $self->{'addproj'} = $addproj; return $self; } @@ -325,6 +329,18 @@ sub get_progress_callback { } +sub get_addtemp { + my($self) = shift; + return $self->{'addtemp'}; +} + + +sub get_addproj { + my($self) = shift; + return $self->{'addproj'}; +} + + # ************************************************************ # Virtual Methods To Be Overridden # ************************************************************ diff --git a/modules/Driver.pm b/modules/Driver.pm index d4d64fc0..b1aa3d0a 100644 --- a/modules/Driver.pm +++ b/modules/Driver.pm @@ -30,7 +30,7 @@ sub new { my(@creators) = @_; my($self) = bless {'path' => $path, 'name' => $name, - 'version' => 1.1, + 'version' => 1.2, 'types' => {}, 'creators' => \@creators, 'signif' => 3, @@ -49,15 +49,16 @@ sub usageAndExit { if (defined $line) { print STDERR "$line\n"; } + my($spaces) = (" " x (length($base) + 8)); print STDERR "$base v$self->{'version'}\n" . "Usage: $base [-global <file>] [-include <directory>]\n" . - (" " x (length($base) + 8)) . - "[-ti <dll | lib | dll_exe | lib_exe>:<file>]\n" . - (" " x (length($base) + 8)) . "[-template <file>] " . + $spaces . "[-ti <dll | lib | dll_exe | lib_exe>:<file>]\n" . + $spaces . "[-template <file>] " . "[-dynamic_only] [-static_only]\n" . - (" " x (length($base) + 8)) . "[-relative NAME=VAR] " . - "[-noreldefs]\n" . - (" " x (length($base) + 8)) . "[-type <"; + $spaces . "[-relative NAME=VAR] [-noreldefs]\n" . + $spaces . "[-value_template <NAME+=VAL | NAME=VAL | NAME-=VAL>]\n" . + $spaces . "[-value_project <NAME+=VAL | NAME=VAL | NAME-=VAL>]\n" . + $spaces . "[-type <"; my(@keys) = sort keys %{$self->{'types'}}; for(my $i = 0; $i <= $#keys; $i++) { @@ -67,28 +68,40 @@ sub usageAndExit { } } print STDERR ">]\n" . - (" " x (length($base) + 8)) . "[files]\n\n"; + $spaces . "[files]\n\n"; my($default) = lc(substr($self->{'default'}, 0, $self->{'signif'})); 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" . -" -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" . -" -relative Any \$() variable in an mpc that is matched to NAME\n" . -" is replaced by VAR only if VAR can be made into a\n" . -" relative path based on the current working directory.\n" . -" -noreldefs Do not try to generate default relative definitions.\n" . -" -type Specifies the type of project file to generate. This\n" . -" option can be used multiple times to generate multiple\n" . -" types. If -type is not used, it defaults to '$default'.\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" . +" -relative Any \$() variable in an mpc that is matched to NAME\n" . +" is replaced by VAR only if VAR can be made into a\n" . +" relative path based on the current working directory.\n" . +" -noreldefs Do not try to generate default relative definitions.\n" . +" -value_template This option allows modification of a template input\n" . +" name value pair. Use += to add VAL to the NAME's\n" . +" value. Use -= to subtract and = to override the value.\n" . +" It is important to note that this will only modify\n" . +" existing template input name value pairs and can not\n" . +" be used to introduce new name value pairs.\n" . +" -value_project This option allows modification of a project variable\n" . +" assignment . Use += to add VAL to the NAME's value.\n" . +" Use -= to subtract and = to override the value.\n" . +" This can be used to introduce new name value pairs to\n" . +" a project. However, it must be a valid project\n" . +" assignment.\n" . +" -type Specifies the type of project file to generate. This\n" . +" option can be used multiple times to generate multiple\n" . +" types. If -type is not used, it defaults to '$default'.\n"; exit(0); } @@ -129,6 +142,8 @@ sub run { my($signif) = $self->{'signif'}; my(%relative) = (); my($reldefs) = 1; + my(%addtemp) = (); + my(%addproj) = (); ## Dynamically load in each perl module and set up ## the type tags and project creators @@ -221,6 +236,64 @@ sub run { } } } + elsif ($arg eq '-value_template') { + $i++; + my($value) = $args[$i]; + if (!defined $value) { + $self->usageAndExit("-value_template requires a variable assignment argument"); + } + else { + if ($value =~ /(\w+)\s*([\-+]?=)\s*(.*)/) { + my($name) = $1; + my($op) = $2; + my($val) = $3; + $val =~ s/^\s+//; + $val =~ s/\s+$//; + if ($op eq "+=") { + $op = 1; + } + elsif ($op eq "-=") { + $op = -1; + } + else { + $op = 0; + } + $addtemp{$name} = [$op, $val]; + } + else { + $self->usageAndExit("Invalid option to -value_template"); + } + } + } + elsif ($arg eq '-value_project') { + $i++; + my($value) = $args[$i]; + if (!defined $value) { + $self->usageAndExit("-value_project requires a variable assignment argument"); + } + else { + if ($value =~ /(\w+)\s*([\-+]?=)\s*(.*)/) { + my($name) = $1; + my($op) = $2; + my($val) = $3; + $val =~ s/^\s+//; + $val =~ s/\s+$//; + if ($op eq "+=") { + $op = 1; + } + elsif ($op eq "-=") { + $op = -1; + } + else { + $op = 0; + } + $addproj{$name} = [$op, $val]; + } + else { + $self->usageAndExit("Invalid option to -value_project"); + } + } + } elsif ($arg eq '-dynamic_only') { $static = 0; $dynamic = 1; @@ -273,6 +346,7 @@ sub run { foreach my $name (@generators) { my($generator) = $name->new($global, \@include, $template, \%ti, $dynamic, $static, \%relative, + \%addtemp, \%addproj, (-t 1 ? \&progress : undef)); print "Generating output using " . ($file eq "" ? "default input" : $file) . "\n"; diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm index 4448aa27..c05e82fe 100644 --- a/modules/ProjectCreator.pm +++ b/modules/ProjectCreator.pm @@ -78,9 +78,12 @@ sub new { my($dynamic) = shift; my($static) = shift; my($relative) = shift; + my($addtemp) = shift; + my($addproj) = shift; my($progress) = shift; my($self) = Creator::new($class, $global, $inc, $template, $ti, $relative, + $addtemp, $addproj, $progress, 'project'); $self->{$self->{'type_check'}} = 0; @@ -94,6 +97,7 @@ sub new { $self->{'lib_template_input'} = undef; $self->{'dll_template_input'} = undef; $self->{'idl_defaulted'} = 0; + $self->{'source_defaulted'} = 0; $self->{'writing_type'} = 0; $self->{'want_dynamic_projects'} = $dynamic; $self->{'want_static_projects'} = $static; @@ -164,16 +168,42 @@ sub parse_line { ## Fill in all the default values $self->generate_defaults(); - ## End of project; Write out the file. - $self->write_project(); + ## Perform any additions, subtractions + ## or overrides for the project values. + my($addproj) = $self->get_addproj(); + foreach my $ap (keys %$addproj) { + if (defined $validNames{$ap}) { + my($val) = $$addproj{$ap}; + if ($$val[0] > 0) { + $self->process_assignment_add($ap, $$val[1]); + } + elsif ($$val[0] < 0) { + $self->process_assignment_sub($ap, $$val[1]); + } + else { + $self->process_assignment($ap, $$val[1]); + } + } + else { + $errorString = "ERROR: Invalid " . + "assignment modification name: $ap"; + $status = 0; + } + } - foreach my $key (keys %{$self->{'valid_components'}}) { - delete $self->{$key}; + if ($status) { + ## End of project; Write out the file. + $self->write_project(); + + foreach my $key (keys %{$self->{'valid_components'}}) { + delete $self->{$key}; + } + $self->{'assign'} = {}; } - $self->{'assign'} = {}; } - $self->{$typecheck} = 0; - $self->{'idl_defaulted'} = 0; + $self->{$typecheck} = 0; + $self->{'idl_defaulted'} = 0; + $self->{'source_defaulted'} = 0; } else { ## Project Beginning @@ -538,6 +568,20 @@ sub read_template_input { } +sub already_added { + my($self) = shift; + my($array) = shift; + my($name) = shift; + + foreach my $file (@$array) { + if ($file eq $name) { + return 1; + } + } + return 0; +} + + sub add_idl_generated { my($self) = shift; my($tag) = shift; @@ -556,7 +600,10 @@ sub add_idl_generated { my($file) = $i; $file =~ s/\.idl$//; foreach my $ending (@{$self->{'skeleton_endings'}}) { - push(@added, "$file$ending$wanted"); + my($created) = "$file$ending$wanted"; + if (!$self->already_added($array, $created)) { + push(@added, $created); + } } } ## Put the generated files at the front @@ -699,7 +746,9 @@ sub sift_files { } if (!$exclude) { - push(@$array, $file); + if (!$self->already_added($array, $file)) { + push(@$array, $file); + } } last; } @@ -713,7 +762,9 @@ sub sift_files { foreach my $save (@saved) { my($file) = $self->escape_regex_special($save); if ($pjname =~ /$file/ || $file =~ /$pjname/) { - push(@$array, $file); + if (!$self->already_added($array, $file)) { + push(@$array, $file); + } } } } @@ -750,7 +801,9 @@ sub generate_default_components { $self->sift_files(\@gen, $exts, $pchh, $pchc, $tag, \@built); } else { - push(@built, $file); + if (!$self->already_added(\@built, $file)) { + push(@built, $file); + } } } $$comps{$comp} = \@built; @@ -781,17 +834,22 @@ sub generate_default_components { my(@copy) = @$array; my(@exts) = $self->generated_source_extensions($tag); + $self->{'source_defaulted'} = 1; @$array = (); foreach my $file (@copy) { my($found) = 0; foreach my $ext (@exts) { if ($file =~ /$ext$/) { + ## No need to check for previously added files + ## here since there are none. push(@front, $file); $found = 1; last; } } if (!$found) { + ## No need to check for previously added files + ## here since there are none. push(@$array, $file); } } @@ -920,13 +978,12 @@ sub add_source_corresponding_component_files { my($c) = $cpp; $c =~ s/\.[^\.]+$//; foreach my $file (@$array) { - my($w) = $file; my($added) = $c; - if ($w =~ /(\.[^\.]+)$/) { + if ($file =~ /(\.[^\.]+)$/) { $added .= $1; } - if ($added eq $w) { + if ($added eq $file) { $found = 1; last; } @@ -939,8 +996,11 @@ sub add_source_corresponding_component_files { $ext =~ s/\\//g; ## If the file is readable - if (-r "$c$ext") { - push(@$array, "$c$ext"); + my($file) = "$c$ext"; + if (-r $file) { + if (!$self->already_added($array, $file)) { + push(@$array, $file); + } $added = 1; last; } @@ -956,7 +1016,11 @@ sub add_source_corresponding_component_files { if ($c =~ /^$idl$ending$/) { my($ext) = $$vc{$tag}->[0]; $ext =~ s/\\//g; - push(@$array, "$c$ext"); + my($file) = "$c$ext"; + if (!$self->already_added($array, $file)) { + push(@$array, $file); + } + $added = 1; last; } } @@ -1008,7 +1072,7 @@ sub generate_defaults { my($comps) = $$names{$name}; foreach my $comp (keys %$comps) { my($array) = $$comps{$comp}; - if (!defined $$array[0]) { + if (!defined $$array[0] || $self->{'source_defaulted'}) { $self->generate_default_components(\@files, $tag); } } diff --git a/modules/TemplateParser.pm b/modules/TemplateParser.pm index 1fb9cb0b..81b10ec9 100644 --- a/modules/TemplateParser.pm +++ b/modules/TemplateParser.pm @@ -138,20 +138,71 @@ sub append_current { } +sub adjust_value { + my($self) = shift; + my($name) = shift; + my($value) = shift; + + ## Perform any additions, subtractions + ## or overrides for the template values. + my($addtemp) = $self->{'prjc'}->get_addtemp(); + foreach my $at (keys %$addtemp) { + if ($at eq $name) { + my($val) = $$addtemp{$at}; + if ($$val[0] > 0) { + if (UNIVERSAL::isa($value, 'ARRAY')) { + $value = [ $$val[1], @$value ]; + } + else { + $value = "$$val[1] $value"; + } + } + elsif ($$val[0] < 0) { + my($parts) = undef; + if (UNIVERSAL::isa($value, 'ARRAY')) { + my(@copy) = @$value; + $parts = \@copy; + } + else { + $parts = $self->create_array($value); + } + + $value = ""; + foreach my $part (@$parts) { + if ($part ne $$val[1] && $part ne "") { + $value .= "$part "; + } + } + $value =~ s/^\s+//; + $value =~ s/\s+$//; + } + else { + $value = $$val[1]; + } + } + } + + return $value; +} + + sub set_current_values { my($self) = shift; my($name) = shift; ## If any value within a foreach matches the name ## of a hash table within the template input we will - ## set the values of that hash tablein the current scope + ## set the values of that hash table in the current scope my($ti) = $self->{'prjc'}->get_template_input(); if (defined $ti) { my($counter) = $self->{'foreach'}->{'count'}; my($value) = $ti->get_value($name); - if (defined $value && $counter >= 0 && - UNIVERSAL::isa($value, 'HASH')) { - $self->{'foreach'}->{'temp_scope'}->[$counter] = $value; + if (defined $value && $counter >= 0 && UNIVERSAL::isa($value, 'HASH')) { + my(%copy) = (); + foreach my $key (keys %$value) { + $copy{$key} = $self->adjust_value($key, $$value{$key}); + } + $self->{'foreach'}->{'temp_scope'}->[$counter] = \%copy; } } } @@ -251,6 +302,9 @@ sub get_value { my($ti) = $self->{'prjc'}->get_template_input(); if (defined $ti) { $value = $ti->get_value($name); + if (defined $value) { + $value = $self->adjust_value($name, $value); + } } if (!defined $value) { @@ -362,6 +416,8 @@ sub process_foreach { $$scope{'forlast'} = 1; $$scope{'fornotlast'} = 0; } + ## We don't use adjust_value here because these names + ## are generated from a foreach and should not be adjusted. $$scope{$inner} = $value; ## A tiny hack for VC7 diff --git a/modules/WorkspaceCreator.pm b/modules/WorkspaceCreator.pm index 592cf092..28054197 100644 --- a/modules/WorkspaceCreator.pm +++ b/modules/WorkspaceCreator.pm @@ -38,9 +38,12 @@ sub new { my($dynamic) = shift; my($static) = shift; my($relative) = shift; + my($addtemp) = shift; + my($addproj) = shift; my($progress) = shift; my($self) = Creator::new($class, $global, $inc, $template, $ti, $relative, + $addtemp, $addproj, $progress, 'workspace'); my($typecheck) = $self->{'type_check'}; @@ -386,6 +389,8 @@ sub project_creator { $self->get_dynamic(), $self->get_static(), $self->get_relative(), + $self->get_addtemp(), + $self->get_addproj(), $self->get_progress_callback()); } diff --git a/templates/em3.mpd b/templates/em3.mpd index 98ba9aaa..3e498fb3 100644 --- a/templates/em3.mpd +++ b/templates/em3.mpd @@ -187,8 +187,32 @@ SOURCE=.\<%idl_file%> # PROP Ignore_Default_Tool 1 # Begin Custom Build - Invoking TAO_IDL Compiler on $(InputPath) InputPath=.\<%idl_file%> -InputName=<%noextension(idl_file)%> +InputName=<%basenoextension(idl_file)%> +InputDir=<%dirname(idl_file)%> +<%if(dirname_found)%> +BuildCmds= \ + cd $(InputDir) \ + <%tao_idl_exe("$(ACE_ROOT)\\bin\\tao_idl")%> <%idlflags("-Sc")%> <%basename(idl_file)%> + +"$(InputDir)\$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +<%else%> BuildCmds= \ <%tao_idl_exe("$(ACE_ROOT)\\bin\\tao_idl")%> <%idlflags("-Sc")%> $(InputPath) @@ -218,6 +242,7 @@ BuildCmds= \ "$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) +<%endif%> # End Custom Build <%endfor%> diff --git a/templates/em3vcp.mpd b/templates/em3vcp.mpd index 98ba9aaa..3e498fb3 100644 --- a/templates/em3vcp.mpd +++ b/templates/em3vcp.mpd @@ -187,8 +187,32 @@ SOURCE=.\<%idl_file%> # PROP Ignore_Default_Tool 1 # Begin Custom Build - Invoking TAO_IDL Compiler on $(InputPath) InputPath=.\<%idl_file%> -InputName=<%noextension(idl_file)%> +InputName=<%basenoextension(idl_file)%> +InputDir=<%dirname(idl_file)%> +<%if(dirname_found)%> +BuildCmds= \ + cd $(InputDir) \ + <%tao_idl_exe("$(ACE_ROOT)\\bin\\tao_idl")%> <%idlflags("-Sc")%> <%basename(idl_file)%> + +"$(InputDir)\$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +<%else%> BuildCmds= \ <%tao_idl_exe("$(ACE_ROOT)\\bin\\tao_idl")%> <%idlflags("-Sc")%> $(InputPath) @@ -218,6 +242,7 @@ BuildCmds= \ "$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) +<%endif%> # End Custom Build <%endfor%> diff --git a/templates/nmake.mpd b/templates/nmake.mpd index 4d03aed9..8efce07c 100644 --- a/templates/nmake.mpd +++ b/templates/nmake.mpd @@ -196,13 +196,23 @@ SOURCE=.\<%idl_file%> !<%fornotfirst("ELSE")%>IF "$(CFG)" == "<%platform%> <%configuration%>" InputPath=.\<%idl_file%> -InputName=<%noextension(idl_file)%> - +InputName=<%basenoextension(idl_file)%> +InputDir=<%dirname(idl_file)%> + +<%if(dirname_found)%> +".\$(InputDir)\$(InputName)C.h" ".\$(InputDir)\$(InputName)C.i" ".\$(InputDir)\$(InputName)C.cpp" ".\$(InputDir)\$(InputName)S.h" ".\$(InputDir)\$(InputName)S.i" ".\$(InputDir)\$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + <<tempfile.bat + @echo off + cd $(InputDir) + <%tao_idl_exe("$(ACE_ROOT)\\bin\\tao_idl")%> <%idlflags("-Sc")%> <%basename(idl_file)%> +<< +<%else%> ".\$(InputName)C.h" ".\$(InputName)C.i" ".\$(InputName)C.cpp" ".\$(InputName)S.h" ".\$(InputName)S.i" ".\$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" <<tempfile.bat @echo off <%tao_idl_exe("$(ACE_ROOT)\\bin\\tao_idl")%> <%idlflags("-Sc")%> $(InputPath) << +<%endif%> <%endfor%> !ENDIF diff --git a/templates/vc6.mpd b/templates/vc6.mpd index fd2f4d1c..77343f53 100644 --- a/templates/vc6.mpd +++ b/templates/vc6.mpd @@ -180,8 +180,32 @@ SOURCE=.\<%idl_file%> # PROP Ignore_Default_Tool 1 # Begin Custom Build - Invoking TAO_IDL Compiler on $(InputPath) InputPath=.\<%idl_file%> -InputName=<%noextension(idl_file)%> +InputName=<%basenoextension(idl_file)%> +InputDir=<%dirname(idl_file)%> +<%if(dirname_found)%> +BuildCmds= \ + cd $(InputDir) \ + <%tao_idl_exe("$(ACE_ROOT)\\bin\\tao_idl")%> <%idlflags("-Sc")%> <%basename(idl_file)%> + +"$(InputDir)\$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +<%else%> BuildCmds= \ <%tao_idl_exe("$(ACE_ROOT)\\bin\\tao_idl")%> <%idlflags("-Sc")%> $(InputPath) @@ -202,6 +226,7 @@ BuildCmds= \ "$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) +<%endif%> # End Custom Build diff --git a/templates/vc6dsp.mpd b/templates/vc6dsp.mpd index fd2f4d1c..77343f53 100644 --- a/templates/vc6dsp.mpd +++ b/templates/vc6dsp.mpd @@ -180,8 +180,32 @@ SOURCE=.\<%idl_file%> # PROP Ignore_Default_Tool 1 # Begin Custom Build - Invoking TAO_IDL Compiler on $(InputPath) InputPath=.\<%idl_file%> -InputName=<%noextension(idl_file)%> +InputName=<%basenoextension(idl_file)%> +InputDir=<%dirname(idl_file)%> +<%if(dirname_found)%> +BuildCmds= \ + cd $(InputDir) \ + <%tao_idl_exe("$(ACE_ROOT)\\bin\\tao_idl")%> <%idlflags("-Sc")%> <%basename(idl_file)%> + +"$(InputDir)\$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(InputDir)\$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +<%else%> BuildCmds= \ <%tao_idl_exe("$(ACE_ROOT)\\bin\\tao_idl")%> <%idlflags("-Sc")%> $(InputPath) @@ -202,6 +226,7 @@ BuildCmds= \ "$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) +<%endif%> # End Custom Build diff --git a/templates/vc7.mpd b/templates/vc7.mpd index 1ed72102..476b893d 100644 --- a/templates/vc7.mpd +++ b/templates/vc7.mpd @@ -150,8 +150,13 @@ Name="<%configuration%>|<%platform%>"> <Tool Name="VCCustomBuildTool" - Description="Invoking TAO_IDL Compiler on <%idl_file%>" + Description="Invoking TAO_IDL Compiler on <%dirname(idl_file)%>" +<%if(dirname_found)%> + CommandLine="cd <%dirname(idl_file)%> +<%tao_idl_exe("$(ACE_ROOT)\\bin\\tao_idl")%> <%idlflags("-Sc")%> <%basename(idl_file)%>" +<%else%> CommandLine="<%tao_idl_exe("$(ACE_ROOT)\\bin\\tao_idl")%> <%idlflags("-Sc")%> <%idl_file%>" +<%endif%> Outputs="<%noextension(idl_file)%>C.h;<%noextension(idl_file)%>C.i;<%noextension(idl_file)%>C.cpp;<%noextension(idl_file)%>S.h;<%noextension(idl_file)%>S.i;<%noextension(idl_file)%>S.cpp"/> </FileConfiguration> <%endfor%> |