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')) {
76 sub project_file_extension
{
83 my($self, $name) = @_;
86 if (!defined $startre) {
87 $startre = $self->escape_regex_special($self->getstartdir());
90 ## The Green Hills project format is strange and needs all paths
91 ## relative to the top directory, no matter where the source files
92 ## reside. The template uses reltop_ in front of the real project
93 ## settings, so we get the value of the real keyword and then do some
94 ## adjusting to get it relative to the top directory.
95 if ($name =~ /^reltop_(\w+)/) {
96 $value = $self->relative($self->get_assignment($1));
98 my $part = $self->getcwd();
99 $part =~ s/^$startre[\/]?//;
105 $value = $part . '/' . $value;
110 elsif ($name eq 'reltop') {
111 $value = $self->getcwd();
112 $value =~ s/^$startre[\/]?//;
113 $value = '.' if ($value eq '');
115 elsif ($name eq 'slash') {
116 ## We need to override the slash value so that we can give the right
117 ## value for Windows or UNIX.
118 $value = (defined $ENV{$GHSPropertyBase::ghsunix
} ?
'/' : '\\');
120 elsif ($name eq 'postmkdir') {
121 ## If we're on Windows, we need an "or" command that will reset the
122 ## errorlevel so that a mkdir on a directory that already exists
123 ## doesn't cause the build to cease.
124 $value = ' || type nul' if (!defined $ENV{$GHSPropertyBase::ghsunix
});
130 sub get_dll_exe_template_input_file
{
136 sub get_lib_exe_template_input_file
{
142 sub get_lib_template_input_file
{
148 sub get_dll_template_input_file
{