Subversion Repositories gelsvn

Rev

Rev 107 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 107 Rev 198
Line 65... Line 65...
65
  my($fh)   = shift;
65
  my($fh)   = shift;
66
  my($crlf) = $self->crlf();
66
  my($crlf) = $self->crlf();
67
 
67
 
68
  print $fh '# Microsoft Developer Studio Generated NMAKE File', $crlf,
68
  print $fh '# Microsoft Developer Studio Generated NMAKE File', $crlf,
69
            '#', $crlf,
69
            '#', $crlf,
70
            '# $Id: NMakeWorkspaceCreator.pm 107 2005-09-02 16:42:23Z bj $', $crlf,
70
            '# $Id: NMakeWorkspaceCreator.pm 198 2005-12-15 11:30:53Z bj $', $crlf,
71
            '#', $crlf,
71
            '#', $crlf,
72
            '# This file was generated by MPC.  Any changes made directly to', $crlf,
72
            '# This file was generated by MPC.  Any changes made directly to', $crlf,
73
            '# this file will be lost the next time it is generated.', $crlf,
73
            '# this file will be lost the next time it is generated.', $crlf,
74
            '#', $crlf,
74
            '#', $crlf,
75
            '# MPC Command:', $crlf,
75
            '# MPC Command:', $crlf,
Line 82... Line 82...
82
  my($self)     = shift;
82
  my($self)     = shift;
83
  my($fh)       = shift;
83
  my($fh)       = shift;
84
  my($target)   = shift;
84
  my($target)   = shift;
85
  my($list)     = shift;
85
  my($list)     = shift;
86
  my($crlf)     = $self->crlf();
86
  my($crlf)     = $self->crlf();
-
 
87
  my($cwd)      = $self->getcwd();
87
 
88
 
88
  foreach my $project (@$list) {
89
  foreach my $project (@$list) {
89
    my($dir)    = $self->mpc_dirname($project);
90
    my($dir)    = $self->mpc_dirname($project);
90
    my($chdir)  = 0;
91
    my($chdir)  = 0;
91
    my($back)   = '';
92
    my($back)   = '';
92
 
93
 
93
    ## If the directory isn't '.' then we need
94
    ## If the directory isn't '.' then we need
94
    ## to figure out how to get back to our starting point
95
    ## to figure out how to get back to our starting point
95
    if ($dir ne '.') {
96
    if ($dir ne '.') {
96
      $chdir = 1;
97
      $chdir = 1;
97
      my($count) = ($dir =~ tr/\///);
98
      my($count) = ($dir =~ tr/\///) + 1;
98
      if ($dir =~ /^\.\.\//) {
99
      if ($dir =~ /^\.\.\//) {
-
 
100
        ## Find out how many directories we went down
-
 
101
        my($rel) = $dir;
-
 
102
        while($rel =~ s/^\.\.\///) {
-
 
103
        }
-
 
104
        my($down) = ($rel =~ tr/\///) + 1;
-
 
105
 
-
 
106
        ## Get $count - $down parts of the base of the current directory
-
 
107
        $rel = $cwd;
-
 
108
        my($index) = length($rel);
-
 
109
        for(my $i = $down; $i < $count; $i++) {
-
 
110
          $index = rindex($rel, '/', $index - 1);
-
 
111
        }
-
 
112
        if ($index > -1) {
-
 
113
          $rel = substr($rel, $index + 1);
-
 
114
        }
99
        $back = ('../' x $count) . basename($self->getcwd());
115
        $back = ('../' x $down) . $rel;
100
      }
116
      }
101
      else {
117
      else {
102
        $back = ('../' x ($count + 1));
118
        $back = ('../' x $count);
103
      }
119
      }
104
    }
120
    }
105
 
121
 
106
    print $fh ($chdir ? "\tcd $dir$crlf" : ''),
122
    print $fh ($chdir ? "\tcd $dir$crlf" : ''),
107
              "\t\$(MAKE) /f ", basename($project), " $target$crlf",
123
              "\t\$(MAKE) /f ", basename($project), " $target$crlf",