1*ebfedea0SLionel Sambuc#!/bin/sh 2*ebfedea0SLionel Sambuc# Do a makedepend, only leave out the standard headers 3*ebfedea0SLionel Sambuc# Written by Ben Laurie <ben@algroup.co.uk> 19 Jan 1999 4*ebfedea0SLionel Sambuc 5*ebfedea0SLionel SambucTOP=$1 6*ebfedea0SLionel Sambucshift 7*ebfedea0SLionel Sambucif [ "$1" = "-MD" ]; then 8*ebfedea0SLionel Sambuc shift 9*ebfedea0SLionel Sambuc MAKEDEPEND=$1 10*ebfedea0SLionel Sambuc shift 11*ebfedea0SLionel Sambucfi 12*ebfedea0SLionel Sambucif [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi 13*ebfedea0SLionel Sambuc 14*ebfedea0SLionel Sambuccp Makefile Makefile.save 15*ebfedea0SLionel Sambuc# fake the presence of Kerberos 16*ebfedea0SLionel Sambuctouch $TOP/krb5.h 17*ebfedea0SLionel Sambucif expr "$MAKEDEPEND" : '.*gcc$' > /dev/null; then 18*ebfedea0SLionel Sambuc args="" 19*ebfedea0SLionel Sambuc while [ $# -gt 0 ]; do 20*ebfedea0SLionel Sambuc if [ "$1" != "--" ]; then args="$args $1"; fi 21*ebfedea0SLionel Sambuc shift 22*ebfedea0SLionel Sambuc done 23*ebfedea0SLionel Sambuc sed -e '/^# DO NOT DELETE.*/,$d' < Makefile > Makefile.tmp 24*ebfedea0SLionel Sambuc echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp 25*ebfedea0SLionel Sambuc ${MAKEDEPEND} -Werror -D OPENSSL_DOING_MAKEDEPEND -M $args >> Makefile.tmp || exit 1 26*ebfedea0SLionel Sambuc ${PERL} $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new 27*ebfedea0SLionel Sambuc RC=$? 28*ebfedea0SLionel Sambuc rm -f Makefile.tmp 29*ebfedea0SLionel Sambucelse 30*ebfedea0SLionel Sambuc ${MAKEDEPEND} -D OPENSSL_DOING_MAKEDEPEND $@ && \ 31*ebfedea0SLionel Sambuc ${PERL} $TOP/util/clean-depend.pl < Makefile > Makefile.new 32*ebfedea0SLionel Sambuc RC=$? 33*ebfedea0SLionel Sambucfi 34*ebfedea0SLionel Sambucmv Makefile.new Makefile 35*ebfedea0SLionel Sambuc# unfake the presence of Kerberos 36*ebfedea0SLionel Sambucrm $TOP/krb5.h 37*ebfedea0SLionel Sambuc 38*ebfedea0SLionel Sambucexit $RC 39