back to unicode
[MPC.git] / modules / MakeProjectCreator.pm
blobe90addb09798e72e43249a4ce9beaebce596b795
1 package MakeProjectCreator;
3 # ************************************************************
4 # Description : A Generic Make Project Creator
5 # Author : Chad Elliott
6 # Create Date : 2/18/2003
7 # ************************************************************
9 # ************************************************************
10 # Pragmas
11 # ************************************************************
13 use strict;
15 use MakeProjectBase;
16 use ProjectCreator;
18 use vars qw(@ISA);
19 @ISA = qw(MakeProjectBase ProjectCreator);
21 # ************************************************************
22 # Data Section
23 # ************************************************************
25 ## NOTE: We call the constant as a function to support Perl 5.6.
26 my %info = (Creator::cplusplus() => {'dllexe' => 'makeexe',
27 'dll' => 'makedll',
28 'template' => 'make',
30 Creator::csharp() => {'dllexe' => 'make.net',
31 'dll' => 'make.net',
32 'template' => 'make.net',
34 Creator::java() => {'dllexe' => 'makeexe',
35 'dll' => 'makedll',
36 'template' => 'make',
38 Creator::vb() => {'dllexe' => 'make.net',
39 'dll' => 'make.net',
40 'template' => 'make.net',
44 # ************************************************************
45 # Subroutine Section
46 # ************************************************************
48 sub languageSupported {
49 return defined $info{$_[0]->get_language()};
53 sub escape_spaces {
54 #my $self = shift;
55 return 1;
59 sub get_dll_exe_template_input_file {
60 return $info{$_[0]->get_language()}->{'dllexe'};
64 sub get_dll_template_input_file {
65 return $info{$_[0]->get_language()}->{'dll'};
69 sub get_template {
70 return $info{$_[0]->get_language()}->{'template'};
73 sub fill_value {
74 my($self, $name) = @_;
76 if ($name eq 'compilers') {
77 ## The default compilers template variable value is determined by the
78 ## language and directly corresponds to a group of settings in the
79 ## .mpt file (make.net.mpt for csharp and makedll.mpt for all
80 ## others).
81 my $language = $self->get_language();
82 if ($language eq Creator::java) {
83 return 'java';
85 elsif ($language eq Creator::csharp) {
86 return 'gmcs';
88 else {
89 return 'gcc';
92 elsif ($name eq 'language') {
93 ## Allow the language to be available to the template. Certain
94 ## things are not used in make.mpd when the language is java.
95 return $self->get_language();
97 elsif ($name eq 'main') {
98 ## The main is needed when generating the makefiles for use with gcj.
99 my @sources = $self->get_component_list('source_files', 1);
100 my $exename = $self->find_main_file(\@sources);
101 return $exename if (defined $exename);
104 return undef;