1 package GHSProjectCreator
;
3 # ************************************************************
4 # Description : A GHS project creator for version 4.x.
5 # By default, this module assumes Multi will
6 # be used on Windows. If it is not, you must
7 # set the MPC_GHS_UNIX environment variable.
8 # Author : Chad Elliott
9 # Create Date : 4/19/2002
10 # ************************************************************
12 # ************************************************************
14 # ************************************************************
22 @ISA = qw(GHSPropertyBase ProjectCreator);
24 # ************************************************************
26 # ************************************************************
30 # ************************************************************
32 # ************************************************************
35 return (defined $ENV{$GHSPropertyBase::ghsunix
} ?
0 : 1);
39 sub case_insensitive
{
40 return (defined $ENV{$GHSPropertyBase::ghsunix
} ?
0 : 1);
44 sub use_win_compatibility_commands
{
45 return (defined $ENV{$GHSPropertyBase::ghsunix
} ?
0 : 1);
49 sub post_file_creation
{
52 ## These special files are only used if it is a custom only project or
53 ## there are no source files in the project.
54 if ((defined $self->get_assignment('custom_only') ||
55 !defined $self->get_assignment('source_files')) &&
56 defined $self->get_assignment('custom_types')) {
57 my $fh = new FileHandle
();
58 if (open($fh, '>.custom_build_rule')) {
59 print $fh ".empty_html_file\n";
62 if (open($fh, '>.empty_html_file')) {
74 sub project_file_extension
{
81 my($self, $name) = @_;
84 if (!defined $startre) {
85 $startre = $self->escape_regex_special($self->getstartdir());
88 ## The Green Hills project format is strange and needs all paths
89 ## relative to the top directory, no matter where the source files
90 ## reside. The template uses reltop_ in front of the real project
91 ## settings, so we get the value of the real keyword and then do some
92 ## adjusting to get it relative to the top directory.
93 if ($name =~ /^reltop_(\w+)/) {
94 $value = $self->relative($self->get_assignment($1));
96 my $part = $self->getcwd();
97 $part =~ s/^$startre[\/]?//;
103 $value = $part . '/' . $value;
108 elsif ($name eq 'reltop') {
109 $value = $self->getcwd();
110 $value =~ s/^$startre[\/]?//;
111 $value = '.' if ($value eq '');
113 elsif ($name eq 'slash') {
114 ## We need to override the slash value so that we can give the right
115 ## value for Windows or UNIX.
116 $value = (defined $ENV{$GHSPropertyBase::ghsunix
} ?
'/' : '\\');
118 elsif ($name eq 'postmkdir') {
119 ## If we're on Windows, we need an "or" command that will reset the
120 ## errorlevel so that a mkdir on a directory that already exists
121 ## doesn't cause the build to cease.
122 $value = ' || type nul' if (!defined $ENV{$GHSPropertyBase::ghsunix
});
128 sub get_dll_exe_template_input_file
{
134 sub get_lib_exe_template_input_file
{
140 sub get_lib_template_input_file
{
146 sub get_dll_template_input_file
{