SHELL=/bin/sh

OS=$(OSTYPE)

all::
	@if test "x$(OS)" = x; then \
          echo "please set the environment variable OSTYPE ";\
	  echo "to a value appropriate for your system.";\
	  echo "to do so type: setenv OSTYPE `uname`   for the csh, tcsh";\
          echo "               export OSTYPE=`uname`   for other shells";\
        else \
	  if test -f Makefile.in ; then \
	    if test -f $(OS)/Makefile ; then \
	      (cd $(OS); ${MAKE} $@); \
	    else \
	      echo "Did you configure your system?";\
	    fi \
	  fi \
	fi

distrib_other::
	@if test ! -d ../../distrib ; then mkdir ../../distrib; fi;
	@if test ! -d ../../distrib/other ; then mkdir ../../distrib/other; fi;
	@(curr=`pwd`; direc=`basename $$curr`;\
	 (cd ../..; \
	  echo creating $$direc.tar from the current directory;\
	  tar -cf /tmp/$$direc.tar \
	      `\
	       find other/$$direc -type f \
	       | fgrep -vf system.list \
	       | grep -v "~" \
	       | grep -v "#" \
	      ` $(DISTRIBUTE_ADDITIONAL);\
	  echo compressing $$direc.tar to $$direc.tgz;\
	  gzip -c /tmp/$$direc.tar > distrib/other/$$direc.tgz;\
	  rm /tmp/$$direc.tar;\
	 )\
	)

distrib_utils::
	@if test ! -d ../../distrib ; then mkdir ../../distrib; fi;
	@if test ! -d ../../distrib/utils ; then mkdir ../../distrib/utils; fi;
	@(curr=`pwd`; direc=`basename $$curr`;\
	 (cd ../..; \
	  echo creating $$direc.tar from the current directory;\
	  tar -cf /tmp/$$direc.tar \
	      `\
	       find utils/$$direc -type f \
	       | fgrep -vf system.list \
	       | grep -v "~" \
	       | grep -v "#" \
	      ` $(DISTRIBUTE_ADDITIONAL);\
	  echo compressing $$direc.tar to $$direc.tgz;\
	  gzip -c /tmp/$$direc.tar > distrib/utils/$$direc.tgz;\
	  rm /tmp/$$direc.tar;\
	 )\
	)

.IGNORE:

.DEFAULT:
	@if test "x$(OS)" = x; then \
          echo "please set the environment variable OSTYPE ";\
	  echo "to a value appropriate for your system.";\
	  echo "to do so type: setenv OSTYPE `uname`   for the csh, tcsh";\
          echo "               export OSTYPE=`uname`   for other shells";\
        else \
	  if test -f $(OS)/Makefile ; then \
	    (cd $(OS); ${MAKE} $@); \
	  else \
	    echo "Did you configure your system?";\
	  fi \
	fi

