## -*- ksh -*-
##
## SMakefile for SNMPSNIFF
##
## $Id: SMakefile.stub,v 1.6 1998/03/16 19:55:23 ryan Exp $
##
###########################################################################

## Aggressive optimizations
##
MFARGS=""
CC=cc
case `uname` in
  Linux) CFLAGS="-O3"
	LDFLAGS="-Wl,-rpath,/usr/local/lib"
#	 LDFLAGS
	 ;;
  IRIX) CFLAGS="-O2"
	# Make sure we use the 32bit compiler versions
	LDFLAGS="-Wl,-rpath,/usr/local/lib"
	if test "${ABI}x" != "x"; then
	  MFARGS="--with-mips-abi=${ABI}"
	fi
	;;
  HP-UX) CFLAGS="-Ae +O3 +Oaggressive" 
	 LDFLAGS="-L/usr/local/lib -Wl,+b,/usr/local/lib"
	 ;;
  SunOS)   
	 if test "`uname -r`" = "4.1.3_U1"; then 
	   CC="gcc"
	   CFLAGS="-O3"
	   LDFLAGS=""
	 else
	   CFLAGS="-xO4 -xdepend"
	   LDFLAGS="-L/usr/local/lib -R/usr/local/lib"
	 fi
	 ;;
  ULTRIX)  CFLAGS="-O3"
	   CC="gcc"
	   LDFLAGS=""
	   ;;
  *)       CFLAGS=-g
	   LDFLAGS=""
	   ;;
esac

## Debugging on my workstation, but nowhere else. :)
if test "`hostname`" = "lister.net.cmu.edu"; then
  CC=gcc
  CFLAGS="-g -Wall -pedantic";
  PWD=`pwd`
  FOO=`echo $PWD | sed -e 's/\/[0-9]*$//'`
  DESTDIR=/usr/tmp/ryan/depot/`basename $FOO`
fi

export CC
export CFLAGS
export LDFLAGS

##
## This causes configure to be run as the 'makefile' command.
##
MFCOMMAND="./configure $MFARGS"

##
## This will allow you to execute 'smake install', and won't set
## the prefix in GNU makefiles to the AFS destdir.  When the 'all' target
## is made, the prefix will be '/usr/local'.  However, when install is
## executed, the prefix will be set to '$(DESTDIR)'.
##
INSTCOMMAND="${MAKE} prefix=${DESTDIR} exec_prefix=${DESTDIR} install"
