Make it possible to use gcc to generate the dependency tables.

This commit is contained in:
Richard Levitte 2001-02-16 13:55:05 +00:00
parent 52d160d85d
commit 87b79c3ef3
2 changed files with 18 additions and 4 deletions

View File

@ -11,13 +11,16 @@ while(<STDIN>) {
my %files; my %files;
my $thisfile="";
while(<STDIN>) { while(<STDIN>) {
my ($file,$deps)=/^(.*): (.*)$/; my ($dummy, $file,$deps)=/^((.*):)? (.*)$/;
$thisfile=$file if defined $file;
next if !defined $deps; next if !defined $deps;
my @deps=split ' ',$deps; my @deps=split ' ',$deps;
@deps=grep(!/^\/usr\/include/,@deps); @deps=grep(!/^\/usr\/include/,@deps);
@deps=grep(!/^\/usr\/lib\/gcc-lib/,@deps); @deps=grep(!/^\/usr\/lib\/gcc-lib/,@deps);
push @{$files{$file}},@deps; @deps=grep(!/^\\$/,@deps);
push @{$files{$thisfile}},@deps;
} }
my $file; my $file;

View File

@ -4,8 +4,19 @@
TOP=$1 TOP=$1
shift shift
MAKEDEPEND=$1
shift
if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi
cp Makefile.ssl Makefile.save cp Makefile.ssl Makefile.save
makedepend -f Makefile.ssl $@ if [ "$MAKEDEPEND" = "gcc" ]; then
perl $TOP/util/clean-depend.pl < Makefile.ssl > Makefile.new 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 mv Makefile.new Makefile.ssl