Subversion Repositories gelsvn

Rev

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

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