#!/bin/sh
#
# p11 - pdp11 emulator; Copyright (C) 1994 Hartmut Brandt, Joerg Micheel 
# see the file LICENSE for further information
#
# make binary distribution
# argument gives configuration
# the file list is at the end of this file
#
error() {
	echo 2>&1 $*
	exit 1
}

if [ $# -ne 1 ] ; then
  error "need argument (configuration)"
fi

LIST=""
for i in `sed -n '/^##/s/^##//p' $0` ; do
  if [ -f ${i} ] ; then
    LIST=${LIST}" "${i}
  else
    error "$i: file does not exist"
  fi
done

for i in `sed -n '/^#?/s/^#?//p' $0` ; do
  if [ -f ${i} ] ; then
    LIST=${LIST}" "${i}
  fi
done

tar hcvf - ${LIST} | gzip -v -9 >p11bin-${1}.tar.gz
ls -l p11bin-${1}.tar.gz

#
# files that MUST be there
#
##COPYING
##LICENSE
##README
##p11
##rlboot
##p11conf.std
##IOProgs/lp_file
##IOProgs/tty_net
##IOProgs/tty_xterm
##Misc/p11conf.sample
#
#
# optional files
#
#?IOProgs/tty_tty
#?Tests/*.11
