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

# Default facility for syslog 
FACILITY = LOG_AUTH

# Default level for syslog
LEVEL = LOG_NOTICE

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

# Change this to -g for debugging
CDEBUGFLAGS = -O

# 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 = $(CDEBUGFLAGS) -DDEST_ONLY

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

