#!/bin/sh

#
# Define the usage() function
#

usage ()
{
  echo "usage: $0 --cppflags --cxxflags --include --ldflags"
  echo "       $0 --cxx"
  echo "       $0 --cc"
  echo "       $0 --fc"
  echo "       $0 --fflags"
  exit
}


#
# Need at least one command-line argument
#
if [ "$#" = "0" ] ; then
    usage $0
fi

echo_list=""

#
# Process the command-line arguments, build up
# echo_list
#
while [ "x$1" != "x" ]; do
    case "$1" in
	"--cxx")
	    echo_list="echo_cxx $echo_list"
	    ;;

	"--cc")
	    echo_list="echo_cc $echo_list"
	    ;;

	"--fc")
	    echo_list="echo_fc $echo_list"
	    ;;

	"--cppflags")
	    echo_list="echo_cppflags $echo_list"
	    ;;
	
	"--cxxflags")
	    echo_list="echo_cxxflags $echo_list"
	    ;;
	
	"--cflags")
	    echo_list="echo_cflags $echo_list"
	    ;;
	
	"--fflags")
	    echo_list="echo_fflags $echo_list"
	    ;;
	
	"--include")
	    echo_list="echo_include $echo_list"
	    ;;
	
	"--ldflags")
	    echo_list="echo_ldflags $echo_list"
	    ;;
	
	*)
	    echo "Unknown argument: $1"
	    usage $0
    esac
    shift
done


#
# Use make to process the echo_list
#
make --no-print-directory -C /usr/src/RPM/BUILD/libmesh-complex-0.8.0 -f Makefile.const $echo_list

# Local Variables:
# mode: shell-script
# End:
