#!/bin/sh
#
# Starlab make helper.
#
# Given a list of object files, create zero-length source files (type
# extension given by the first argument) if none exists.
#
if [ $# -lt 1 ]; then
  echo "Usage: $0 .suffix  file.o ...
Given a list of object files, create zero-length source files
(type extension given by first argument) if none exists." >&2
  exit 1
fi
#
suf="$1"
shift
for file in "$@"; do
    root=`expr match "$file" '\(.*\)\.o$'`
    src=$root$suf
    lex=$root.l
    yacc=$root.yc
#   Create zero length source file if no source exists and no
#   possibility of building it.
    if [ ! -f "$src" -a ! -f $lex -a ! -f $yacc ]; then
	touch "$src"
    fi
done
