From 32a7c6b5b51ee477b366b7b25c0bc33971cde2fd Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 2 May 2007 03:59:23 +0000 Subject: [PATCH] Change meaning of "make c-clean" to delete only those files created by "make c". Clean up "Setup.sh" and "Clean.sh" scripts to use "set -e", to avoid gratuitous uses of "exit", and to have consistent quoting. --- v7/src/Clean.sh | 36 ++++++++------ v7/src/Setup.sh | 6 ++- v7/src/compiler/Clean.sh | 37 ++++---------- v7/src/compiler/Setup.sh | 8 +-- v7/src/edwin/Clean.sh | 13 ++--- v7/src/etc/Clean.sh | 66 +++++++++++-------------- v7/src/etc/Setup.sh | 10 ++-- v7/src/microcode/Clean.sh | 16 +++--- v7/src/microcode/Setup.sh | 8 +-- v7/src/microcode/makegen/Makefile.in.in | 13 ++--- 10 files changed, 98 insertions(+), 115 deletions(-) diff --git a/v7/src/Clean.sh b/v7/src/Clean.sh index 67755ea13..a8aa6f4af 100755 --- a/v7/src/Clean.sh +++ b/v7/src/Clean.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Clean.sh,v 1.12 2007/04/29 18:01:33 cph Exp $ +# $Id: Clean.sh,v 1.13 2007/05/02 03:58:38 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -26,49 +26,57 @@ # Utility for cleaning up MIT/GNU Scheme build directories. # The working directory must be the top-level source directory. -if [ $# -le 1 ]; then - echo "usage: $0 ..." +set -e + +if [ ${#} -le 1 ]; then + echo "usage: ${0} ..." exit 1 fi -COMMAND=$1 +COMMAND=${1} shift -SUBDIRS="$@" +SUBDIRS=${@} FULL=no +C=no DIST=no MAINTAINER=no -case "${COMMAND}" in +case ${COMMAND} in mostlyclean) ;; clean) FULL=yes ;; -distclean | c-clean) +c-clean) + FULL=yes + C=yes + ;; +distclean) FULL=yes DIST=yes ;; maintainer-clean) FULL=yes + C=yes DIST=yes MAINTAINER=yes ;; *) - echo "$0: Unknown command ${COMMAND}" + echo "${0}: Unknown command ${COMMAND}" exit 1 ;; esac -if [ "${COMMAND}" != c-clean ]; then - echo "rm -f liarc.stamp" - rm -f liarc.stamp -fi - if [ ${FULL} = yes ]; then echo "rm -f lib/*.com" rm -f lib/*.com fi +if [ ${C} = yes ]; then + echo "rm -f liarc.stamp" + rm -f liarc.stamp +fi + if [ ${DIST} = yes ]; then echo "rm -f Makefile config.cache config.log config.status" rm -f Makefile config.cache config.log config.status @@ -82,6 +90,6 @@ fi for SUBDIR in ${SUBDIRS}; do if test -x ${SUBDIR}/Clean.sh; then echo "making ${COMMAND} in ${SUBDIR}" - ( cd ${SUBDIR} && ./Clean.sh ${COMMAND} ) || exit 1 + ( cd ${SUBDIR} && ./Clean.sh ${COMMAND} ) fi done diff --git a/v7/src/Setup.sh b/v7/src/Setup.sh index 35835e1c3..e51dc8706 100755 --- a/v7/src/Setup.sh +++ b/v7/src/Setup.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Setup.sh,v 1.20 2007/05/01 04:54:52 cph Exp $ +# $Id: Setup.sh,v 1.21 2007/05/02 03:58:43 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -26,6 +26,8 @@ # Utility to set up the MIT/GNU Scheme build directories. # The working directory must be the top-level source directory. +set -e + if [ ! -x configure ]; then echo "autoconf" autoconf @@ -58,5 +60,5 @@ for SUBDIR in 6001 compiler cref edwin imail rcs runtime \ sf sos ssp star-parser win32 xdoc xml microcode; do echo "setting up ${SUBDIR}" maybe_link ${SUBDIR}/Setup.sh ../etc/Setup.sh - ( cd ${SUBDIR} && ./Setup.sh "$@" ) || exit 1 + ( cd ${SUBDIR} && ./Setup.sh "$@" ) done diff --git a/v7/src/compiler/Clean.sh b/v7/src/compiler/Clean.sh index 1b1688033..3edd6b903 100755 --- a/v7/src/compiler/Clean.sh +++ b/v7/src/compiler/Clean.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Clean.sh,v 1.16 2007/04/14 03:55:26 cph Exp $ +# $Id: Clean.sh,v 1.17 2007/05/02 03:58:48 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -26,7 +26,9 @@ # Utility for cleaning up the MIT/GNU Scheme compiler directory. # The working directory must be the compiler directory. -if [ $# -ne 1 ]; then +set -e + +if [ ${#} -ne 1 ]; then echo "usage: ${0} " exit 1 fi @@ -34,44 +36,23 @@ fi TOPDIR=${TOPDIR:-`pwd`/..} export TOPDIR CLEANSH=${TOPDIR}/etc/Clean.sh -"${CLEANSH}" "${1}" rm-pkg - -case "${1}" in -c-clean) - SUBDIR_CMDS="rm-bin rm-com-sans-c" - ;; -*) - SUBDIR_CMDS="rm-bin rm-com" - ;; -esac +"${CLEANSH}" "${1}" for SUBDIR in back base fggen fgopt machine rtlbase rtlgen rtlopt; do if [ -d "${SUBDIR}" ]; then echo "making ${1} in ${SUBDIR}" - (cd "${SUBDIR}" && "${CLEANSH}" "${1}" "${SUBDIR_CMDS}") + (cd "${SUBDIR}" && "${CLEANSH}" "${1}") fi done -case "${1}" in -distclean | maintainer-clean | c-clean) +case ${1} in +distclean | maintainer-clean) rm -f machine compiler.cbf compiler.pkg compiler.sf - "${CLEANSH}" "${1}" "${SUBDIR_CMDS}" ;; esac -rm -f compiler-unx.o -case "${1}" in -c-clean) - ;; -*) - rm -f compiler-unx.c - ;; -esac - -case "${1}" in +case ${1} in maintainer-clean) rm -f machines/vax/dinstr[123].scm ;; esac - -exit 0 diff --git a/v7/src/compiler/Setup.sh b/v7/src/compiler/Setup.sh index c359e1396..9de164819 100755 --- a/v7/src/compiler/Setup.sh +++ b/v7/src/compiler/Setup.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Setup.sh,v 1.9 2007/01/05 21:19:20 cph Exp $ +# $Id: Setup.sh,v 1.10 2007/05/02 03:58:53 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -26,12 +26,12 @@ # Utility to set up the MIT/GNU Scheme compiler directory. # The working directory must be the compiler directory. +set -e + . ../etc/functions.sh -../etc/Setup.sh "$@" +../etc/Setup.sh "${@}" for N in 1 2 3; do maybe_link machines/vax/dinstr${N}.scm instr${N}.scm done - -exit 0 diff --git a/v7/src/edwin/Clean.sh b/v7/src/edwin/Clean.sh index 71769658f..d92e5ccf6 100755 --- a/v7/src/edwin/Clean.sh +++ b/v7/src/edwin/Clean.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Clean.sh,v 1.13 2007/04/04 05:08:19 riastradh Exp $ +# $Id: Clean.sh,v 1.14 2007/05/02 03:58:58 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -26,8 +26,10 @@ # Utility for cleaning up the MIT/GNU Scheme edwin directory. # The working directory must be the edwin directory. -if [ $# -ne 1 ]; then - echo "usage: $0 " +set -e + +if [ ${#} -ne 1 ]; then + echo "usage: ${0} " exit 1 fi @@ -35,14 +37,9 @@ fi echo "rm -rf edwin.bld" rm -f edwin.bld - echo "rm -f edwin-unx.crf edwin-w32.crf edwin-os2.crf" rm -f edwin-unx.crf edwin-w32.crf edwin-os2.crf - echo "rm -f edwin-unx.pkd edwin-w32.pkd edwin-os2.pkd" rm -f edwin-unx.pkd edwin-w32.pkd edwin-os2.pkd - echo "rm -f edwin-unx.fre edwin-w32.fre edwin-os2.fre" rm -f edwin-unx.fre edwin-w32.fre edwin-os2.fre - -exit 0 diff --git a/v7/src/etc/Clean.sh b/v7/src/etc/Clean.sh index 31edbe09a..f861b9a2a 100755 --- a/v7/src/etc/Clean.sh +++ b/v7/src/etc/Clean.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Clean.sh,v 1.18 2007/04/29 17:56:15 cph Exp $ +# $Id: Clean.sh,v 1.19 2007/05/02 03:59:03 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -26,54 +26,54 @@ # Utility for cleaning up an MIT/GNU Scheme build directory. # The working directory must be the build directory. -if [ $# -eq 1 ]; then - COMMAND="${1}" - case "${COMMAND}" in - c-clean) - KEYWORDS="rm-bin rm-com-sans-c rm-pkg" - ;; - *) - KEYWORDS="rm-bin rm-com rm-pkg" +set -e + +if [ ${#} -eq 1 ]; then + COMMAND=${1} + KEYWORDS="rm-bin rm-com rm-pkg" + case ${COMMAND} in + c-clean | maintainer-clean) + KEYWORDS="${KEYWORDS} rm-c" ;; esac -elif [ $# -ge 2 ]; then - COMMAND="${1}" +elif [ ${#} -ge 2 ]; then + COMMAND=${1} shift - KEYWORDS="$*" + KEYWORDS=${*} else - echo "usage: $0 ..." + echo "usage: ${0} ..." exit 1 fi -DIST="no" -MAINTAINER="no" -case "${COMMAND}" in -mostlyclean | clean) +DIST=no +MAINTAINER=no +case ${COMMAND} in +mostlyclean | clean | c-clean) ;; -distclean | c-clean) - DIST="yes" +distclean) + DIST=yes ;; maintainer-clean) - DIST="yes" - MAINTAINER="yes" + DIST=yes + MAINTAINER=yes ;; *) - echo "$0: Unknown command ${COMMAND}" + echo "${0}: Unknown command ${COMMAND}" exit 1 ;; esac -TOPDIR="${TOPDIR:-..}" +TOPDIR=${TOPDIR:-..} . "${TOPDIR}/etc/functions.sh" -if [ "${DIST}" = "yes" ]; then +if [ ${DIST} = yes ]; then if [ -f Makefile.in ] && [ -f Makefile ]; then echo "rm Makefile" rm Makefile fi fi -if [ "${MAINTAINER}" = "yes" ]; then +if [ ${MAINTAINER} = yes ]; then maybe_unlink Makefile "${TOPDIR}/Makefile.std" maybe_unlink .edwin-ffi ed-ffi.scm for FN in Clean.sh Setup.sh Stage.sh Tags.sh; do @@ -82,22 +82,14 @@ if [ "${MAINTAINER}" = "yes" ]; then fi for KEYWORD in ${KEYWORDS}; do - case "${KEYWORD}" in + case ${KEYWORD} in rm-bin) echo "rm -f *.bin *.ext" rm -f *.bin *.ext ;; rm-com) - echo "rm -f *.com *.bci *.c *.o *.so *.sl *.dylib" - rm -f *.com *.bci *.c *.o *.so *.sl *.dylib - ;; - rm-com-sans-c) echo "rm -f *.com *.bci *.o *.so *.sl *.dylib" rm -f *.com *.bci *.o *.so *.sl *.dylib - ;; - rm-old-pkg) - echo "rm -f *.bco *.bld *.glo *.con *.ldr" - rm -f *.bco *.bld *.glo *.con *.ldr ;; rm-pkg) echo "rm -f *-unx.crf *-unx.fre *-unx.pkd" @@ -107,7 +99,9 @@ for KEYWORD in ${KEYWORDS}; do echo "rm -f *-os2.crf *-os2.fre *-os2.pkd" rm -f *-os2.crf *-os2.fre *-os2.pkd ;; + rm-c) + echo "rm -f *.c" + rm -f *.c + ;; esac done - -exit 0 diff --git a/v7/src/etc/Setup.sh b/v7/src/etc/Setup.sh index 232fb0a49..1bef115e8 100755 --- a/v7/src/etc/Setup.sh +++ b/v7/src/etc/Setup.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Setup.sh,v 1.12 2007/01/05 21:19:25 cph Exp $ +# $Id: Setup.sh,v 1.13 2007/05/02 03:59:08 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -26,6 +26,8 @@ # Utility to set up an MIT/GNU Scheme build directory. # The working directory must be the build directory. +set -e + . ../etc/functions.sh if [ ! -f Makefile.in ]; then @@ -35,6 +37,6 @@ for FN in Clean.sh Stage.sh Tags.sh; do maybe_link ${FN} ../etc/${FN} done -[ -e ed-ffi.scm ] && maybe_link .edwin-ffi ed-ffi.scm - -exit 0 +if [ -e ed-ffi.scm ]; then + maybe_link .edwin-ffi ed-ffi.scm +fi diff --git a/v7/src/microcode/Clean.sh b/v7/src/microcode/Clean.sh index 14b436e45..ae4c7fd2e 100755 --- a/v7/src/microcode/Clean.sh +++ b/v7/src/microcode/Clean.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Clean.sh,v 1.7 2007/04/04 05:08:19 riastradh Exp $ +# $Id: Clean.sh,v 1.8 2007/05/02 03:59:13 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -26,12 +26,14 @@ # Utility for cleaning up the MIT/GNU Scheme microcode directory. # The working directory must be the microcode directory. -if [ $# -ne 1 ]; then - echo "usage: $0 " +set -e + +if [ ${#} -ne 1 ]; then + echo "usage: ${0} " exit 1 fi -case "${1}" in +case ${1} in mostlyclean | clean | distclean | c-clean) ;; maintainer-clean) @@ -40,13 +42,11 @@ maintainer-clean) fi ;; *) - echo "$0: Unknown command ${1}" + echo "${0}: Unknown command ${1}" exit 1 ;; esac if [ -f Makefile ]; then - make ${1} + make "${1}" fi - -exit 0 diff --git a/v7/src/microcode/Setup.sh b/v7/src/microcode/Setup.sh index 1617d847e..ed644d8c7 100755 --- a/v7/src/microcode/Setup.sh +++ b/v7/src/microcode/Setup.sh @@ -1,6 +1,6 @@ #!/bin/sh -# $Id: Setup.sh,v 1.11 2007/01/05 21:19:25 cph Exp $ +# $Id: Setup.sh,v 1.12 2007/05/02 03:59:18 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -26,6 +26,8 @@ # Program to set up MIT/GNU Scheme microcode from CVS for distribution. # Requires `gcc' and `scheme'. +set -e + if [ ! -f config.h.in ]; then echo "autoheader" autoheader @@ -34,7 +36,7 @@ if [ ! -x configure ]; then echo "autoconf" autoconf fi -( cd cmpauxmd && make ) +( cd cmpauxmd && make "${@}" ) if [ ! -f Makefile.in ]; then - makegen/makeinit.sh "$@" + makegen/makeinit.sh "${@}" fi diff --git a/v7/src/microcode/makegen/Makefile.in.in b/v7/src/microcode/makegen/Makefile.in.in index 425f391b2..be178c3ab 100644 --- a/v7/src/microcode/makegen/Makefile.in.in +++ b/v7/src/microcode/makegen/Makefile.in.in @@ -1,6 +1,6 @@ # -*- Makefile -*- # -# $Id: Makefile.in.in,v 1.50 2007/05/01 04:55:12 cph Exp $ +# $Id: Makefile.in.in,v 1.51 2007/05/02 03:59:23 cph Exp $ # # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, # 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -138,11 +138,9 @@ ALL_PROGRAMS = scheme ALL_LIBS = $(aux_LIBS) ALL_DATA = $(aux_DATA) -MOSTLYCLEAN_C_FILES = *.o usrdef.c compinit.c compinit.h \ +MOSTLYCLEAN_FILES = *.o usrdef.c compinit.c compinit.h cmpauxmd.s \ $(LIARC_OBJECTS) $(LIARC_BUNDLE_CLEAN_FILES) -MOSTLYCLEAN_FILES = $(MOSTLYCLEAN_C_FILES) cmpauxmd.s utabmd.c utabmd.bci - CLEAN_FILES = $(ALL_PROGRAMS) $(ALL_LIBS) $(ALL_DATA) $(EXTRA_PROGRAMS) DISTCLEAN_FILES = Makefile config.h config.cache config.log config.status \ @@ -152,7 +150,7 @@ DISTCLEAN_FILES = Makefile config.h config.cache config.log config.status \ MAINTAINER_CLEAN_FILES = Makefile.in Makefile.deps liarc-vars liarc-rules \ config.h.in configure TAGS -C_CLEAN_FILES = $(MOSTLYCLEAN_C_FILES) $(CLEAN_FILES) $(DISTCLEAN_FILES) +C_CLEAN_FILES = utabmd.c utabmd.bci # **** Implicit rules **** @@ -229,13 +227,12 @@ distclean: clean -rm -f $(DISTCLEAN_FILES) -rm -rf autom4te.cache -maintainer-clean: distclean +maintainer-clean: c-clean distclean -rm -f $(MAINTAINER_CLEAN_FILES) ( cd cmpauxmd && $(MAKE) $@ ) -c-clean: +c-clean: clean -rm -f $(C_CLEAN_FILES) - -rm -rf autom4te.cache install: install-auxLIBS install-auxDATA $(mkinstalldirs) $(DESTDIR)$(bindir) -- 2.25.1