From 8b1b3b34c1957243eba3a65910280b992bb91cf7 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 8 Dec 2000 06:04:32 +0000 Subject: [PATCH] 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. --- v7/src/Makefile | 7 +- v7/src/Makefile.std | 10 +-- v7/src/Tags.sh | 27 +++++++ v7/src/compiler/Makefile | 155 --------------------------------------- v7/src/compiler/Tags.sh | 25 +++++++ v7/src/etc/Clean.sh | 4 +- v7/src/etc/Setup.sh | 4 +- 7 files changed, 63 insertions(+), 169 deletions(-) create mode 100755 v7/src/Tags.sh delete mode 100644 v7/src/compiler/Makefile create mode 100755 v7/src/compiler/Tags.sh diff --git a/v7/src/Makefile b/v7/src/Makefile index e80cd1ed6..2d4a8e6df 100644 --- a/v7/src/Makefile +++ b/v7/src/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.17 2000/12/08 04:49:31 cph Exp $ +# $Id: Makefile,v 1.18 2000/12/08 06:04:32 cph Exp $ # # Copyright (c) 2000 Massachusetts Institute of Technology # @@ -33,9 +33,6 @@ mostlyclean clean distclean maintainer-clean: ./Clean.sh $@ $(SUBDIRS) tags TAGS: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - ( cd $${SUBDIR} && $(MAKE) $@ ) || exit 1; \ - done + ./Tags.sh $(SUBDIRS) .PHONY: all setup mostlyclean clean distclean maintainer-clean tags TAGS diff --git a/v7/src/Makefile.std b/v7/src/Makefile.std index f6fbe5ab7..a6ae3ccfc 100644 --- a/v7/src/Makefile.std +++ b/v7/src/Makefile.std @@ -1,4 +1,4 @@ -# $Id: Makefile.std,v 1.9 2000/12/08 04:49:34 cph Exp $ +# $Id: Makefile.std,v 1.10 2000/12/08 06:04:32 cph Exp $ # # Copyright (c) 2000 Massachusetts Institute of Technology # @@ -29,12 +29,12 @@ all: setup: ./Setup.sh -tags TAGS: - etags *.scm - mostlyclean clean distclean maintainer-clean: ./Clean.sh $@ +tags TAGS: + ./Tags.sh + stage1: ./Stage.sh make 1 @@ -53,5 +53,5 @@ stage3: unstage3: ./Stage.sh unmake 3 -.PHONY: all setup tags TAGS mostlyclean clean distclean maintainer-clean +.PHONY: all setup mostlyclean clean distclean maintainer-clean tags TAGS .PHONY: stage1 unstage1 stage2 unstage2 stage3 unstage3 diff --git a/v7/src/Tags.sh b/v7/src/Tags.sh new file mode 100755 index 000000000..fad1362d0 --- /dev/null +++ b/v7/src/Tags.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# +# $Id: Tags.sh,v 1.1 2000/12/08 06:04:32 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 make TAGS files for MIT Scheme build directories. +# The working directory must be the top-level source directory. + +for SUBDIR; do + echo "making TAGS in ${SUBDIR}" + ( cd ${SUBDIR} && ./Tags.sh ) || exit 1 +done diff --git a/v7/src/compiler/Makefile b/v7/src/compiler/Makefile deleted file mode 100644 index 170b89fb6..000000000 --- a/v7/src/compiler/Makefile +++ /dev/null @@ -1,155 +0,0 @@ -# $Id: Makefile,v 1.19 2000/12/06 05:13:58 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. - -# Makefile for MIT Scheme compiler. -# This makefile supports some utilities for the compiler. -# The compiler provides its own tools for rebuilding itself, -# written in Scheme. - -FIXED_SUBDIRS = back base fggen fgopt rtlbase rtlgen rtlopt -SUBDIRS = $(FIXED_SUBDIRS) machine - -SHELL = /bin/sh - -all: - echo "No ALL action" - -setup: - (cd machines/vax; \ - for N in 1 2 3; do \ - test -f dinstr$${N}.scm || ln -s instr$${N}.scm dinstr$${N}.scm; \ - done) - -tags TAGS: - etags back/*.scm base/*.scm fggen/*.scm fgopt/*.scm \ - machines/*/*.scm rtlbase/*.scm rtlgen/*.scm rtlopt/*.scm - -mostlyclean: - @for SUBDIR in $(FIXED_SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - (cd $${SUBDIR} && rm -f *.bin *.ext *.com *.bci); \ - done - @if test -d machine/.; then \ - echo "making $@ in machine"; \ - (cd machine && rm -f *.bin *.ext *.com *.bci); \ - fi - rm -f compiler.bco compiler.bld compiler.con compiler.crf \ - compiler.fre compiler.glo compiler.ldr - -clean: mostlyclean - -distclean: clean - rm -f machine compiler.cbf compiler.pkg compiler.sf make.com - -maintainer-clean: distclean - rm -f .edwin-ffi - -stage1: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - (cd $${SUBDIR} && mkdir STAGE1 && mv -f *.com *.bci STAGE1/.); \ - done - -unstage1: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - (cd $${SUBDIR} && mv -f STAGE1/* . && rmdir STAGE1); \ - done - -rmstage1: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - rm -rf $${SUBDIR}/STAGE1; \ - done - -cpstage1: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - (cd $${SUBDIR} && cp -p STAGE1/* .); \ - done - -lnstage1: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - (cd $${SUBDIR} && ln -f STAGE1/* .); \ - done - -stage2: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - (cd $${SUBDIR} && mkdir STAGE2 && mv -f *.com *.bci STAGE2/.); \ - done - -unstage2: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - (cd $${SUBDIR} && mv -f STAGE2/* . && rmdir STAGE2); \ - done - -rmstage2: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - rm -rf $${SUBDIR}/STAGE2; \ - done - -cpstage2: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - (cd $${SUBDIR} && cp -p STAGE2/* .); \ - done - -lnstage2: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - (cd $${SUBDIR} && ln -f STAGE2/* .); \ - done - -stage3: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - (cd $${SUBDIR} && mkdir STAGE3 && mv -f *.com *.bci STAGE3/.); \ - done - -unstage3: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - (cd $${SUBDIR} && mv -f STAGE3/* . && rmdir STAGE3); \ - done - -rmstage3: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - rm -rf $${SUBDIR}/STAGE3; \ - done - -cpstage3: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - (cd $${SUBDIR} && cp -p STAGE3/* .); \ - done - -lnstage3: - @for SUBDIR in $(SUBDIRS); do \ - echo "making $@ in $${SUBDIR}"; \ - (cd $${SUBDIR} && ln -f STAGE3/* .); \ - done - -.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 diff --git a/v7/src/compiler/Tags.sh b/v7/src/compiler/Tags.sh new file mode 100755 index 000000000..3db92a58f --- /dev/null +++ b/v7/src/compiler/Tags.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# +# $Id: Tags.sh,v 1.1 2000/12/08 06:04:32 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 make TAGS file for the MIT Scheme compiler directory. +# The working directory must be the compiler directory. + +etags back/*.scm base/*.scm fggen/*.scm fgopt/*.scm machine/*.scm \ + rtlbase/*.scm rtlgen/*.scm rtlopt/*.scm diff --git a/v7/src/etc/Clean.sh b/v7/src/etc/Clean.sh index 1ec8ca5d7..74782380c 100755 --- a/v7/src/etc/Clean.sh +++ b/v7/src/etc/Clean.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Clean.sh,v 1.2 2000/12/08 05:27:27 cph Exp $ +# $Id: Clean.sh,v 1.3 2000/12/08 06:04:32 cph Exp $ # # Copyright (c) 2000 Massachusetts Institute of Technology # @@ -37,7 +37,7 @@ case "${1}" in mostlyclean | clean | distclean) ;; maintainer-clean) - for FN in .edwin-ffi Clean.sh Makefile Setup.sh Stage.sh; do + for FN in .edwin-ffi Clean.sh Makefile Setup.sh Stage.sh Tags.sh; do if [ -L ${FN} ]; then echo "rm ${FN}" rm ${FN} diff --git a/v7/src/etc/Setup.sh b/v7/src/etc/Setup.sh index e37bee851..638116568 100755 --- a/v7/src/etc/Setup.sh +++ b/v7/src/etc/Setup.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: Setup.sh,v 1.2 2000/12/08 05:01:15 cph Exp $ +# $Id: Setup.sh,v 1.3 2000/12/08 06:04:32 cph Exp $ # # Copyright (c) 2000 Massachusetts Institute of Technology # @@ -35,7 +35,7 @@ maybe_link () } maybe_link Makefile ../etc/Makefile.std -for FN in Clean.sh Stage.sh; do +for FN in Clean.sh Stage.sh Tags.sh; do maybe_link ${FN} ../etc/${FN} done -- 2.25.1