# -*- Mode: Text;  -*-
# File: Makefile.site
# Author: Heinz Schmidt (hws@csis.dit.csiro.AU)
# Copyright (C) CSIRO Division of Information Technology, 1992
#
# COPYRIGHT NOTICE: This code is provided "AS IS" WITHOUT ANY WARRANTY
# and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
# LICENSE contained in the file: "sather/doc/license.txt" of the Sather
# distribution. The license is also available from ICSI, 1947 Center
# St., Suite 600, Berkeley CA 94704, USA.
#*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#* FUNCTION: Makefile header included by all Makefiles. The file 
#*    consists of three parts: 
#*        Makefile.site: you normally need to edit only this one.
#*        Makefile.mach: the machine dependent part and defaults.
#*           This is machine generated you do not want to change it.
#*           When porting you want to change Makefile.mach.cpp
#*           instead.
#*        Makefile.gen: the generic make plans.
#*
#* HISTORY:
#*  Feb  1 19:32 1992 (hws): Extracted from top level Makefile. Avoids
#*    the need to adapt 10 Makefiles when defaults change upon ports.
#* Created: Sat Feb  1 19:30:33 1992 (hws)
#*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# These are the variables that you should adjust.

# The ultimate location of your Sather installation.
SATHER_HOME = /proj/hop/sather

# The location of the untarred sather distribution (i.e. the path locating
# the directory this Makefile is in).
TOPDIR = /proj/hop/dist

# The architecture for which the executables are generated defines
# the bin directory. This may also be used to conditionalize
# compiles. See the file Makefile.mach for architecture dependent settings.
# We used the following symbols: sparc, mips, vax, sony,...
# You may have to differentiate further (mips-dec-ultrix,littlemips ...). 
ARCH = sun4

# After installing you may run "make setgrp" to set group and permissions
# of the directory tree, if your defaults are different from what you want
# the installation to be. The default group name is "sather".
SATHERGRP = csis

# During installation all files generated by the Sather compiler, including
# the boot compiler in the distribution, are built using $SATHER_MAKE.
# Note that with SATHER_MAKE = pmake, c_makefiles mentioned in .sather
# are still run using "make" since "pmake" does not seem to support "include"
# yet.
SATHER_MAKE = make

# The Garbage collector runs silent in the background by default.
# GCSILENT=SILENT, or is prints statistics GCSILENT=NOSILENT
GCSILENT=SILENT

# The Garbage collector allocates chunks of memory. The maximum number
# is defined in sys/GC/gc.h MAXHBLKS = 6144 and is fine for ~ 64MB
# configured swap space. The initial setting MAXHBLKS = 4096 seems to be
# meant for about 32MB swap space. Reached the previous limit when trying
# to compile the compiler with all checking and debugging options switched
# on.

# The Sather to C (sac) interface provides some predefined 
# classes, C files etc that simplify interfacing to C. But it
# is not necessary to include them. You may want to follow different
# conventions. If you have Emacs users in your site, sac also includes
# a generator for generating C interface classes from higher level
# sather like description of C packages. 
# YES or NO controls whether sac installation skipped.
SKIPSAC = NO

# The release version that users refer to in bug reports to sather-admin.
RELEASEVERSION = 0.2g

# This should expand into the current date on your host. If not
# enter the current date as a string like "Thu Mar 19 16:09:31 EST 1992".
# The compiler will get to know about this and allow you to
# distinguish compiler listings of different versions at your site.
# The hostname may help us ask funny questions when tracking down compiler 
# errors due to compiling the compiler on that host.
CONFIG_DATE = `date`
HOSTNAME = `hostname`




# 1 "Mkf.mach.cpp" 
# -*- Mode: Text;  -*-
# File: Makefile.mach.cpp
# 
# Copyright (C) CSIRO Division of Information Technology, 1992
#
# COPYRIGHT NOTICE: This code is provided "AS IS" WITHOUT ANY WARRANTY
# and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
# LICENSE contained in the file: "sather/doc/license.txt" of the Sather
# distribution. The license is also available from ICSI, 1947 Center
# St., Suite 600, Berkeley CA 94704, USA.
#*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#* FUNCTION: Makefile header included by all Makefiles. The file 
#*    consists of three parts: 
#*        Makefile.site: you normally need to edit only this one.
#*        Makefile.mach: the machine dependent part and defaults.
#*           This is machine generated you do not want to change it.
#*           When porting you want to change Makefile.mach.cpp
#*           instead.
#*        Makefile.gen: the generic make plans.
#*  
#*    This file contains the default macros possible overridden
#*    by machine dependent settings.
#*
#* HISTORY:
#*  Feb  1 19:32 1992 (hws): Extracted from top level Makefile. Avoids
#*    the need to adapt 10 Makefiles when defaults change upon ports.
#* Created: Sat Feb  1 19:30:33 1992 (hws)
#*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# These are default options you do *NOT* want to modify.


# 37 "Mkf.mach.cpp" 



# 44 "Mkf.mach.cpp" 

AR = /bin/ar


AR = /bin/ar
AS = /bin/as
AWK = /bin/awk

COMPRESS = /usr/ucb/compress
CP = /bin/cp

# I tried /lib/cpp on NeXT but this confuses make by  "/**/#" -> " #"
# If your cc is not properly installed you may
# do         make CPP="(/lib/cpp | sed s,' \#','#',g ) <" config
# instead, overriding the current CPP setting
CPP = cc -E

ECHO = /bin/echo
ED = /bin/ed
FALSE = /bin/false
FIND = /usr/bin/find

# 69 "Mkf.mach.cpp" 

INSTALL = /usr/bin/install
LN = /bin/ln -s


# 75 "Mkf.mach.cpp" 
# 78 "Mkf.mach.cpp" 

# 81 "Mkf.mach.cpp" 

MATHLIB=/usr/lib/libm.a



MD = /bin/mkdir
MV = /bin/mv

# 92 "Mkf.mach.cpp" 

# 95 "Mkf.mach.cpp" 

RANLIB = /usr/bin/ranlib



RM = /bin/rm -f
SED = /bin/sed
SHELL = /bin/sh

# 106 "Mkf.mach.cpp" 

TAR = /bin/tar


TRUE = /bin/true
WC = /usr/ucb/wc
YACC = /usr/bin/yacc

# Problems with your ARCHITECTURE or PORTING? 
# You may have to change here if you are porting.
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Architecture specific settings, extended with each port and perhaps
# replacing some of the defaults above.

# #include ${TOPDIR}/makemach
# -*- Mode: Text;  -*-
# File: makemach.cpp
# 
# 
# Copyright (C) CSIRO Division of Information Technology, 1992
# COPYRIGHT NOTICE: This code is provided "AS IS" WITHOUT ANY WARRANTY
# and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
# LICENSE contained in the file: "sather/doc/license.txt" of the Sather
# distribution. The license is also available from ICSI, 1947 Center
# St., Suite 600, Berkeley CA 94704, USA.
#*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#* FUNCTION: Machine dependent setting for Makefile.header
#*           (All makefiles should be rewritten to use imake).
#* HISTORY:
#* Created: Mon Feb  3 00:27:40 1992 (hws)
#*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# The following conditionals are used so far and the
# current setting is depicted in the generated file.
# If you are porting to a new machine please record the new option here.
# It may help someone else interpreting compile conditionalizations.
# 
# Architectures:
# sparc_: 1, sun3_: sun3, sun4_: sun4,
# mips_: mips, hpux_: hpux, vax_: vax, sony_: sony,
# sequent_: sequent, vax_: vax, mips_: mips, MIPSEL_: MIPSEL,
# NeXT_: NeXT, mc68000_: mc68000, hp9000s300_: hp9000s300,
# i386_: i386, ibm032_: ibm032, _IBMR2_: _IBMR2,
# SCO_: SCO
# 
# Operating systems:
# unix_: 1, bsd4_2_: bsd4_2, bsd4_3_: bsd4_3, SYSTYPE_BSD: SYSTYPE_BSD
# SYSV_: SYSV, SYSTYPE_SYSV_: SYSTYPE_SYSV, M_SYSV_: M_SYSV
# ultrix_: ultrix, __MACH___: __MACH__

# MACHINE DEPENDENT REDEFINITIONS OF FLAGS

# -O is a bad option for compiling the cs MAIN_.c
# because cc crashes due to size. The main routine
# itself is relatively small. Other than this the options can be
# just like CFLAGS. MAINFLAGS is used when the MAIN_.c of 
# the sather compiler is processed. It has lots of symbols
# and requires special table sizes on some unixes.
# Since we include this header file, every make file sees the
# defaults, can save them or append to them or replace them.

# These are passed to cc, TCLIBS is only used in some tests etc/test
CC = cc
CFLAGS = -O -DSATHER -DGC_ 
TCLIBS =
MFLAGS =

# cc flags when compiling the big compiler MAIN_.c
MAINFLAGS= -DSATHER -DGC_
# some systems even want a different compiler in this case.
MAINCC=${CC}

# These are only passed to the make step which compiles the
# boot compiler and can be used to override flags in the make file
# that was generated when the distribution was constructed on another
# machine: compiler/cs.cs.boot/mkCS
BOOTFLAGS=
# These are passed to cs and can include -cflags, -cc etc., cf.
# doc/cs_options.txt. Will show up in the make file created
# by the compiler during the installation.
CSFLAGS = -w

# 192 "Mkf.mach.cpp" 


# 206 "Mkf.mach.cpp" 


# 215 "Mkf.mach.cpp" 

 
# 232 "Mkf.mach.cpp" 


# 237 "Mkf.mach.cpp" 


# 242 "Mkf.mach.cpp" 


# 246 "Mkf.mach.cpp" 


# 252 "Mkf.mach.cpp" 


# 260 "Mkf.mach.cpp" 


# WHILE PORTING ...
# MACHINE DEPENDENT SUBSYSTEM INCLUSION
# The following variables help skipping installations of part of the
# system that may require adaptation.

# The Sather debugger (sdb) is based on the GNU debugger. The current
# distribution contains only the setting for 1. You need
# to run your local Gnu gdb directory against debugger/C and
# edit the local make file there. We really should make this
# via a gdb.${ARCH} directory and links into it for the 3 or 4 files
# that are machine dependent.
# YES or NO controls whether sdb installation skipped.


SKIPSDB = NO
# 279 "Mkf.mach.cpp" 


# The Garbage Collector (GC) may require a new machine dependent
# patch if the machine is not yet supported.
# YES or NO controls whether gc installation skipped.
# 286 "Mkf.mach.cpp" 

SKIPGC = NO

# GC V1.9 runs now on Dec mipses and RT too.
# #if defined(mips) & defined(ultrix) & defined(bsd4_2)
# SKIPGC = YES
# #else
# SKIPGC = NO
# #endif

# 
# Local flags while developing, porting etc.
LOCFLAGS =


# This part should perhaps stay as it is. See also the note below.
# 
# Do not delete param passing for sather home and topdir, ever.
# "make dist" will run clean on the development system!
# Do not include CFLAGS param passing here, so every make file 
# can see the shared defaults (XCFLAGS) and append to them or redefine them
# appropirately.
# Moreover pass on make parameters (${MAKE}) so we can do the few non-interfering
# things "make ARCH=mips -f Makefile" on disjoint subdirectories for different
# architectures. 

MKCMD = ${MAKE} SATHER_HOME=${SATHER_HOME} TOPDIR=${TOPDIR}

CS = ${TOPDIR}/bin.${ARCH}/cs -mak ${SATHER_MAKE}
# File: Mkf.gen
# Author: Jeff Bilmes
# Copyright (C) International Computer Science Institute, 1991
# Changes: Heinz Schmidt (hws@csis.dit.csiro.AU)
# Copyright (C) CSIRO Division of Information Technology, 1992
#
# COPYRIGHT NOTICE: This code is provided "AS IS" WITHOUT ANY WARRANTY
# and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
# LICENSE contained in the file: "sather/doc/license.txt" of the Sather
# distribution. The license is also available from ICSI, 1947 Center
# St., Suite 600, Berkeley CA 94704, USA.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# FUNCTION:
#    Top level Makefile for the Sather release.
#
#* HISTORY:
#* Last edited: Feb  1 17:40 1992 (hws)
#*  Feb  1 19:33 1992 (hws): include shared defaults now.
#*  Feb  1 17:39 1992 (hws): made bin directory architecture dependent.
#*  Nov 29 14:57 1991 (hws): SHELL just to be sure it is used.
#*  Nov 29 14:39 1991 (hws): # only leftmost, some make's don't
#* Created: Mon Jan  7 09:33:08 1991
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Local defaults
TARFILE = sa-${RELEASEVERSION}.tar

# Below we assume that "make config" was run already.
# and all the default settings are properly included.
# We restricted the use of MKCMD. The macro definitions
# given in MKCMD cannot be overriden by explicit macro parameters
# in all make facilities out there.
# Moreover since we include a make header everywhere appropriate
# settings may already be imported into the make file invoked, anyway.

all:
	@echo Building Sather Rel "${RELEASEVERSION}" for "${ARCH}"
	@echo 
	@echo Making Sather runtimes.
	-[ -d ./bin.${ARCH} ] || ${MD} ./bin.${ARCH}
	-${LN} ${MATHLIB} ./bin.${ARCH}/libm.a
	(cd ./sys/C; ${MKCMD} )
	@echo Making C file support for base classes.
	(cd ./lib/base/C; ${MKCMD} XCFLAGS="${CFLAGS}")
	@echo
	@echo Making boot compiler.
	(cd ./compiler; \
	    ${MKCMD} boot-setup; \
	    ${MKCMD} boot-compile; )
	${CP} ./compiler/cs ./bin.${ARCH}/cs
	@echo 
	@echo Making precompiled base classes.
	(cd ./sys/C/crt_pre; \
	   ${MAKE} SATHER_HOME=${TOPDIR} ; \
	   ${MAKE} SATHER_HOME=${TOPDIR} install; )
	@echo
	(cd ./compiler ; ${MAKE} SATHER_HOME=${TOPDIR} ; )
	${CP} ./compiler/cs ./bin.${ARCH}/cs
	if [ ${SKIPSDB} = NO ] ; then \
	   ${ECHO} ; \
	   ${ECHO} Making debugger'.' ; \
	   ( cd ./debugger; \
	   ${MAKE} SATHER_HOME=${TOPDIR} ); \
	else \
	   ${ECHO} ; \
	   ${ECHO} SKIPSDB Debugger installation skipped'.' ; \
	fi
	if [ ${SKIPSAC} = NO ] ; then \
	  ${ECHO} ; \
	  ${ECHO} Making SAC'.' ; \
	  (cd ./sac; \
	     ${MAKE} SATHER_HOME=${TOPDIR} ) ; \
	else \
	  ${ECHO} ; \
	  ${ECHO} SKIPSAC SAC installation skipped'.' ; \
	fi
	@echo Sather compilation complete.

# This is deliberately simple to avoid any need for default settings.
# as this will be run with settings associated to the architecture
# on which the distribution was generated.

HEAD= Mkf.mach
INCL= cat Mkf.site ${HEAD}
MAKECPPFILES= sys/C/GC/Mkf.cpp Mkf.mach.cpp
MAKEPLANS= Mkf.gen compiler/Mkf.gen debugger/Mkf.gen debugger/C/Mkf.gen \
lib/base/C/Mkf.gen lib/user_interface/C/Mkf.gen lib/user_interface/xview/Mkf.gen \
etc/test/Mkf.gen sac/Mkf.gen \
sys/C/GC/Mkf.cpp sys/C/Mkf.gen sys/C/crt_pre/Mkf.gen

config: 
	@echo Setting up Sather Rel "${RELEASEVERSION}" configuration
	@echo Generating machine dependent make header using CPP "= ${CPP}"
	-${CPP} Mkf.mach.cpp > ${HEAD}
	-${CPP} sys/C/GC/Mkf.cpp > sys/C/GC/Mkf.gen
	@echo Including machine dependent header in other make files
	-${INCL} Mkf.gen > Makefile
	-${INCL} compiler/Mkf.gen >  compiler/Makefile
	-${INCL} debugger/Mkf.gen >  debugger/Makefile
	-${INCL} debugger/C/Mkf.gen >  debugger/C/Makefile
	-${INCL} lib/base/C/Mkf.gen >  lib/base/C/Makefile
	-${INCL} lib/user_interface/C/Mkf.gen >  lib/user_interface/C/Makefile
	-${INCL} lib/user_interface/xview/Mkf.gen >  lib/user_interface/xview/Makefile
	-${INCL} etc/test/Mkf.gen >  etc/test/Makefile
	-${INCL} sac/Mkf.gen >  sac/Makefile
	-${INCL} sys/C/Mkf.gen >  sys/C/Makefile
	-${INCL} sys/C/GC/Mkf.gen > sys/C/GC/Makefile
	-${INCL} sys/C/crt_pre/Mkf.gen >  sys/C/crt_pre/Makefile
	make showconfig

findmake:
	@echo "Looking for PAT=${PAT} in all make files."
	fgrep ${PAT} ${MAKEPLANS} ${MAKECPPFILES}

EXPLICITCFLAGS=sys/C/GC/Mkf.cpp lib/user_interface/C/Mkf.gen
PAT=CFLAGS

showconfig:
	@echo
	@echo "Sather Rel${RELEASEVERSION}, Copyright (C) 1992 Intl Computer Science Inst, Berkeley"
	@echo "Configured to install"
	@echo " For architecture:      ${ARCH}"
	@echo " From top:              ${TOPDIR}"
	@echo " To home:               ${SATHER_HOME}"
	@echo " Make facility will be: ${SATHER_MAKE}"
	@echo " Sather compiler flags: ${CSFLAGS}"
	@echo " C compiler will be:    ${CC}"
	@echo " C compiler flags:      ${CFLAGS}"
	@echo " Except MAIN will use:  ${MAINFLAGS}"
	@echo " Except see make files: ${EXPLICITCFLAGS}"
	@echo " SDB will be skipped:   ${SKIPSDB}"
	@echo " GC will run:           ${GCSILENT}'ly"
	@echo

protocol:
	@echo "Making a protocoled run. This is supposed to run under Emacs shell"
	@echo "so you can save it. You need SATHER_MAKE (currently ${SATHER_MAKE})."
	( make config ; date ; ${SATHER_MAKE} clean ; date ; ${SATHER_MAKE} ; date )

testsuite:
	@echo "Run several tests. This may take time."
	( cd test ; ${MAKE} tests )
	( cd lib/user_interface/xview/test ; ${MAKE} tests )
	( cd lib/connectionist/icsim/test ; ${MAKE} tests )

DIRS2CLEAN = ./sys/C ./lib/base/C ./compiler ./sys/C/crt_pre \
	./debugger ./lib/user_interface/xview ./sac

clean:
	@echo Cleaning TOPDIR=${TOPDIR} will remove all intermediate compiles 
	@echo and executables. It will not touch installed executables of 
	@echo architectures other than ARCH=${ARCH}.
	for i in ${DIRS2CLEAN} ; \
	do \
	   (cd $$i; ${MAKE} SATHER_HOME=${TOPDIR} TOPDIR=${TOPDIR} clean) ; \
	done
	-${RM} -r bin.${ARCH}

DIRS2INSTALL = Makefile Mkf.site Mkf.mach.cpp Mkf.gen README bin doc emacs etc lib sac sys
# first install verbatim dirs

install:
	if [ ${SATHER_HOME} != ${TOPDIR} ] ; then if [ -d ${SATHER_HOME} ] ; \
	   then \
	      ${ECHO} "SATHER_HOME ${SATHER_HOME} exists." ; \
	   else \
	     ( ${ECHO} "Creating sather home directory." ; \
	       ${MD} ${SATHER_HOME} ; \
	       ${MD} ${SATHER_HOME}/local ; \
	       ${MD} ${SATHER_HOME}/compiler ; \
	       ${ECHO} 'See build directory for compiler sources' > \
	           ${SATHER_HOME}/compiler/README ; \
	       ${MD} ${SATHER_HOME}/debugger ; \
	       ${ECHO} 'See build directory for debugger sources' > \
	           ${SATHER_HOME}/debugger/README ; \
	       ${TAR} cf - ${DIRS2INSTALL} | (cd ${SATHER_HOME}; ${TAR} xf - ) ;) ; \
	   fi; \
	else \
	   ${ECHO} "Sather home is top directory. Most of it is installed."; \
	fi
	if [ -d ${SATHER_HOME}/bin.${ARCH} ] ; then \
	   ${ECHO} "${SATHER_HOME}/bin.${ARCH} exists." ;\
	else \
	   ( ${ECHO} Creating sather home bin for architecture ; \
	     ${MD} ${SATHER_HOME}/bin.${ARCH} ;) ; \
	fi
	(cd ./bin.${ARCH}; ${CP} *.o *.a ${SATHER_HOME}/bin.${ARCH}/ ;)
	-${RANLIB} ${SATHER_HOME}/bin.${ARCH}/*.a
	(cd ./compiler; ${MKCMD} install ;)
	if [ ${SKIPSDB} = NO ] ; then ( cd ./debugger; ${MKCMD} install ;) ;\
	else \
	   ${ECHO} "No debugger to install." ; \
	fi

# To compile the sather source of the compiler with itself.
# You must do make install first.

compiler:
	(cd ./compiler; ${MKCMD} compiler; )

# make sure in the dist clean step below you do not clean development system.

FILES2DIST = Makefile Mkf.site Mkf.mach.cpp Mkf.gen README compiler debugger doc emacs etc lib sac sys
DISTDIR = $$HOME/sather/dist
dist:
	@echo Making a Sather distribution in ${DISTDIR}
	if [ -d ${DISTDIR} ] ; then \
	    ${ECHO} Removing old distribution. ; \
	    ${RM} -r ${DISTDIR} ; \
	fi
	${MD} ${DISTDIR}
	@echo Copying Sather to ${DISTDIR}
	${TAR} cf - ${FILES2DIST} | (cd ${DISTDIR}; ${TAR} xf - )
	(cd ${DISTDIR}; \
	    ${ECHO} Pruning; \
	    ${FIND} . \( -name RCS -o -name '*.o' -o -name '*~' -o -name core \
	       -o -name '\#*\#' -o -name '.??*~' -o -name TAGS \
	       -o -name TAGS.compl -o -name tags \) \
	       -exec ${RM} -r {} \; -prune ; \
	    make SATHER_HOME=${DISTDIR} TOPDIR=${DISTDIR} clean; \
	    ${RM} ${TARFILE}.Z; \
	    make SATHER_HOME=${DISTDIR} TOPDIR=${DISTDIR} setgrp; \
	    ${LN} bin.sun4 bin; \
	    ${TAR} cvf - ${FILES2DIST} | ${COMPRESS} > ${TARFILE}.Z ; \
	)

# reset the group 
setgrp:
	@echo Trying to provide std access to directory.
	@echo Trying to changing all files\' group to ${SATHERGRP} ... 
	if (chgrp -fR ${SATHERGRP} *) ; \
	then \
	   ${ECHO} Done\. ; \
	else \
	   ${ECHO} "Couldn't change all files groups to ${SATHERGRP}" ; \
	fi
	@echo Trying to set all files\' group and other read bit.
	if (chmod -fR go+r *) ; \
	then \
	   ${ECHO} Done\. ; \
	else \
	   ${ECHO} "Couldn't set all files' read bits"; \
	fi
	@echo Trying to set all directories\' setgid bit.
	find . -type d -exec chmod go+xrs {} \;
	@echo Trying to set all binaries\' group and other exec bit.
	if (chmod -fR go+x bin.*) ; \
	then \
	   ${ECHO} Done\. ; \
	else \
	  ${ECHO} "Couldn't set all binaries' group exec bit." ; \
	fi


# bare alpha version for remote installation testing.
# prune everything not needed.
# Note that compiler and debugger need some lib/data_structure
# cf. the .sather files there.

bare: 
	@echo Pruning current directory to bare necessities. 
	@echo Hope you know what you\'re doing\!
	( cd ./lib/data_structure ; \
	  ${MV} int_hash.sa stack.sa genrl_hash.sa str_hash.sa ../../ ;)
	( cd ./lib ; ${MV} base ../ ;)
	-${MV} ./lib/user_interface/xview/Mkf.gen XV.Mkf.gen
	-${MV} ./lib/user_interface/C/Mkf.gen C.Mkf.gen
	-${RM} -r ./lib
	-${MD} ./lib
	-${MD} ./lib/data_structure
	-${MD} ./lib/user_interface
	-${MD} ./lib/user_interface/C
	-${MD} ./lib/user_interface/xview
	-${MV} C.Mkf.gen ./lib/user_interface/C/Mkf.gen
	-${MV} XV.Mkf.gen ./lib/user_interface/xview/Mkf.gen
	-${MV} base ./lib/base
	-${MV} int_hash.sa stack.sa genrl_hash.sa str_hash.sa ./lib/data_structure/
	( cd ./etc ; \
	  ${MV} .emacs .epoch .sather ../ ;)
	-${RM} -r ./etc
	-${MD} ./etc
	-${MV} .emacs .epoch .sather ./etc/
# alpha testers need GETTING_STARTED, INSTALL and PORTING.
# We provide others docu in the ftp sather directory top level.
	-${MV} README TOP_README
	( cd ./doc ; \
	  ${MV} README STARTING INSTALL PORTING ../ ; )
	-${RM} -r ./doc
	-${MD} ./doc
	-${MV} README STARTING INSTALL PORTING doc/
	-${MV} TOP_README README
	-${RM} -r bin.*
	-${RM} -r sys/C/pre.*
	-${RM} ${TARFILE}.Z
	make setgrp
	-${TAR} cvf - . | ${COMPRESS} > ../${TARFILE}.Z
	@echo created new tarfile ../${TARFILE}.Z
