diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2005-05-31 20:48:01 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2005-05-31 20:48:01 +0000 |
commit | 23eb3edd0749476d64eb844d231254cbab91e01b (patch) | |
tree | 396390381e0be2e68790be0ec98b70016b5c585c | |
parent | 7611e8a467a0bd27e02b4a6a7acada6eabfe5b73 (diff) | |
download | MPC-23eb3edd0749476d64eb844d231254cbab91e01b.tar.gz |
ChangeLogTag: Tue May 31 15:45:44 2005 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | modules/TemplateParser.pm | 59 | ||||
-rw-r--r-- | templates/em3.mpd | 4 | ||||
-rw-r--r-- | templates/em3vcp.mpd | 4 | ||||
-rw-r--r-- | templates/vc6.mpd | 4 | ||||
-rw-r--r-- | templates/vc6dsp.mpd | 4 | ||||
-rw-r--r-- | templates/vc7.mpd | 4 | ||||
-rw-r--r-- | templates/vc8.mpd | 4 |
8 files changed, 64 insertions, 34 deletions
@@ -1,3 +1,18 @@ +Tue May 31 15:45:44 2005 Chad Elliott <elliott_c@ociweb.com> + + * modules/TemplateParser.pm: + + Support using flag_overrides() within the context of a foreach. + + * templates/em3vcp.mpd: + * templates/vc6dsp.mpd: + * templates/vc7.mpd: + * templates/vc8.mpd: + + Interpret flag_overrides of the custom_types->dependent setting + as an array instead of a string. This makes things consistent + with non-overridden values of dependent. + Tue May 31 09:46:49 2005 Chad Elliott <elliott_c@ociweb.com> * templates/vc7.mpd: diff --git a/modules/TemplateParser.pm b/modules/TemplateParser.pm index 6123add1..59756902 100644 --- a/modules/TemplateParser.pm +++ b/modules/TemplateParser.pm @@ -384,32 +384,45 @@ sub process_foreach { my(@cmds) = (); my($val) = $self->{'foreach'}->{'vars'}->[$index]; - ## Pull out modifying commands first - while ($val =~ /(\w+)\((.+)\)/) { - my($cmd) = $1; - $val = $2; - if (($keywords{$cmd} & 0x02) != 0) { - push(@cmds, 'perform_' . $cmd); + if ($val =~ /^((\w+),\s*)?flag_overrides\((.*)\)$/) { + my($over) = $self->get_flag_overrides($3); + $name = $2; + if (defined $over) { + $val = $self->create_array($over); + @values = @$val; } - else { - $self->warning("Unable to use $cmd in foreach (no perform_ method)."); + if (!defined $name) { + $name = '__unnamed__'; } } - - ## Get the values for all of the variable names - ## contained within the foreach - my($names) = $self->create_array($val); - foreach my $n (@$names) { - my($vals) = $self->get_value($n); - if (defined $vals && $vals ne '') { - if (!UNIVERSAL::isa($vals, 'ARRAY')) { - $vals = $self->create_array($vals); + else { + ## Pull out modifying commands first + while ($val =~ /(\w+)\((.+)\)/) { + my($cmd) = $1; + $val = $2; + if (($keywords{$cmd} & 0x02) != 0) { + push(@cmds, 'perform_' . $cmd); + } + else { + $self->warning("Unable to use $cmd in foreach (no perform_ method)."); } - push(@values, @$vals); } - if (!defined $name) { - $name = $n; - $name =~ s/s$//; + + ## Get the values for all of the variable names + ## contained within the foreach + my($names) = $self->create_array($val); + foreach my $n (@$names) { + my($vals) = $self->get_value($n); + if (defined $vals && $vals ne '') { + if (!UNIVERSAL::isa($vals, 'ARRAY')) { + $vals = $self->create_array($vals); + } + push(@values, @$vals); + } + if (!defined $name) { + $name = $n; + $name =~ s/s$//; + } } } @@ -981,7 +994,9 @@ sub handle_foreach { push(@{$self->{'lstack'}}, $self->get_line_number()); if (!$self->{'if_skip'}) { my($vname) = undef; - if ($val =~ /([^,]+),(.*)/) { + if ($val =~ /flag_overrides\([^\)]+\)/) { + } + elsif ($val =~ /([^,]+),(.*)/) { $vname = $1; $val = $2; $vname =~ s/^\s+//; diff --git a/templates/em3.mpd b/templates/em3.mpd index 504099b9..7a503557 100644 --- a/templates/em3.mpd +++ b/templates/em3.mpd @@ -310,10 +310,10 @@ SOURCE="<%custom_type->input_file%>" !<%fornotfirst("ELSE")%>IF "$(CFG)" == "<%project_name%> - <%operating_system%> (<%platform%>) <%configuration%>" <%if(flag_overrides(custom_type->input_file, dependent))%> -USERDEP__<%basenoextension(custom_type->input_file)%>="<%flag_overrides(custom_type->input_file, dependent)%><%if(!ends_with(flag_overrides(custom_type->input_file, dependent), .pl))%>.exe<%endif%>"<%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> +USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(dep, flag_overrides(custom_type->input_file, dependent))%>"<%dep%><%if(!ends_with(dep, \.p.))%><%exe_ext%><%endif%>"<%fornotlast(" ")%><%endfor%><%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> <%else%> <%if(custom_type->dependent)%> -USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(custom_type->dependent)%>"<%custom_type->dependent%><%if(!ends_with(custom_type->dependent, \.p.))%>.exe<%endif%>"<%fornotlast(" ")%><%endfor%><%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> +USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(custom_type->dependent)%>"<%custom_type->dependent%><%if(!ends_with(custom_type->dependent, \.p.))%><%exe_ext%><%endif%>"<%fornotlast(" ")%><%endfor%><%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> <%else%> <%if(custom_type->input_file->dependencies)%> USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(custom_type->input_file->dependencies)%>"<%custom_type->input_file->dependencie%>"<%fornotlast(" ")%><%endfor%> diff --git a/templates/em3vcp.mpd b/templates/em3vcp.mpd index 504099b9..7a503557 100644 --- a/templates/em3vcp.mpd +++ b/templates/em3vcp.mpd @@ -310,10 +310,10 @@ SOURCE="<%custom_type->input_file%>" !<%fornotfirst("ELSE")%>IF "$(CFG)" == "<%project_name%> - <%operating_system%> (<%platform%>) <%configuration%>" <%if(flag_overrides(custom_type->input_file, dependent))%> -USERDEP__<%basenoextension(custom_type->input_file)%>="<%flag_overrides(custom_type->input_file, dependent)%><%if(!ends_with(flag_overrides(custom_type->input_file, dependent), .pl))%>.exe<%endif%>"<%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> +USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(dep, flag_overrides(custom_type->input_file, dependent))%>"<%dep%><%if(!ends_with(dep, \.p.))%><%exe_ext%><%endif%>"<%fornotlast(" ")%><%endfor%><%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> <%else%> <%if(custom_type->dependent)%> -USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(custom_type->dependent)%>"<%custom_type->dependent%><%if(!ends_with(custom_type->dependent, \.p.))%>.exe<%endif%>"<%fornotlast(" ")%><%endfor%><%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> +USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(custom_type->dependent)%>"<%custom_type->dependent%><%if(!ends_with(custom_type->dependent, \.p.))%><%exe_ext%><%endif%>"<%fornotlast(" ")%><%endfor%><%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> <%else%> <%if(custom_type->input_file->dependencies)%> USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(custom_type->input_file->dependencies)%>"<%custom_type->input_file->dependencie%>"<%fornotlast(" ")%><%endfor%> diff --git a/templates/vc6.mpd b/templates/vc6.mpd index c7f8e378..05012e32 100644 --- a/templates/vc6.mpd +++ b/templates/vc6.mpd @@ -296,10 +296,10 @@ SOURCE="<%custom_type->input_file%>" !<%fornotfirst("ELSE")%>IF "$(CFG)" == "<%project_name%> - <%platform%> <%configuration%>" <%if(flag_overrides(custom_type->input_file, dependent))%> -USERDEP__<%basenoextension(custom_type->input_file)%>="<%flag_overrides(custom_type->input_file, dependent)%><%if(!ends_with(flag_overrides(custom_type->input_file, dependent), .pl))%>.exe<%endif%>"<%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> +USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(dep, flag_overrides(custom_type->input_file, dependent))%>"<%dep%><%if(!ends_with(dep, \.p.))%><%exe_ext%><%endif%>"<%fornotlast(" ")%><%endfor%><%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> <%else%> <%if(custom_type->dependent)%> -USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(custom_type->dependent)%>"<%custom_type->dependent%><%if(!ends_with(custom_type->dependent, \.p.))%>.exe<%endif%>"<%fornotlast(" ")%><%endfor%><%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> +USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(custom_type->dependent)%>"<%custom_type->dependent%><%if(!ends_with(custom_type->dependent, \.p.))%><%exe_ext%><%endif%>"<%fornotlast(" ")%><%endfor%><%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> <%else%> <%if(custom_type->input_file->dependencies)%> USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(custom_type->input_file->dependencies)%>"<%custom_type->input_file->dependencie%>"<%fornotlast(" ")%><%endfor%> diff --git a/templates/vc6dsp.mpd b/templates/vc6dsp.mpd index c7f8e378..05012e32 100644 --- a/templates/vc6dsp.mpd +++ b/templates/vc6dsp.mpd @@ -296,10 +296,10 @@ SOURCE="<%custom_type->input_file%>" !<%fornotfirst("ELSE")%>IF "$(CFG)" == "<%project_name%> - <%platform%> <%configuration%>" <%if(flag_overrides(custom_type->input_file, dependent))%> -USERDEP__<%basenoextension(custom_type->input_file)%>="<%flag_overrides(custom_type->input_file, dependent)%><%if(!ends_with(flag_overrides(custom_type->input_file, dependent), .pl))%>.exe<%endif%>"<%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> +USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(dep, flag_overrides(custom_type->input_file, dependent))%>"<%dep%><%if(!ends_with(dep, \.p.))%><%exe_ext%><%endif%>"<%fornotlast(" ")%><%endfor%><%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> <%else%> <%if(custom_type->dependent)%> -USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(custom_type->dependent)%>"<%custom_type->dependent%><%if(!ends_with(custom_type->dependent, \.p.))%>.exe<%endif%>"<%fornotlast(" ")%><%endfor%><%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> +USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(custom_type->dependent)%>"<%custom_type->dependent%><%if(!ends_with(custom_type->dependent, \.p.))%><%exe_ext%><%endif%>"<%fornotlast(" ")%><%endfor%><%foreach(custom_type->input_file->dependencies)%> "<%custom_type->input_file->dependencie%>"<%endfor%> <%else%> <%if(custom_type->input_file->dependencies)%> USERDEP__<%basenoextension(custom_type->input_file)%>=<%foreach(custom_type->input_file->dependencies)%>"<%custom_type->input_file->dependencie%>"<%fornotlast(" ")%><%endfor%> diff --git a/templates/vc7.mpd b/templates/vc7.mpd index 3976126d..b311a9ff 100644 --- a/templates/vc7.mpd +++ b/templates/vc7.mpd @@ -252,10 +252,10 @@ Description="Invoking <%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%> on <%custom_type->input_file%>" CommandLine="<%if(custom_type->libpath)%>PATH=%PATH%;<%custom_type->libpath%>
<%endif%><%if(flag_overrides(custom_type->input_file, gendir))%>if not exist <%flag_overrides(custom_type->input_file, gendir)%> mkdir <%flag_overrides(custom_type->input_file, gendir)%>
<%endif%><%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%> <%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> "<%custom_type->input_file%>"<%if(custom_type->output_option)%> <%custom_type->output_option%> "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_files)%><%else%><%custom_type->input_file->output_files%><%endif%>"<%endif%><%if(flag_overrides(custom_type->input_file, postcommand))%><%foreach(custom_type->input_file->output_files)%>
<%flag_overrides(custom_type->input_file, postcommand)%><%endfor%><%else%><%if(custom_type->postcommand)%><%foreach(custom_type->input_file->output_files)%>
<%custom_type->postcommand%><%endfor%><%endif%><%endif%><%if(pch_header)%><%if(custom_type->pch_postrule)%><%foreach(custom_type->input_file->source_output_files)%>
echo #include "<%pch_header%>" > temporary.src
type "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>" >> temporary.src
move /y temporary.src "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>"<%endfor%><%endif%><%endif%>" <%if(flag_overrides(custom_type->input_file, dependent))%> - AdditionalDependencies="<%flag_overrides(custom_type->input_file, dependent)%><%if(!ends_with(flag_overrides(custom_type->input_file, dependent), .pl))%>.exe<%endif%><%foreach(custom_type->input_file->dependencies)%>;<%custom_type->input_file->dependencie%><%endfor%>" + AdditionalDependencies="<%foreach(dep, flag_overrides(custom_type->input_file, dependent))%><%dep%><%if(!ends_with(dep, \.p.))%><%exe_ext%><%endif%><%fornotlast(";")%><%endfor%><%foreach(custom_type->input_file->dependencies)%>;<%custom_type->input_file->dependencie%><%endfor%>" <%else%> <%if(custom_type->dependent)%> - AdditionalDependencies="<%foreach(custom_type->dependent)%><%custom_type->dependent%><%if(!ends_with(custom_type->dependent, \.p.))%>.exe<%endif%><%fornotlast(";")%><%endfor%><%foreach(custom_type->input_file->dependencies)%>;<%custom_type->input_file->dependencie%><%endfor%>" + AdditionalDependencies="<%foreach(custom_type->dependent)%><%custom_type->dependent%><%if(!ends_with(custom_type->dependent, \.p.))%><%exe_ext%><%endif%><%fornotlast(";")%><%endfor%><%foreach(custom_type->input_file->dependencies)%>;<%custom_type->input_file->dependencie%><%endfor%>" <%else%> <%if(custom_type->input_file->dependencies)%> AdditionalDependencies="<%foreach(custom_type->input_file->dependencies)%><%custom_type->input_file->dependencie%><%fornotlast(";")%><%endfor%>" diff --git a/templates/vc8.mpd b/templates/vc8.mpd index 47f7c11c..a71fa69a 100644 --- a/templates/vc8.mpd +++ b/templates/vc8.mpd @@ -597,10 +597,10 @@ Description="Invoking <%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%> on <%custom_type->input_file%>" CommandLine="<%if(custom_type->libpath)%>PATH=%PATH%;<%custom_type->libpath%>
<%endif%><%if(flag_overrides(custom_type->input_file, gendir))%>if not exist <%flag_overrides(custom_type->input_file, gendir)%> mkdir <%flag_overrides(custom_type->input_file, gendir)%>
<%endif%><%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%> <%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> "<%custom_type->input_file%>"<%if(custom_type->output_option)%> <%custom_type->output_option%> "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_files)%><%else%><%custom_type->input_file->output_files%><%endif%>"<%endif%><%if(flag_overrides(custom_type->input_file, postcommand))%><%foreach(custom_type->input_file->output_files)%>
<%flag_overrides(custom_type->input_file, postcommand)%><%endfor%><%else%><%if(custom_type->postcommand)%><%foreach(custom_type->input_file->output_files)%>
<%custom_type->postcommand%><%endfor%><%endif%><%endif%><%if(pch_header)%><%if(custom_type->pch_postrule)%><%foreach(custom_type->input_file->source_output_files)%>
echo #include "<%pch_header%>" > temporary.src
type "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>" >> temporary.src
move /y temporary.src "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>"<%endfor%><%endif%><%endif%>" <%if(flag_overrides(custom_type->input_file, dependent))%> - AdditionalDependencies="<%flag_overrides(custom_type->input_file, dependent)%><%if(!ends_with(flag_overrides(custom_type->input_file, dependent), .pl))%>.exe<%endif%><%foreach(custom_type->input_file->dependencies)%>;<%custom_type->input_file->dependencie%><%endfor%>" + AdditionalDependencies="<%foreach(dep, flag_overrides(custom_type->input_file, dependent))%><%dep%><%if(!ends_with(dep, \.p.))%><%exe_ext%><%endif%><%fornotlast(";")%><%endfor%><%foreach(custom_type->input_file->dependencies)%>;<%custom_type->input_file->dependencie%><%endfor%>" <%else%> <%if(custom_type->dependent)%> - AdditionalDependencies="<%foreach(custom_type->dependent)%><%custom_type->dependent%><%if(!ends_with(custom_type->dependent, \.p.))%>.exe<%endif%><%fornotlast(";")%><%endfor%><%foreach(custom_type->input_file->dependencies)%>;<%custom_type->input_file->dependencie%><%endfor%>" + AdditionalDependencies="<%foreach(custom_type->dependent)%><%custom_type->dependent%><%if(!ends_with(custom_type->dependent, \.p.))%><%exe_ext%><%endif%><%fornotlast(";")%><%endfor%><%foreach(custom_type->input_file->dependencies)%>;<%custom_type->input_file->dependencie%><%endfor%>" <%else%> <%if(custom_type->input_file->dependencies)%> AdditionalDependencies="<%foreach(custom_type->input_file->dependencies)%><%custom_type->input_file->dependencie%><%fornotlast(";")%><%endfor%>" |