domd 983 B

12345678910111213141516171819202122232425262728293031323334
  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 [ "$MAKEDEPEND" = "gcc" ]; 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. gcc -Werror -D OPENSSL_DOING_MAKEDEPEND -M $args >> Makefile.tmp || exit
  24. ${PERL} $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new
  25. rm -f Makefile.tmp
  26. else
  27. ${MAKEDEPEND} -D OPENSSL_DOING_MAKEDEPEND $@
  28. ${PERL} $TOP/util/clean-depend.pl < Makefile > Makefile.new
  29. fi
  30. mv Makefile.new Makefile
  31. # unfake the presence of Kerberos
  32. rm $TOP/krb5.h