my %files;
+my $thisfile="";
while(<STDIN>) {
- my ($file,$deps)=/^(.*): (.*)$/;
+ my ($dummy, $file,$deps)=/^((.*):)? (.*)$/;
+ $thisfile=$file if defined $file;
next if !defined $deps;
my @deps=split ' ',$deps;
@deps=grep(!/^\/usr\/include/,@deps);
@deps=grep(!/^\/usr\/lib\/gcc-lib/,@deps);
- push @{$files{$file}},@deps;
+ @deps=grep(!/^\\$/,@deps);
+ push @{$files{$thisfile}},@deps;
}
my $file;
TOP=$1
shift
+MAKEDEPEND=$1
+shift
+if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi
cp Makefile.ssl Makefile.save
-makedepend -f Makefile.ssl $@
-perl $TOP/util/clean-depend.pl < Makefile.ssl > Makefile.new
+if [ "$MAKEDEPEND" = "gcc" ]; then
+ sed -e '/^# DO NOT DELETE.*/,$d' < Makefile.ssl > Makefile.tmp
+ echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp
+ gcc -M $@ >> Makefile.tmp
+ perl $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new
+ #cat Makefile.tmp > Makefile.new
+else
+ ${MAKEDEPEND} -f Makefile.ssl $@
+ perl $TOP/util/clean-depend.pl < Makefile.ssl > Makefile.new
+fi
mv Makefile.new Makefile.ssl