domd 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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=""
  9. while [ "$1" != "--" ]; do
  10. MAKEDEPEND="$MAKEDEPEND $1"
  11. shift
  12. done
  13. fi
  14. if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi
  15. # Preserve Makefile timestamp by moving instead of copying (cp -p is GNU only)
  16. mv Makefile Makefile.save
  17. cp Makefile.save Makefile
  18. # fake the presence of Kerberos
  19. touch $TOP/krb5.h
  20. if expr "$MAKEDEPEND" : ".*makedepend" > /dev/null; then
  21. ${MAKEDEPEND} -D OPENSSL_DOING_MAKEDEPEND $@ && \
  22. ${PERL} $TOP/util/clean-depend.pl < Makefile > Makefile.new
  23. RC=$?
  24. else
  25. args=""
  26. while [ $# -gt 0 ]; do
  27. if [ "$1" != "--" ]; then args="$args $1"; fi
  28. shift
  29. done
  30. sed -e '/^# DO NOT DELETE.*/,$d' < Makefile > Makefile.tmp
  31. echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp
  32. ${MAKEDEPEND} -Werror -D OPENSSL_DOING_MAKEDEPEND -M $args >> Makefile.tmp || exit 1
  33. ${PERL} $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new
  34. RC=$?
  35. rm -f Makefile.tmp
  36. fi
  37. if cmp -s Makefile.save Makefile.new; then
  38. mv Makefile.save Makefile
  39. rm -f Makefile.new
  40. else
  41. mv Makefile.new Makefile
  42. fi
  43. # unfake the presence of Kerberos
  44. rm $TOP/krb5.h
  45. exit $RC