domd revision 142425
155714Skris#!/bin/sh
255714Skris# Do a makedepend, only leave out the standard headers
355714Skris# Written by Ben Laurie <ben@algroup.co.uk> 19 Jan 1999
455714Skris
555714SkrisTOP=$1
655714Skrisshift
7109998Smarkmif [ "$1" = "-MD" ]; then
8109998Smarkm    shift
9109998Smarkm    MAKEDEPEND=$1
10109998Smarkm    shift
11109998Smarkmfi
12109998Smarkmif [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi
1355714Skris
14142425Snectarcp Makefile Makefile.save
15109998Smarkm# fake the presence of Kerberos
16109998Smarkmtouch $TOP/krb5.h
17109998Smarkmif [ "$MAKEDEPEND" = "gcc" ]; then
18109998Smarkm    args=""
19109998Smarkm    while [ $# -gt 0 ]; do
20109998Smarkm	if [ "$1" != "--" ]; then args="$args $1"; fi
21109998Smarkm	shift
22109998Smarkm    done
23142425Snectar    sed -e '/^# DO NOT DELETE.*/,$d' < Makefile > Makefile.tmp
24109998Smarkm    echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp
25109998Smarkm    gcc -D OPENSSL_DOING_MAKEDEPEND -M $args >> Makefile.tmp
26109998Smarkm    ${PERL} $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new
27109998Smarkm    rm -f Makefile.tmp
28109998Smarkmelse
29142425Snectar    ${MAKEDEPEND} -D OPENSSL_DOING_MAKEDEPEND -f Makefile $@
30142425Snectar    ${PERL} $TOP/util/clean-depend.pl < Makefile > Makefile.new
31109998Smarkmfi
32142425Snectarmv Makefile.new Makefile
33109998Smarkm# unfake the presence of Kerberos
34109998Smarkmrm $TOP/krb5.h
35