diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2005-07-02 15:57:35 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2005-07-02 15:57:35 +0000 |
commit | 94ded8b0b3d01a8b926e816af2ce0fa295a03e86 (patch) | |
tree | 587e8beab1dffd6451e7143cd6d5beec51f6291f | |
parent | 4c3f8a2c9fdc266b5ec4251c3823c4d117cb948c (diff) | |
download | MPC-94ded8b0b3d01a8b926e816af2ce0fa295a03e86.tar.gz |
ChangeLogTag: Sat Jul 2 10:57:13 2005 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r-- | ChangeLog | 29 | ||||
-rw-r--r-- | modules/GHSProjectCreator.pm | 19 | ||||
-rw-r--r-- | modules/ProjectCreator.pm | 77 | ||||
-rw-r--r-- | templates/bmake.mpd | 2 | ||||
-rw-r--r-- | templates/ghs.mpd | 23 | ||||
-rw-r--r-- | templates/make.mpd | 2 | ||||
-rw-r--r-- | templates/nmake.mpd | 2 |
7 files changed, 97 insertions, 57 deletions
@@ -1,3 +1,32 @@ +Sat Jul 2 10:57:13 2005 Chad Elliott <elliott_c@ociweb.com> + + * modules/GHSProjectCreator.pm: + + Corrected a problem with determining the reltop value. + + * modules/ProjectCreator.pm: + + Fixed specific and conditional where multiple negated project types + are used. It would only look at the first type and decide that + the current project type wasn't negated. + + When '!' was combined with a wildcard, MPC wasn't adding the files + that didn't match if the user had specified at least one file (in + addition to the negated wildcard). + + * templates/bmake.mpd: + * templates/make.mpd: + + Moved the local marker to a location after the all target. + + * templates/ghs.mpd: + + Fixed custom build support. + + * templates/nmake.mpd: + + Correctly support the use of dllout. + Fri Jul 1 10:03:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl> * templates/bmake.mpd: diff --git a/modules/GHSProjectCreator.pm b/modules/GHSProjectCreator.pm index 54dca66c..6fef3dea 100644 --- a/modules/GHSProjectCreator.pm +++ b/modules/GHSProjectCreator.pm @@ -18,6 +18,12 @@ use vars qw(@ISA); @ISA = qw(ProjectCreator); # ************************************************************ +# Data Section +# ************************************************************ + +my($startre) = undef; + +# ************************************************************ # Subroutine Section # ************************************************************ @@ -44,13 +50,15 @@ sub fill_value { my($name) = shift; my($value) = undef; + if (!defined $startre) { + $startre = $self->escape_regex_special($self->getstartdir()); + } + if ($name =~ /^reltop_(\w+)/) { $value = $self->relative($self->get_assignment($1)); - if (defined $value && - ($value =~ /^\.\.?$/ || $value =~ /^\.\.?\//)) { - my($top) = $self->escape_regex_special($self->getstartdir()); + if (defined $value) { my($part) = $self->getcwd(); - $part =~ s/^$top[\/]?//; + $part =~ s/^$startre[\/]?//; if ($part ne '') { if ($value eq '.') { $value = $part; @@ -62,9 +70,8 @@ sub fill_value { } } elsif ($name eq 'reltop') { - my($top) = $self->escape_regex_special($self->getstartdir()); $value = $self->getcwd(); - $value =~ s/^$top[\/]?//; + $value =~ s/^$startre[\/]?//; if ($value eq '') { $value = '.'; } diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm index fbf3c6bb..f64cb1d8 100644 --- a/modules/ProjectCreator.pm +++ b/modules/ProjectCreator.pm @@ -490,6 +490,33 @@ sub begin_project { } +sub get_process_project_type { + my($self) = shift; + my($types) = shift; + my($type) = ''; + my($defcomp) = $self->get_default_component_name(); + + foreach my $t (split(/\s*,\s*/, $types)) { + my($not) = ($t =~ s/^!\s*//); + if ($not) { + if ($t eq $self->{'pctype'}) { + $type = ''; + last; + } + else { + $type = $self->{'pctype'}; + } + } + elsif ($t eq $self->{'pctype'} || $t eq $defcomp) { + $type = $t; + last; + } + } + + return $type; +} + + sub parse_line { my($self) = shift; my($ih) = shift; @@ -694,29 +721,16 @@ sub parse_line { ($status, $errorString) = $self->parse_verbatim($ih, $type, $loc); } elsif ($comp eq 'specific') { - my($scope_parsed) = 0; - my($defcomp) = $self->get_default_component_name(); - foreach my $type (split(/\s*,\s*/, $name)) { - my($not) = ($type =~ s/^!\s*//); - if ($not) { - if ($type eq $self->{'pctype'}) { - $type = ''; - } - else { - $type = $self->{'pctype'}; - } - } - if ($type eq $self->{'pctype'} || $type eq $defcomp) { - ($status, $errorString) = $self->parse_scope( - $ih, $values[1], $type, - $self->{'valid_names'}, - $self->get_assignment_hash(), - {}); - $scope_parsed = 1; - last; - } + my($type) = $self->get_process_project_type($name); + if ($type eq $self->{'pctype'} || + $type eq $self->get_default_component_name()) { + ($status, $errorString) = $self->parse_scope( + $ih, $values[1], $type, + $self->{'valid_names'}, + $self->get_assignment_hash(), + {}); } - if (!$scope_parsed) { + else { ## We still need to parse the scope, but we will be ## throwing away whatever is processed. However, it ## could still be invalid code that will cause an error. @@ -1002,21 +1016,10 @@ sub parse_conditional { my($status) = 1; my($error) = undef; my($add) = 0; + my($type) = $self->get_process_project_type($types); - foreach my $type (split(/\s*,\s*/, $types)) { - my($not) = ($type =~ s/^!\s*//); - if ($not) { - if ($type eq $self->{'pctype'}) { - $type = ''; - } - else { - $type = $self->{'pctype'}; - } - } - if ($type eq $self->{'pctype'}) { - $add = 1; - last; - } + if ($type eq $self->{'pctype'}) { + $add = 1; } while(<$fh>) { @@ -1186,7 +1189,7 @@ sub parse_components { ## If we didn't encounter an error, didn't have any files explicitly ## listed and we attempted to exclude files, then we need to find the ## set of files that don't match the excluded files and add them. - if ($status && $count == 0 && defined $grname) { + if ($status && $#exclude != -1 && defined $grname) { my($alldir) = $self->get_assignment('recurse') || $flags{'recurse'}; my(@files) = $self->generate_default_file_list('.', \@exclude, $alldir); $self->sift_files(\@files, diff --git a/templates/bmake.mpd b/templates/bmake.mpd index f43d2334..e12c4efe 100644 --- a/templates/bmake.mpd +++ b/templates/bmake.mpd @@ -189,7 +189,6 @@ all:<%if(postbuild)%> __postbuild__<%endif%> @-rem <%endif%> -<%marker(local)%> <%if(custom_types)%> GENERATED_DIRTY =<%foreach(custom_types)%><%foreach(custom_type->input_files)%><%if(custom_type->input_file->output_files)%><%foreach(custom_type->input_file->output_files)%> <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%endfor%><%endif%><%endfor%><%endfor%> <%foreach(custom_types)%> @@ -326,4 +325,5 @@ __postbuild__: @<%eval(postbuild)%> <%endif%> +<%marker(local)%> <%marker(bottom)%> diff --git a/templates/ghs.mpd b/templates/ghs.mpd index 90214ddc..a005ebff 100644 --- a/templates/ghs.mpd +++ b/templates/ghs.mpd @@ -21,38 +21,39 @@ default: <%endif%> <%foreach(custom_types)%> <%foreach(custom_type->input_files)%> +<%custom_type->input_file%> + custom + :custom_processor.name=echo <%if(custom_type->input_file->output_files)%> :depends=<%if(flag_overrides(custom_type->input_file, dependent))%><%foreach(dep, flag_overrides(custom_type->input_file, dependent))%><%dep%><%if(!ends_with(dep, \.p.))%><%exe_ext%><%endif%> <%endfor%><%else%><%foreach(custom_type->dependent)%><%custom_type->dependent%><%if(!ends_with(custom_type->dependent, \.p.))%><%exe_ext%><%endif%> <%endfor%><%endif%><%custom_type->input_file%><%if(custom_type->input_file->dependencies)%> <%custom_type->input_file->dependencies%><%endif%> <%if(flag_overrides(custom_type->input_file, gendir))%> - :preexec=<%mkdir("mkdir -p")%> <%flag_overrides(custom_type->input_file, gendir)%><%postmkdir%> + :preexec=cd <%reltop%>; <%mkdir("mkdir -p")%> <%flag_overrides(custom_type->input_file, gendir)%><%postmkdir%> <%endif%> <%if(custom_type->output_option)%> <%foreach(custom_type->input_file->output_files)%> - :preexec=<%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%> <%custom_type->input_file->output_file%><%endif%> + :preexec=cd <%reltop%>; <%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%> <%custom_type->input_file->output_file%><%endif%> <%endfor%> <%else%> - :preexec=<%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%><%endif%> + :preexec=cd <%reltop%>; <%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%><%endif%> <%if(flag_overrides(custom_type->input_file, postcommand))%> <%foreach(custom_type->input_file)%> - :preexec=<%flag_overrides(custom_type->input_file, postcommand)%> + :preexec=cd <%reltop%>; <%flag_overrides(custom_type->input_file, postcommand)%> <%endfor%> <%else%> <%if(custom_type->postcommand)%> <%foreach(custom_type->input_file)%> - :preexec=<%custom_type->postcommand%> + :preexec=cd <%reltop%>; <%custom_type->postcommand%> <%endfor%> <%endif%> <%endif%> <%if(pch_header && custom_type->pch_postrule)%> <%foreach(custom_type->input_file->source_output_files)%> - :preexec=echo #include "<%pch_header%>" > temporary.src - :preexec=<%cat("cat")%> <%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 - :preexec=<%mv("mv -f")%> 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%> + :preexec=cd <%reltop%>; echo #include "<%pch_header%>" > temporary.src + :preexec=cd <%reltop%>; <%cat("cat")%> <%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 + :preexec=cd <%reltop%>; <%mv("mv -f")%> 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%> -<%else%> -<%custom_type->input_file%> - documentation + <%endif%> <%endfor%> <%endfor%> diff --git a/templates/make.mpd b/templates/make.mpd index 33fcbfc3..ccb240ab 100644 --- a/templates/make.mpd +++ b/templates/make.mpd @@ -86,7 +86,6 @@ EXPORTFLAGS = <%if(exename)%><%if(need_staticflags)%>$(STATICFLAGS)<%endif%><% #---------------------------------------------------------------------------- # Local targets #---------------------------------------------------------------------------- -<%marker(local)%> <%if(exename)%> all: $(BIN)<%if(postbuild)%> __postbuild__<%endif%> @@ -266,6 +265,7 @@ __postbuild__: @<%eval(postbuild)%> <%endif%> +<%marker(local)%> #---------------------------------------------------------------------------- # Dependencies #---------------------------------------------------------------------------- diff --git a/templates/nmake.mpd b/templates/nmake.mpd index a7525d10..ea9601d8 100644 --- a/templates/nmake.mpd +++ b/templates/nmake.mpd @@ -60,7 +60,7 @@ INSTALLDIR=<%if(install)%><%install%><%else%><%output_dir%><%endif%> OUTDIR=<%output_dir(".")%> <%endif%> <%if(type_is_dynamic)%> -OUTDIR=<%libout%> +OUTDIR=<%if(dllout)%><%dllout%><%else%><%libout%><%endif%> <%endif%> INTDIR=<%intermediate_dir%>\<%project_name%>\<%machine%> |