#! /bin/sh

# distlist: create a list of files to distribute
#
# usage: distlist [ prefix ]

# Assumes the shell var GEOM is set to the root of the geom tree

if [ $# -gt 0 ] ; then
  prefix=$1 ;
else
  prefix=. ;
fi

if [ -f FILES ] ; then
  for file in `cat FILES` ; do
    echo $prefix/$file ;
  done ;
fi

if [ -f Makedefs ] ; then
  distdirs=`make -f $GEOM/makefiles/Makefile.pdef DISTDIRS` ;
  for dir in $distdirs ; do
    ( cd $dir ; $GEOM/tools/distlist $prefix/$dir ) ;
  done ;
fi
