#!/bin/tcsh -f

set SYSTEM=$1
set MACHINEOS="`uname -m`-`uname -s`"
source `dirname $0`/read-config
source `dirname $0`/lisp-switches

echo "\nCreating binary distribution for $SYSTEM in\n  $BIGSYSHOME/dist/$SYSTEM"

if ( "${LISPIMPLEMENTATION}" == "CMU" ) then  
    mkdir -p $BIGSYSHOME/dist/$SYSTEM/bin
    \cp -f ${BIGSYSHOME}/bin/.generic-exec-system $BIGSYSHOME/dist/$SYSTEM/bin/$SYSTEM
    \chmod 755 $BIGSYSHOME/dist/$SYSTEM/bin/$SYSTEM
    \cp -f ${BIGSYSHOME}/binaries/${BIGSYSBINARYPATHNAME}/$SYSTEM.dxl $BIGSYSHOME/dist/$SYSTEM/bin/.$MACHINEOS-$SYSTEM
    \cp -f ${BIGSYSLISP} $BIGSYSHOME/dist/$SYSTEM/bin/.cmu-lisp-$MACHINEOS
    cd $BIGSYSHOME/dist/$SYSTEM/bin
    \tar cf ../$SYSTEM-bin.tar .
    \gzip -f ../$SYSTEM.tar
  else
    echo "Creating binary distribution only works with CMU CL (>= 18e)"
endif



