#
#	Internet Rover Makefile		WB Norton    	5/13/91
#					Merit Computer Network
#
#   Make Definitions file for the Internet Rover 
#
#	Note: Things are broken up here a bit:
#
#		InetRoverd performs all the network tests
#		ping is our own special made ping
#		Hostfileio does all I/O with the hostfile config file
#		netquery has all the test modules that InetRoverd invokes
#						
#
#VPATH = ../MISC
#CFLAGS=-g -D_BSD=1 -DBUILTIN=1
CFLAGS=-g -D_BSD=1 

.c.o:
	echo 'static char *Version="'$* ${PINGKYVERSION}' compiled on '`hostname ` at `date`'";' >version.h ; \
	cc ${CFLAGS} -c $<


InetRoverd: inetrover.o netquery.o Hostfileio.o ../Ctools/ctools.o ../ProblemManager/ProblemManager.o  Hostfileio.o ../ProblemManager/ProblemFileio.o connect.o
	cc -o InetRoverd inetrover.o netquery.o Hostfileio.o ../ProblemManager/ProblemManager.o ../Ctools/ctools.o ../ProblemManager/ProblemFileio.o connect.o -lbsd

# Must make ping as root! 
ping:	ping.o Makefile
	cc -o ping ping.o
	chmod 4755 ping

ping.o:	
	cc -c ping.c $(CFLAGS)

Hostfileio:	Hostfileio.o ../Ctools/ctools.o
	cc -o Hostfileio Hostfileio.c -g -DDEBUG=1 -DSTANDALONE=1 ../Ctools/ctools.o

print:
	lpr -Pnext *.c *.h Makefile

netquery.o: netquery.c netquery.h 
	cc -c ${CFLAGS} netquery.c

clean:
	-rm *.o
	-rm core
	-rm Display xdisplay 
	-rm pingky.cycle 
	-rm PROBLEM.FILE hostfileio problemlog.* CHECKING
	-rm ping InetRoverd Hostfileio
	-rm LINKCHECK/*.log LINKCHECK/AS.*
	-rm MailBridge/*.log MailBridge/AS.*

fastping:       Hostfileio.o ../Ctools/ctools.o fastping.o
	cc -o fastping fastping.c Hostfileio.o ../Ctools/ctools.o

ns:	ns.c
	cc -c ns.c -DSTANDALONE -D_BSD
	cc -o ns ns.o
	
