#!/bin/sh
#
# Mksrc - make SunOS source files for lslk
#
# WARNING: This script assumes it is running from the main directory
#	   of the lslk distribution.
#
# One environment variable applies:
#
# LSLK_MKC	is the method for creating the source files.
#		It defaults to "ln -s".  A common alternative is "cp".
#
#		Cp may be used when it is necessary to assemble a
#		source module from fragments.
#
# $Id: Mksrc,v 1.1 96/06/12 12:46:37 abe Exp $


D=dialects/sunos
F=dialects/common
L="dlock.c dmnt.c dlslk.h dproto.h dstore.c machine.h"

for i in $L
do
  rm -f $i
  $LSLK_MKC $D/$i $i
  echo "$LSLK_MKC $D/$i $i"
done

# Assemble kernelbase.h.

NM=kernelbase.h
H=/usr/include/machine/param.h
rm -f $NM
echo "#if     !defined(KERNELSIZE)" > $NM
grep "^#define[       ]*KERNELSIZE" $H >> $NM
echo "#endif" >> $NM
echo "#if     !defined(KERNELBASE)" >> $NM
grep "^#define[       ]*KERNELBASE" $H >> $NM
echo "#endif" >> $NM
echo "$NM assembled."

# Assemble ???

#NM=???
#P="$D/$NM $F/???"
#rm -f $NM
#cat $P > $NM
#echo "$NM assembled."
