#!/bin/csh -f
#
# makedata - this makes the directories needed for some test files
# for the driver program.
# 
# usage:
#   makedata testfile...
# each testfile is an input to the RAPID driver program.

if ($#argv == 0) then
    echo usage: makedata testfile...
    exit 1
endif

# make a list of directories (note we strip comments from the file):
# The directory name is usually the second word on each line, unless
# there is a - option there instead, in which case it is the third word.
# pick out a unique set of names, and make the directories
sed 's/#.*//' $* | awk '\
	   $2 ~ /^-/ {print $3; next} \
	   {print $2}' \
  | sort | uniq | makedirs
