#	RCS Ident $Id: Makefile,v 1.14 1999/11/18 18:09:32 root Exp root $

VERSIONID="0.3.0"
PATCHREV=16

# Name of relay host
RELAYHOST="proxy1.wang.com"

# UDP port number to use for encapsulated traffic (unless 'udprelay' is
# specified in /etc/services).
RELAYPORT=1092

# Default User ID with minimal privileges
NOBODY="nobody"

# Normal method is to use poll(), but this may be overridden by setting
# USEPOLL=0 in the Arch Specific Settings. If USEPOLL=0, the code emulates
# poll() using select().
# Beware under Linux that although glibc has poll() in the library, it is not
# available as a kernel call until kernel 2.1.xx, and hence for most
# distributions it it generally advisable to use select().
USEPOLL=1

# Earlier versions of GCC and the socket header files seem unable to
# correctly avoid unnecessary warnings about ptrs to sockaddr types.
# Use CASTSOCK=1 to force a reworking of the code and avoid the compiler
# complaints
CASTSOCK=0

# Some libraries appear not to include the more recent inet_aton function
# call, and still use inet_addr instead. If so, use -DUSE_INET_ADDR
# in the Arch Specific Settings OPTS options...

# Uncomment the second line if it is desired to invoke the compile time 
# option for debugging via stdout.
DEFOPTS= -DUSE_FCNTL
#DEFOPTS= -DUSE_FCNTL -DDEBUG_VIA_STDOUT

# Choose the primary interface the daemon binds to..
DEFAULT_INTERFACE=0.0.0.0

# Default Session Timeout: 3 minutes
DFLT_TIMEOUT=180

# Timeout when debug switch enabled
DEBUG_TIMEOUT=20

TIMEOUTS= -DDFLT_TIMEOUT=$(DFLT_TIMEOUT) -DDEBUG_TIMEOUT=$(DEBUG_TIMEOUT)

# Install directory for binary
BINDIR=/usr/local/bin

##################### Architecture Specific Settings ##########################

#  ####### for ODT 2.0
#  CC=gcc
#  OPTS=-DSYSV
#  LIBS=-lsocket
#  NOBODY="nouser"

#  ####### for AIX
#  CC=gcc
#  LIBS=-lsocket
#  OPTS=-DAIX
#  NOBODY="nouser"

#  ####### for Linux RedHat 4.2
#  CC=gcc
#  OPTS=
#  LIBS=
#  USEPOLL=0
#  CASTSOCK=1

#  ####### for Linux RedHat 5.1, 5.2, 6.0
CC=gcc
OPTS=
LIBS=
USEPOLL=0

#  ####### for SunOS 5.6 - Solaris 2.6
#  CC=gcc
#  OPTS= -DUSE_INET_ADDR
#  LIBS= -lnsl -lsocket
#  USEPOLL=1
#  CASTSOCK=1


########################## Overall Flag Settings ##############################

CFLAGS=-O $(OPTS) $(DEFOPTS) -DRELAYHOST=\"$(RELAYHOST)\" -DRELAYPORT=$(RELAYPORT) \
	-DNOBODY=\"$(NOBODY)\" -DUSEPOLL=$(USEPOLL) -DCASTSOCK=$(CASTSOCK) \
	-DDFLT_INTERFACE=\"$(DEFAULT_INTERFACE)\" \
	-DVERSIONID=\"$(VERSIONID)\" -DPATCHREV=$(PATCHREV) \
	$(TIMEOUTS)

RELEASEABLES= README CHANGES ARCHIE-NOTES Makefile udprelay.c udprelay.h \
	Rsendto.c

############################ Overall Make Rules ###############################

all : udprelay Rsendto.o

udprelay : udprelay.c udprelay.h Makefile
	$(CC) -o udprelay $(CFLAGS) udprelay.c $(LIBS)

Rsendto.o : Rsendto.c udprelay.h Makefile
	$(CC) -c $(CFLAGS) Rsendto.c

clean :
	rm -f udprelay Rsendto.o

kit :
	makekit $(RELEASEABLES)

tar :
	tar cvf udprelay.tar $(RELEASEABLES)
