summaryrefslogtreecommitdiff
path: root/modules/VA4WorkspaceCreator.pm
blob: 09785638fe668edc64e0826d5b0429e65ae2172b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package VA4WorkspaceCreator;

# ************************************************************
# Description   : A VA4 Workspace Creator
# Author        : Chad Elliott
# Create Date   : 5/13/2002
# ************************************************************

# ************************************************************
# Pragmas
# ************************************************************

use strict;

use VA4ProjectCreator;
use WorkspaceCreator;

use vars qw(@ISA);
@ISA = qw(WorkspaceCreator);

# ************************************************************
# Subroutine Section
# ************************************************************


sub crlf {
  my($self) = shift;
  return $self->windows_crlf();
}


sub workspace_file_name {
  my($self) = shift;
  return $self->get_modified_workspace_name($self->get_workspace_name(),
                                            '.icp');
}


sub pre_workspace {
  my($self) = shift;
  my($fh)   = shift;
  my($crlf) = $self->crlf();

  print $fh '// Visual Age C++ 4 workspace file', $crlf,
            '//', $crlf,
            '// $Id$', $crlf,
            '//', $crlf,
            '// This file was generated by MPC.  Any changes made directly to', $crlf,
            '// this file will be lost the next time it is generated.', $crlf,
            '//', $crlf,
            '// MPC Command:', $crlf,
            "// $0 @ARGV", $crlf,
            $crlf;
}


sub write_comps {
  my($self)     = shift;
  my($fh)       = shift;
  my($projects) = $self->get_projects();
  my($pjs)      = $self->get_project_info();
  my(@list)     = $self->sort_dependencies($projects, $pjs);
  my($crlf)     = $self->crlf();

  foreach my $project (@list) {
    my($base) = $project;
    $base =~ s/\.[^\.]+//;
    my($ics)  = "$base.ics";

    print $fh "subproject $base icc \"$project\", ics \"$ics\"$crlf" .
              "{$crlf" .
              "}$crlf";
  }

  print $fh "build buildAll$crlf" .
            "{$crlf";
  foreach my $project (@list) {
    my($base) = $project;
    $base =~ s/\.[^\.]+//;
    print $fh "        use $base$crlf";
  }
  print $fh "}$crlf$crlf";
}


1;