1 package MakeDependencyWriter
;
3 # ************************************************************
4 # Description : Generates generic Makefile dependencies.
5 # Author : Chad Elliott
6 # Create Date : 2/10/2002
7 # ************************************************************
9 # ************************************************************
11 # ************************************************************
17 @ISA = qw(DependencyWriter);
19 # ************************************************************
21 # ************************************************************
23 my $cygwin = (defined $ENV{OS
} && $ENV{OS
} =~ /windows/i);
25 # ************************************************************
27 # ************************************************************
30 ## Replace whitespace with escaped whitespace.
31 map(s/(\s)/\\$1/g, @
{$_[2]});
33 ## Replace <drive letter>: with /cygdrive/<drive letter>. The user may
34 ## or may not be using Cygwin, but leaving the colon in there will
35 ## cause make to fail catastrophically on the next invocation.
36 map(s/([A-Z]):/\/cygdrive\
/$1/gi, @
{$_[2]}) if ($cygwin);
38 ## Sort the dependencies to make them reproducible.
39 return "@{$_[1]}: \\\n " . join(" \\\n ", sort @
{$_[2]}) . "\n";