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

# Use "one" of these lines for gcc and comment out above
# CFLAGS = -g -Wall
# CFLAGS = -O2

# 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 = 64

#
# TCP_ONLY	- only show TCP type packets (may help to alleviate false positives
#             if you have IPX or Appletalk on your network
# SYN_ONLY  - useful if you only care about SYN probes and not FIN or RST
#
# DEST_ONLY - only show packets to local destination subnet
#

OPTFLAGS = -DNO_IP_OPTIONS # -DTCP_ONLY -DSYN_ONLY

# 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 = -DDEST_ONLY $(OPTFLAGS) -DPKTSIZE=$(PKTSIZE)

# Change C compiler to gcc or other ANSI compiler if you want.
CC = cc

#---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

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
	cd .. ; /opt/gnu/bin/tar cvfZ tocsin/tocsin.tar.Z tocsin/mydlpi.c tocsin/tocsin.c tocsin/Makefile tocsin/README

