diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2006-11-29 19:49:03 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2006-11-29 19:49:03 +0000 |
commit | 95b404f97028aa1566e322398d06e164f130d84c (patch) | |
tree | 90677c47f107b3202953eee49f4e2c64bb079a68 /modules/NMakeWorkspaceCreator.pm | |
parent | fa54e53866e3e10e839cd379917526f4d021efcd (diff) | |
download | MPC-95b404f97028aa1566e322398d06e164f130d84c.tar.gz |
ChangeLogTag: Wed Nov 29 19:47:15 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'modules/NMakeWorkspaceCreator.pm')
-rw-r--r-- | modules/NMakeWorkspaceCreator.pm | 96 |
1 files changed, 19 insertions, 77 deletions
diff --git a/modules/NMakeWorkspaceCreator.pm b/modules/NMakeWorkspaceCreator.pm index a302735d..eae1be3d 100644 --- a/modules/NMakeWorkspaceCreator.pm +++ b/modules/NMakeWorkspaceCreator.pm @@ -13,75 +13,48 @@ package NMakeWorkspaceCreator; use strict; use NMakeProjectCreator; +use MakeWorkspaceBase; use WorkspaceCreator; use vars qw(@ISA); -@ISA = qw(WorkspaceCreator); +@ISA = qw(MakeWorkspaceBase WorkspaceCreator); # ************************************************************ # Data Section # ************************************************************ -my(@targets) = ('CLEAN', 'DEPEND', 'GENERATED', 'REALCLEAN', - '$(CUSTOM_TARGETS)'); +my($targets) = 'clean depend generated realclean $(CUSTOM_TARGETS)'; # ************************************************************ # Subroutine Section # ************************************************************ -sub supports_make_coexistence { - #my($self) = shift; - return 1; -} - - sub crlf { my($self) = shift; return $self->windows_crlf(); } -sub workspace_per_project { +sub workspace_file_extension { #my($self) = shift; - return 1; -} - - -sub workspace_file_name { - my($self) = shift; - if ($self->make_coexistence()) { - return $self->get_modified_workspace_name($self->get_workspace_name(), - '.nmake'); - } - else { - return $self->get_modified_workspace_name('Makefile', ''); - } + return '.nmak'; } sub pre_workspace { my($self) = shift; my($fh) = shift; - my($crlf) = $self->crlf(); - - print $fh '# Microsoft Developer Studio Generated NMAKE File', $crlf, - '#', $crlf, - '# $Id$', $crlf, - '#', $crlf, - '# This file was generated by MPC. Any changes made directly to', $crlf, - '# this file will be lost the next time it is generated.', $crlf, - '#', $crlf, - '# MPC Command:', $crlf, - '# ', $self->create_command_line_string($0, @ARGV), $crlf, $crlf; + $self->workspace_preamble($fh, $self->crlf(), 'NMAKE Workspace', + '$Id$'); } sub write_project_targets { my($self) = shift; my($fh) = shift; + my($crlf) = shift; my($target) = shift; my($list) = shift; - my($crlf) = $self->crlf(); my($cwd) = $self->getcwd(); foreach my $project (@$list) { @@ -97,15 +70,14 @@ sub write_project_targets { sub write_comps { - my($self) = shift; - my($fh) = shift; - my($projects) = $self->get_projects(); - my($pjs) = $self->get_project_info(); - my($trans) = $self->project_target_translation(); - my(%targnum) = (); - my(@list) = $self->number_target_deps($projects, $pjs, \%targnum, 0); - my($crlf) = $self->crlf(); - my($default) = 'Win32 Debug'; + my($self) = shift; + my($fh) = shift; + my(%targnum) = (); + my($pjs) = $self->get_project_info(); + my(@list) = $self->number_target_deps($self->get_projects(), $pjs, + \%targnum, 0); + my($crlf) = $self->crlf(); + my($default) = 'Win32 Debug'; ## Determine the default configuration foreach my $project (keys %$pjs) { @@ -128,40 +100,10 @@ sub write_comps { 'CUSTOM_TARGETS=_EMPTY_TARGET_', $crlf, '!ENDIF', $crlf; - ## Print out the "all" target - print $fh $crlf, 'ALL:'; - foreach my $project (@list) { - print $fh " $$trans{$project}"; - } - print $fh $crlf; - - ## Print out all other targets here - foreach my $target (@targets) { - print $fh $crlf, - $target, ':', $crlf; - $self->write_project_targets($fh, 'CFG="$(CFG)" ' . $target, \@list); - } - - ## Print out each target separately - foreach my $project (@list) { - print $fh $crlf, $$trans{$project}, ':'; - if (defined $targnum{$project}) { - foreach my $number (@{$targnum{$project}}) { - print $fh " $$trans{$list[$number]}"; - } - } - - print $fh $crlf; - $self->write_project_targets($fh, 'CFG="$(CFG)" ' . 'ALL', [ $project ]); - } - - ## Print out the project_name_list target - print $fh $crlf, "project_name_list:$crlf"; - foreach my $project (sort @list) { - print $fh "\t\@echo $$trans{$project}$crlf"; - } + $self->write_named_targets($fh, $crlf, \%targnum, \@list, + $targets, 'CFG="$(CFG)" ', '', + $self->project_target_translation()); } - 1; |