1 package BMakeWorkspaceCreator
;
3 # ************************************************************
4 # Description : A Borland Make Workspace (Makefile) creator
5 # Author : Chad Elliott
6 # Create Date : 2/03/2004
7 # ************************************************************
9 # ************************************************************
11 # ************************************************************
15 use BMakeProjectCreator
;
16 use MakeWorkspaceBase
;
19 use BorlandPropertyBase
;
22 @ISA = qw(MakeWorkspaceBase WinWorkspaceBase WorkspaceCreator
25 # ************************************************************
27 # ************************************************************
29 ## Borland Make's maximum line length
30 my $max_line_length = 32767;
31 my $targets = 'clean generated realclean $(CUSTOM_TARGETS)';
33 # ************************************************************
35 # ************************************************************
37 sub workspace_file_extension
{
43 sub workspace_file_name
{
45 return $self->get_modified_workspace_name('Makefile', '.bmak');
51 $self->workspace_preamble($fh, $self->crlf(),
52 'Borland Workspace Makefile',
57 sub write_project_targets
{
58 my($self, $fh, $crlf, $target, $list, $and) = @_;
59 my $cwd = $self->getcwd();
61 ## Print out a make command for each project
62 foreach my $project (@
$list) {
63 my $dir = $self->mpc_dirname($project);
65 my $chdir = ($dir ne '.');
67 print $fh "\t", ($chdir ?
"\$(COMSPEC) /c \"cd $dir $and " : ''),
68 "\$(MAKE) -\$(MAKEFLAGS) -f ",
69 $self->mpc_basename($project), " $target",
70 ($chdir ?
'"' : ''), $crlf;
76 my($self, $fh, $creator) = @_;
78 my $pjs = $self->get_project_info();
79 my @list = $self->number_target_deps($self->get_projects(), $pjs,
81 my $crlf = $self->crlf();
83 ## Set up the custom targets
84 print $fh '!ifndef CUSTOM_TARGETS', $crlf,
85 'CUSTOM_TARGETS=_EMPTY_TARGET_', $crlf,
88 ## Translate each project name
90 foreach my $project (@list) {
91 $trans{$project} = $$pjs{$project}->[ProjectCreator
::PROJECT_NAME
];
94 ## Send all the information to our base class method
95 $self->write_named_targets($fh, $crlf, \
%targnum, \
@list,
96 $targets, '', '', \
%trans, undef,
97 $creator->get_and_symbol(), $max_line_length);
104 ## Create the map of properties that we support.
107 ## Merge in properties from all base projects
108 foreach my $base (@ISA) {
109 my $func = $base . '::get_properties';
110 my $p = $self->$func();
111 foreach my $key (keys %$p) {
112 $$props{$key} = $$p{$key};