# Generated automatically from Makefile.in by configure.
# This is a Makefile for ntping. If it has the name "Makefile.in"
# then it is a template for a Makefile;  to generate the actual Makefile,
# run "./configure", which is a configuration script generated by the
# "autoconf" program (constructs like "@foo@" will get replaced in the
# actual Makefile.

#----------------------------------------------------------------
# Things you can change to personalize the Makefile for your own
# site (you can make these changes in either Makefile.in or
# Makefile, but changes to Makefile will get lost if you re-run
# the configuration script).
#----------------------------------------------------------------

# Default top-level directories in which to install architecture-
# specific files (exec_prefix) and machine-independent files such
# as scripts (prefix).  The values specified here may be overridden
# at configure-time with the --exec-prefix and --prefix options
# to the "configure" script.

prefix =	/usr/local
exec_prefix =	${prefix}

# Directory in which to install the program ntping:
BIN_DIR =	$(exec_prefix)/bin

# Top-level directory for manual entries:
MAN_DIR =	$(prefix)/man

# Directory in which to install manual entry for ntping:
MAN8_DIR =	$(MAN_DIR)/man8

# To change the compiler switches, for example to change from -O
# to -g, change the following line:
CFLAGS = -O

# Libraries to use when linking.
LIBS =   # -lresolv

# Some versions of make, like SGI's, use the following variable to
# determine which shell to use for executing commands:
SHELL =		/bin/sh

#----------------------------------------------------------------
# The information below is modified by the configure script when
# Makefile is generated from Makefile.in.  You shouldn't normally
# modify any of this stuff by hand.
#----------------------------------------------------------------

SRC_DIR =		.

#----------------------------------------------------------------
# The information below should be usable as is.  The configure
# script won't modify it and you shouldn't need to modify it
# either.
#----------------------------------------------------------------

CC =		cc
LD =		cc
CC_SWITCHES =	${CFLAGS} -I. -I..  -DHAVE_STDLIB_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MALLOC_H=1 

SRCS = ntping.c
EXTR = README ntping.8 Makefile.in configure configure.in \
	Makefile.handmade ntping-0.9b.c

.c.o:
	$(CC) -c $(CC_SWITCHES) $<

all:	ntping

ntping:	ntping.o
	-if [ -f ntping ] ; then mv -f ntping ntping.bak ; else true ; fi
	rm -f ntping.bak || true
	$(LD) -o ntping ntping.o $(LIBS)

dynamic:

clean:
	@rm -f *.o core *~ \#*\# *.bak gmon.out ntping .emacs_* lmake.???

distclean clobber realclean: clean
	@rm -f Makefile config.status config.h config.log config.cache

V=0.9j
dist tar:
	rm -rf ntping-$V ntping-$V.tar*
	mkdir ntping-$V
	-cp -p $(SRCS) $(EXTR) ntping-$V
	-tar cvf ntping-$V.tar ntping-$V
	gzip -f -v -9 ntping-$V.tar
	rm -rf ntping-$V

install: ntping
	@echo
	@echo "--> You must be root to install ntping. Please get root"
	@echo "--> permissions and then type >make sinstall<"
	@echo

sinstall: ntping
	-if [ ! -d $(BIN_DIR) ] ; then mkdir -p $(BIN_DIR) ; else true ; fi
	rm -f $(BIN_DIR)/ntping || true
	cp ntping $(BIN_DIR)
	-chown root $(BIN_DIR)/ntping || /etc/chown root $(BIN_DIR)/ntping
	-chmod u+s $(BIN_DIR)/ntping
	-chmod a-w $(BIN_DIR)/ntping
	-if [ ! -d $(MAN8_DIR) ] ; then mkdir -p $(MAN8_DIR) ; else true ; fi
	rm -f $(MAN8_DIR)/ntping.8 || true
	cp $(SRC_DIR)/ntping.8 $(MAN8_DIR)/ntping.8
	-chmod g+w $(MAN8_DIR)/ntping.8

depend:

check:
	echo '-size 120 localhost' | ./ntping -b
	echo '-size 60 -delay 30 -mask localhost' | ./ntping -b
	echo '-retries 2 -timeout 1 -ttl 1 localhost' | ./ntping -b
	echo '-size 100 -delay 10 -trace 1 localhost' | ./ntping -b
	echo '-tstamp localhost' | ./ntping -b

lcheck:
	echo '-size 120 -delay 1 sol.ibr.cs.tu-bs.de prep.ai.mit.edu' | ./ntping -b
	echo '-size 60 -mask -delay 10 sol.ibr.cs.tu-bs.de prep.ai.mit.edu' | ./ntping -b
	echo '-retries 2 -timeout 1 -delay 100 -ttl 2 sol.ibr.cs.tu-bs.de prep.ai.mit.edu' | ./ntping -b
	echo '-size 100 -trace 2 sol.ibr.cs.tu-bs.de prep.ai.mit.edu' | ./ntping -b
	echo '-tstamp sol.ibr.cs.tu-bs.de prep.ai.mit.edu' | ./ntping -b

#
# this is local fun; please ignore.
#
linstall:	sinstall
	rcp -p $(BIN_DIR)/ntping bayes:$(BIN_DIR)/ntping
	rcp -p $(BIN_DIR)/ntping helios:$(BIN_DIR)/ntping

