#
#	5/13/96 Doug Hughes
#	
#
#
# comment this line if you do not have SUNpro compilers
# CFLAGS = -g -xildoff # For debugging
# CFLAGS = -fast # For production 

# Change C compiler to gcc or other ANSI compiler if you want.
CC = cc
# Use "one" of these lines for gcc and comment out above
# CFLAGS = -g -Wall
CFLAGS = -O

# This is the size of the packet that you want to keep for further
# processing. Usually the first 64 bytes of header information is plenty
# of information for post processing.
PKTSIZE = 96


# Default facility for syslog 
FACILITY = LOG_AUTH

# Default level for syslog
LEVEL = LOG_NOTICE

CFLAGS += -DLOG_LEVEL="$(FACILITY)|$(LEVEL)"

# Default 
# Uncomment -DDEST_ONLY if you only destination packets to the network
# that tocsin is running on. This will use a little more CPU because
# of some added filters on the DLPI/NIT stack, and will not match packets
# passing through or originating from your network.
CPPFLAGS = $(OPTFLAGS) -DPKTSIZE=$(PKTSIZE)


#---Should not need to change anything below here----

SOLARIS = mydlpi.o	# remove the first "#" on this line for solaris

#

all: 
	@if [ -f /vmunix ]; then \
		set -x; $(MAKE) tocsin ; \
	else \
		set -x; $(MAKE) tocsin CPPFLAGS="$(CPPFLAGS) -DSYSV -DSVR4" ALT="mydlpi.o" \
		LDFLAGS="-lnsl -lsocket" ; \
	fi
	

.c.o:
	$(COMPILE.c) $<

tocsin: tocsin.o $(ALT)
	$(LINK.c) -o tocsin tocsin.o $(ALT)

solaris: tocsin.o mydlpi.o
	$(LINK.c) -o tocsin tocsin.o mydlpi.o -lnsl -lsocket

stream: 
	cp tocsin AUBtocsin/reloc/\$$BASEDIR/sbin/tocsin.sparc
	(cd AUBtocsin; make)
	(cd pkgspool; pkgtrans -s . ../AUBtocsin.stream AUBtocsin; cp ../AUBtocsin.stream /home/ftp/pub/doug/AUBtocsin)

clean: 
	rm *.o tocsin

tar:
	cd .. ; /opt/gnu/bin/tar cvfz tocsin/tocsin.tar.gz tocsin/mydlpi.c tocsin/tocsin.c tocsin/Makefile tocsin/README tocsin/Changes tocsin/tocsin.1m tocsin/S70tocsin
	cd .. ; /opt/gnu/bin/tar cvfZ tocsin/tocsin.tar.Z tocsin/mydlpi.c tocsin/tocsin.c tocsin/Makefile tocsin/README tocsin/Changes tocsin/tocsin.1m tocsin/S70tocsin

