Make the choice of "makedepend" program choosable through a switch.
[openssl.git] / util / domd
1 #!/bin/sh
2 # Do a makedepend, only leave out the standard headers
3 # Written by Ben Laurie <ben@algroup.co.uk> 19 Jan 1999
4
5 TOP=$1
6 shift
7 if [ "$1" = "-MD" ]; then
8     shift
9     MAKEDEPEND=$1
10     shift
11 fi
12 if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi
13
14 cp Makefile.ssl Makefile.save
15 if [ "$MAKEDEPEND" = "gcc" ]; then
16     sed -e '/^# DO NOT DELETE.*/,$d' < Makefile.ssl > Makefile.tmp
17     echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp
18     gcc -M $@ >> Makefile.tmp
19     perl $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new
20     #cat Makefile.tmp > Makefile.new
21 else
22     ${MAKEDEPEND} -f Makefile.ssl $@
23     perl $TOP/util/clean-depend.pl < Makefile.ssl > Makefile.new
24 fi
25 mv Makefile.new Makefile.ssl