#!/bin/sh

if test $1
  then
    if test ! -d src/$1
      then
        echo No source directory src/$1.
	exit
      fi
    for dir in vax_bsd43 rt_aos4 pmax_ul3
      do
        if test ! -d $dir/$1
	  then
            echo -n "Create directory $dir/$1? "
	    read response
	    if test "$response" != "y"; then exit; fi
	    mkdir $dir/$1
	  fi
	rm -f $dir/$1/*
	cd src/$1
	for file in *.c *.h ?akefile
	  do
	    if test ! -f ../../$dir/$1/$file
	      then ln -s ../../src/$1/$file ../../$dir/$1/$file
	    fi
	  done
	cd ../..
      done
    ln -s /mit/gnu/@sys/gcc vax_bsd43/$1/cc
    ln -s /mit/gnu/@sys/gcc pmax_ul3/$1/cc
    ln -s /bin/cc rt_aos4/$1/cc
    exit
  fi

if test ! -d src
  then
    echo No source directory exists here.
    exit
  fi

for dir in vax_bsd43 rt_aos4 pmax_ul3
  do
    if test ! -d $dir
      then 
        echo -n "Create directory $dir? "
	read response
	if test "$response" != "y"; then exit; fi
	mkdir $dir
      fi
    cd src
    for file in *.c *.h ?akefile
      do
        if test ! -f ../$dir/$file
	  then ln -s ../src/$file ../$dir/$file
	fi
      done
    cd ..
  done
ln -s /mit/gnu/@sys/cc vax_bsd43
ln -s /mit/gnu/@sys/cc pmax_ul3
ln -s /bin/cc rt_aos4
