makeclean 943 B

123456789101112131415161718192021222324252627282930313233343536
  1. #! /bin/sh
  2. # Remove built object files and test executables
  3. #
  4. # Written by Ewen McNeill <ewen@imatix.com>, 2014-07-22
  5. # Updated by Ewen McNeill <ewen@imatix.com>, 2014-07-24
  6. #---------------------------------------------------------------------------
  7. set -e # Stop on errors
  8. # Figure out where we are
  9. BIN_DIR=$(dirname $0)
  10. if [ -z "${BIN_DIR}" ]; then BIN_DIR="."; fi
  11. case "${BIN_DIR}" in
  12. .) BIN_DIR="$(pwd)"; ;;
  13. /*) ;;
  14. *) BIN_DIR="$(pwd)/${BIN_DIR}"; ;;
  15. esac
  16. # Locate top of source tree, assuming we're in builds/zos
  17. TOP="${BIN_DIR}/../.."
  18. SRC="${TOP}/src"
  19. TESTS="${TOP}/tests"
  20. # Remove object/library files
  21. echo "Removing libzmq built files"
  22. (cd "${SRC}" && rm -f *.o *.a *.dbg *.x *.so libzmq)
  23. # Remove test object files
  24. echo "Removing libzmq tests"
  25. (cd "${TESTS}" && rm -f *.o *.dbg)
  26. (cd "${TESTS}";
  27. EXES=$(ls test_* | grep -v "\.")
  28. if [ -n "${EXES}" ]; then
  29. rm ${EXES}
  30. fi
  31. )