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
|
package MakeWorkspaceCreator;
# ************************************************************
# Description : A Generic Workspace (Makefile) creator
# Author : Chad Elliott
# Create Date : 2/18/2003
# ************************************************************
# ************************************************************
# Pragmas
# ************************************************************
use strict;
use MakeProjectCreator;
use MakeWorkspaceBase;
use WorkspaceCreator;
use vars qw(@ISA);
@ISA = qw(MakeWorkspaceBase WorkspaceCreator);
# ************************************************************
# Data Section
# ************************************************************
my $targets = 'clean depend generated realclean check-syntax $(CUSTOM_TARGETS)';
# ************************************************************
# Subroutine Section
# ************************************************************
sub write_project_targets {
my($self, $fh, $crlf, $target, $list) = @_;
## Print out a make command for each project
foreach my $project (@$list) {
my $dname = $self->mpc_dirname($project);
my $chdir = ($dname ne '.');
print $fh "\t\@",
($chdir ? "cd $dname && " : ''),
"\$(MAKE) -f ",
($chdir ? $self->mpc_basename($project) : $project),
" $target$crlf";
}
}
sub pre_workspace {
my($self, $fh) = @_;
$self->workspace_preamble($fh, $self->crlf(), 'Make Workspace',
'$Id: MakeWorkspaceCreator.pm 2014 2011-04-27 14:32:46Z mitza $');
}
sub write_comps {
my($self, $fh) = @_;
my %targnum;
my @list = $self->number_target_deps($self->get_projects(),
$self->get_project_info(),
\%targnum, 0);
## Send all the information to our base class method
$self->write_named_targets($fh, $self->crlf(), \%targnum, \@list,
($self->languageIs(Creator::csharp) ?
'bundle ' : '') . $targets, '', '',
$self->project_target_translation(1), 1);
}
1;
|