
case "$(uname)" in
Linux)
LDFLAGS='-m64'
mkfile=make.linux64
;;
Darwin)
LDFLAGS='-arch x86_64 -m64'
mkfile=make.darwin64x86snowleopard
;;
*)
echo "Unsupported"
exit 1
;;
esac

sed -i -e 's|gcc44|gcc|g' make.*
sed -i -e 's|g++44|g++|g' make.*
sed -i -e 's|-gstabs+|-g|g' make.*
sed -i -e '/CODESIGN/d' ds9/Makefile

cp -a $mkfile make.include
make
mkdir -p $PREFIX/bin
cp -a bin/ds9* bin/x* $PREFIX/bin
