diff options
author | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2010-02-24 20:20:21 +0000 |
---|---|---|
committer | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2010-02-24 20:20:21 +0000 |
commit | 035b47c1a6985e2b884182ab0f3bb1afa714a48f (patch) | |
tree | 48d75721f242b7a0eb4398a65b672a152bdaa37f /ACE/MPC/modules/Depgen/NMakeDependencyWriter.pm | |
parent | a3894e5127aa8cf1892e717ab30f02e053cdb482 (diff) | |
download | ATCD-035b47c1a6985e2b884182ab0f3bb1afa714a48f.tar.gz |
Diffstat (limited to 'ACE/MPC/modules/Depgen/NMakeDependencyWriter.pm')
-rw-r--r-- | ACE/MPC/modules/Depgen/NMakeDependencyWriter.pm | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/ACE/MPC/modules/Depgen/NMakeDependencyWriter.pm b/ACE/MPC/modules/Depgen/NMakeDependencyWriter.pm new file mode 100644 index 00000000000..0428a55c176 --- /dev/null +++ b/ACE/MPC/modules/Depgen/NMakeDependencyWriter.pm @@ -0,0 +1,53 @@ +package NMakeDependencyWriter; + +# ************************************************************ +# Description : Generates NMake dependencies. +# Author : Chad Elliott +# Create Date : 2/10/2002 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; +use DependencyWriter; + +use vars qw(@ISA); +@ISA = qw(DependencyWriter); + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub process { + my $sources = $_[1]; + my $files = $_[2]; + my $total = 0; + + $$sources[0] =~ s/\//\\/g; + $$sources[0] =~ s/\\\\/\\/g; + my $dep = "$$sources[0] :\\\n"; + + ## Sort the dependencies to make them reproducible + foreach my $file (sort @$files) { + $file =~ s/\//\\/g; + $file =~ s/\\\\/\\/g; + if ($file ne $$sources[0]) { + $dep .= "\t\"$file\"\\\n"; + ++$total; + } + } + + if ($total == 0) { + $dep = ''; + } + else { + $dep .= "\n\n"; + } + + return $dep; +} + + +1; |