From: Chris Hanson Date: Fri, 8 Dec 2000 05:34:01 +0000 (+0000) Subject: Redesign the structure for setup and clean rules. New structure uses X-Git-Tag: 20090517-FFI~3096 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=42edcc6dcaf273278a4e661e7b6b43dacfe12b1b;p=mit-scheme.git Redesign the structure for setup and clean rules. New structure uses shell scripts in each directory, which the makefiles refer to. This greatly simplifies the configuration code because it was getting too painful to put complex shell scripts inside the makefiles. --- diff --git a/v7/src/compiler/Setup.sh b/v7/src/compiler/Setup.sh new file mode 100755 index 000000000..72da3bb3b --- /dev/null +++ b/v7/src/compiler/Setup.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# +# $Id: Setup.sh,v 1.1 2000/12/08 05:34:01 cph Exp $ +# +# Copyright (c) 2000 Massachusetts Institute of Technology +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# Utility to set up the MIT Scheme compiler directory. +# The working directory must be the compiler directory. + +if [ $# -ne 0 ]; then + echo "usage: $0" + exit 1 +fi + +../etc/Setup.sh + +maybe_link () +{ + if [ ! -e ${1} ]; then + echo "ln -s ${2} ${1}" + ln -s ${2} ${1} + fi +} + +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/cref/Clean.sh b/v7/src/cref/Clean.sh index f5d0d5b13..d55a635c5 100755 --- a/v7/src/cref/Clean.sh +++ b/v7/src/cref/Clean.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Clean.sh,v 1.1 2000/12/08 04:50:44 cph Exp $ +# $Id: Clean.sh,v 1.2 2000/12/08 05:27:27 cph Exp $ # # Copyright (c) 2000 Massachusetts Institute of Technology # @@ -26,7 +26,7 @@ if [ $# -ne 1 ]; then exit 1 fi -../etc/Clean.sh "${1}" recursive +../etc/Clean.sh "${1}" rm-bin rm-com rm-pkg-bin echo "rm -f cref.con cref.ldr" rm -f cref.con cref.ldr diff --git a/v7/src/edwin/Clean.sh b/v7/src/edwin/Clean.sh index 6a494c974..aa38fc34e 100755 --- a/v7/src/edwin/Clean.sh +++ b/v7/src/edwin/Clean.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Clean.sh,v 1.1 2000/12/08 04:50:26 cph Exp $ +# $Id: Clean.sh,v 1.2 2000/12/08 05:27:27 cph Exp $ # # Copyright (c) 2000 Massachusetts Institute of Technology # @@ -26,9 +26,9 @@ if [ $# -ne 1 ]; then exit 1 fi -../etc/Clean.sh "${1}" recursive +../etc/Clean.sh "${1}" rm-bin rm-com rm-pkg-bin -echo "rm -f edwin.bld edwinunx.* edwinw32.* edwinos2.*" -rm -f edwin.bld edwinunx.* edwinw32.* edwinos2.* +echo "rm -f edwinunx.* edwinw32.* edwinos2.*" +rm -f edwinunx.* edwinw32.* edwinos2.* exit 0 diff --git a/v7/src/etc/Clean.sh b/v7/src/etc/Clean.sh index da0db4f8e..1ec8ca5d7 100755 --- a/v7/src/etc/Clean.sh +++ b/v7/src/etc/Clean.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Clean.sh,v 1.1 2000/12/08 04:49:54 cph Exp $ +# $Id: Clean.sh,v 1.2 2000/12/08 05:27:27 cph Exp $ # # Copyright (c) 2000 Massachusetts Institute of Technology # @@ -22,11 +22,14 @@ # The working directory must be the build directory. if [ $# -eq 1 ]; then - RECURSIVE=no -elif [ $# -eq 2 ] && [ "${2}" = "recursive" ]; then - RECURSIVE=yes + COMMAND="$1" + KEYWORDS="rm-bin rm-com rm-pkg-src rm-pkg-bin" +elif [ $# -ge 2 ]; then + COMMAND="$1" + shift + KEYWORDS="$*" else - echo "usage: $0 [recursive]" + echo "usage: $0 ..." exit 1 fi @@ -47,12 +50,25 @@ maintainer-clean) ;; esac -echo "rm -f *.bin *.ext *.com *.bci *.bco *.bld *.crf *.fre *.glo" -rm -f *.bin *.ext *.com *.bci *.bco *.bld *.crf *.fre *.glo - -if [ ${RECURSIVE} = no ]; then - echo "rm -f *.con *.ldr" - rm -f *.con *.ldr -fi +for KEYWORD in ${KEYWORDS}; do + case ${KEYWORD} in + rm-bin) + echo "rm -f *.bin *.ext" + rm -f *.bin *.ext + ;; + rm-com) + echo "rm -f *.com *.bci" + rm -f *.com *.bci + ;; + rm-pkg-src) + echo "rm -f *.con *.ldr" + rm -f *.con *.ldr + ;; + rm-pkg-bin) + echo "rm -f *.bco *.bld *.crf *.fre *.glo" + rm -f *.bco *.bld *.crf *.fre *.glo + ;; + esac +done exit 0 diff --git a/v7/src/runtime-check/Clean.sh b/v7/src/runtime-check/Clean.sh new file mode 100755 index 000000000..2495eaf96 --- /dev/null +++ b/v7/src/runtime-check/Clean.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $Id: Clean.sh,v 1.1 2000/12/08 05:27:17 cph Exp $ +# +# Copyright (c) 2000 Massachusetts Institute of Technology +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# Utility for cleaning up the MIT Scheme runtime-check directory. +# The working directory must be the runtime-check directory. + +if [ $# -ne 1 ]; then + echo "usage: $0 " + exit 1 +fi + +../etc/Clean.sh "${1}" rm-com + +if [ "${1}" = "maintainer-clean" ]; then + echo "rm -f *.bin runtime.bco runtime.bld" + rm -f *.bin runtime.bco runtime.bld +fi + +exit 0 diff --git a/v7/src/runtime-check/Makefile b/v7/src/runtime-check/Makefile deleted file mode 100644 index ecd36dd1e..000000000 --- a/v7/src/runtime-check/Makefile +++ /dev/null @@ -1,105 +0,0 @@ -# $Id: Makefile,v 1.2 2000/12/07 23:08:49 cph Exp $ -# -# Copyright (c) 2000 Massachusetts Institute of Technology -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -# Standard Makefile for Scheme subsystem directories. -# This makefile supports some utilities for Scheme subsystems. -# Tools to rebuild these subsystems are written in Scheme and do not -# use `make'. - -SHELL = /bin/sh - -all: - echo "No ALL action" - -setup: - (cd ../runtime; \ - for FNS in *.scm; do \ - FN="`basename $${FNS} .scm`.bin"; \ - if test ! -e ../runtime-check/$${FN}; then \ - echo "ln -s ../runtime/$${FN} ../runtime-check/$${FN}"; \ - ln -s ../runtime/$${FN} ../runtime-check/$${FN}; \ - fi; \ - done; \ - for FN in runtime.bco runtime.bld; do \ - if test ! -e ../runtime-check/$${FN}; then \ - echo "ln -s ../runtime/$${FN} ../runtime-check/$${FN}"; \ - ln -s ../runtime/$${FN} ../runtime-check/$${FN}; \ - fi; \ - done) - -tags TAGS: - -mostlyclean: - -rm -f *.com *.bci - -clean: mostlyclean - -distclean: clean - -maintainer-clean: distclean - -rm -f *.bin runtime.bco runtime.bld - -stage1: - mkdir STAGE1 && mv -f *.com *.bci STAGE1/. - -unstage1: - mv -f STAGE1/* . && rmdir STAGE1 - -rmstage1: - rm -rf STAGE1 - -cpstage1: - cp -p STAGE1/* . - -lnstage1: - ln -f STAGE1/* . - -stage2: - mkdir STAGE2 && mv -f *.com *.bci STAGE2/. - -unstage2: - mv -f STAGE2/* . && rmdir STAGE2 - -rmstage2: - rm -rf STAGE2 - -cpstage2: - cp -p STAGE2/* . - -lnstage2: - ln -f STAGE2/* . - -stage3: - mkdir STAGE3 && mv -f *.com *.bci STAGE3/. - -unstage3: - mv -f STAGE3/* . && rmdir STAGE3 - -rmstage3: - rm -rf STAGE3 - -cpstage3: - cp -p STAGE3/* . - -lnstage3: - ln -f STAGE3/* . - -.PHONY: all setup tags TAGS mostlyclean clean distclean maintainer-clean -.PHONY: stage1 unstage1 rmstage1 cpstage1 lnstage1 -.PHONY: stage2 unstage2 rmstage2 cpstage2 lnstage2 -.PHONY: stage3 unstage3 rmstage3 cpstage3 lnstage3