domd 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. TOP=$1
  5. shift
  6. if [ "$1" = "-MD" ]; then
  7. shift
  8. MAKEDEPEND=$1
  9. shift
  10. fi
  11. if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi
  12. cp Makefile Makefile.save
  13. # fake the presence of Kerberos
  14. touch $TOP/krb5.h
  15. if expr "$MAKEDEPEND" : '.*gcc$' > /dev/null; then
  16. args=""
  17. while [ $# -gt 0 ]; do
  18. if [ "$1" != "--" ]; then args="$args $1"; fi
  19. shift
  20. done
  21. sed -e '/^# DO NOT DELETE.*/,$d' < Makefile > Makefile.tmp
  22. echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp
  23. ${MAKEDEPEND} -Werror -D OPENSSL_DOING_MAKEDEPEND -M $args >> Makefile.tmp || exit 1
  24. ${PERL} $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new
  25. RC=$?
  26. rm -f Makefile.tmp
  27. else
  28. ${MAKEDEPEND} -D OPENSSL_DOING_MAKEDEPEND $@ && \
  29. ${PERL} $TOP/util/clean-depend.pl < Makefile > Makefile.new
  30. RC=$?
  31. fi
  32. mv Makefile.new Makefile
  33. # unfake the presence of Kerberos
  34. rm $TOP/krb5.h
  35. exit $RC