diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2003-05-22 15:31:36 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2003-05-22 15:31:36 +0000 |
commit | e8eca3f54403adf9a4c4346f754b2727cf5a2395 (patch) | |
tree | 280d463fb2b25aaea8ec97c4000077913290e8df | |
parent | 7cabf3c850425caa8a341bf1daa76b16e6d50dda (diff) | |
download | MPC-e8eca3f54403adf9a4c4346f754b2727cf5a2395.tar.gz |
ChangeLogTag: Thu May 22 10:30:31 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r-- | modules/NMakeWorkspaceCreator.pm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/NMakeWorkspaceCreator.pm b/modules/NMakeWorkspaceCreator.pm index 225f5f30..75dc20f0 100644 --- a/modules/NMakeWorkspaceCreator.pm +++ b/modules/NMakeWorkspaceCreator.pm @@ -56,23 +56,30 @@ sub write_project_targets { foreach my $project (@$list) { my($dir) = dirname($project); my($chdir) = 0; - my($back) = 1; + my($back) = ''; ## If the directory isn't '.' then we need ## to figure out how to get back to our starting point if ($dir ne '.') { $chdir = 1; + my($count) = 0; my($length) = length($dir); for(my $i = 0; $i < $length; $i++) { if (substr($dir, $i, 1) eq '/') { - $back++; + $count++; } } + if ($dir =~ /^\.\.\//) { + $back = ('../' x $count) . basename($self->getcwd()); + } + else { + $back = ('../' x ($count + 1)); + } } print $fh ($chdir ? "\tcd $dir$crlf" : '') . "\t\$(MAKE) /f " . basename($project) . " $target$crlf" . - ($chdir ? "\tcd " . ('../' x $back) . $crlf : ''); + ($chdir ? "\tcd $back$crlf" : ''); } } |