home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / runtime / Clean.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2000-12-21  |  2KB  |  81 lines

  1. #!/bin/sh
  2. #
  3. # $Id: Clean.sh,v 1.5 2000/12/21 21:56:23 cph Exp $
  4. #
  5. # Copyright (c) 2000 Massachusetts Institute of Technology
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or (at
  10. # your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful, but
  13. # WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. # General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. # Utility for cleaning up an MIT Scheme build directory.
  22. # The working directory must be the build directory.
  23.  
  24. if [ $# -eq 1 ]; then
  25.     COMMAND="$1"
  26.     KEYWORDS="rm-bin rm-com rm-pkg-src rm-pkg-bin"
  27. elif [ $# -ge 2 ]; then
  28.     COMMAND="$1"
  29.     shift
  30.     KEYWORDS="$*"
  31. else
  32.     echo "usage: $0 <command> <keyword> ..."
  33.     exit 1
  34. fi
  35.  
  36. case "${COMMAND}" in
  37. mostlyclean | clean)
  38.     ;;
  39. distclean)
  40.     if [ -f Makefile.in ] && [ -f Makefile ]; then
  41.     echo "rm Makefile"
  42.     rm Makefile
  43.     fi
  44.     ;;
  45. maintainer-clean)
  46.     for FN in .edwin-ffi Clean.sh Makefile Setup.sh Stage.sh Tags.sh; do
  47.     if [ -L ${FN} ]; then
  48.         echo "rm ${FN}"
  49.         rm ${FN}
  50.     fi
  51.     done
  52.     ;;
  53. *)
  54.     echo "$0: Unknown command ${1}"
  55.     exit 1
  56.     ;;
  57. esac
  58.  
  59. for KEYWORD in ${KEYWORDS}; do
  60.     case ${KEYWORD} in
  61.     rm-bin)
  62.     echo "rm -f *.bin *.ext"
  63.     rm -f *.bin *.ext
  64.     ;;
  65.     rm-com)
  66.     echo "rm -f *.com *.bci"
  67.     rm -f *.com *.bci
  68.     ;;
  69.     rm-pkg-src)
  70.     echo "rm -f *.con *.ldr"
  71.     rm -f *.con *.ldr
  72.     ;;
  73.     rm-pkg-bin)
  74.     echo "rm -f *.bco *.bld *.crf *.fre *.glo"
  75.     rm -f *.bco *.bld *.crf *.fre *.glo
  76.     ;;
  77.     esac
  78. done
  79.  
  80. exit 0
  81.