#! /bin/sh
# @(#)genStarList	1.1 10/6/92
# This script generates "include makefiles" containing lists of stars
# for a domain.

cat > /tmp/$$.hdr << EOF
# This file contains a list of the official $1 stars.  It is intended
# to be included in other makefiles.  Before it is included, the variable
# $1 must be defined to refer to the directory containing the object files
# for the stars.

# DO NOT EDIT THIS FILE!  It is generated automatically from the
# make.template file's definition of PL_SRCS.

EOF

pp=ZZZ
if [ $# = 2 ]
then pp=$2
fi

sed -n	-e "s?$1?\$($1)/${1}?g" \
	-e "s?$pp?\$($1)/${pp}?g" \
	-e "s/PL_SRCS/${1}STARS/" \
	-e "s/\.pl/.o/g" \
	-e "/^${1}STARS/,/^\$/p" make.template | cat /tmp/$$.hdr -
rm -f /tmp/$$.hdr

