summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfields_t <oth3r1if3@users.noreply.github.com>2004-03-20 18:58:41 +0000
committerfields_t <oth3r1if3@users.noreply.github.com>2004-03-20 18:58:41 +0000
commit3fae5c8238327b78c8a5bc2863bc86154de0c88c (patch)
treee8b42336ae50197797a7fb83e2bf96fbe3f2922f
parentfa015d98330e099044e146210eeda11c9810df6b (diff)
downloadMPC-unlabeled-1.14.26.tar.gz
Fri Mar 19 15:35:27 MST 2004 Trevor Fields <fields_t@ociweb.com>unlabeled-1.14.26
-rw-r--r--modules/NMakeWorkspaceCreator.pm60
1 files changed, 49 insertions, 11 deletions
diff --git a/modules/NMakeWorkspaceCreator.pm b/modules/NMakeWorkspaceCreator.pm
index e8935edf..938c03ce 100644
--- a/modules/NMakeWorkspaceCreator.pm
+++ b/modules/NMakeWorkspaceCreator.pm
@@ -30,6 +30,12 @@ sub crlf {
}
+sub workspace_per_project {
+ #my($self) = shift;
+ return 1;
+}
+
+
sub workspace_file_name {
my($self) = shift;
if ($self->make_coexistence()) {
@@ -47,7 +53,16 @@ sub pre_workspace {
my($fh) = shift;
my($crlf) = $self->crlf();
- print $fh "# Microsoft Developer Studio Generated NMAKE File$crlf$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,
+ "# $0 @ARGV", $crlf,
+ $crlf;
}
@@ -67,13 +82,7 @@ sub write_project_targets {
## to figure out how to get back to our starting point
if ($dir ne '.') {
$chdir = 1;
- my($count) = 0;
- my($length) = length($dir);
- for(my $i = 0; $i < $length; $i++) {
- if (substr($dir, $i, 1) eq '/') {
- $count++;
- }
- }
+ my($count) = ($dir =~ tr/\///);
if ($dir =~ /^\.\.\//) {
$back = ('../' x $count) . basename($self->getcwd());
}
@@ -94,7 +103,8 @@ sub write_comps {
my($fh) = shift;
my($projects) = $self->get_projects();
my($pjs) = $self->get_project_info();
- my(@list) = $self->sort_dependencies($projects, $pjs);
+ my(%targnum) = ();
+ my(@list) = $self->number_target_deps($projects, $pjs, \%targnum);
my($crlf) = $self->crlf();
my($default) = 'Win32 Debug';
@@ -108,7 +118,7 @@ sub write_comps {
last;
}
}
-
+
## Print out the content
print $fh '!IF "$(CFG)" == ""' . $crlf .
'CFG=' . $default . $crlf .
@@ -116,11 +126,39 @@ sub write_comps {
'Defaulting to ' . $default . '.' . $crlf .
'!ENDIF' . $crlf;
- foreach my $target ('ALL', 'DEPEND', 'IDL_STUBS', 'CLEAN', 'REALCLEAN') {
+ ## Print out the "all" target
+ print $fh $crlf . 'ALL:';
+ foreach my $project (@list) {
+ print $fh " $$pjs{$project}->[0]";
+ }
+ print $fh $crlf;
+
+ ## Print out all other targets here
+ foreach my $target ('DEPEND', 'CLEAN', 'REALCLEAN') {
print $fh $crlf .
$target . ':' . $crlf;
$self->write_project_targets($fh, 'CFG="$(CFG)" ' . $target, \@list);
}
+
+ ## Print out each target separately
+ foreach my $project (@list) {
+ my($dname) = dirname($project);
+ print $fh $crlf . $$pjs{$project}->[0] . ':';
+ if (defined $targnum{$project}) {
+ foreach my $number (@{$targnum{$project}}) {
+ print $fh " $$pjs{$list[$number]}->[0]";
+ }
+ }
+
+ 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 $$pjs{$project}->[0]$crlf";
+ }
}