#
# @(#)Makefile	1.7	03/04/93
#
# Makefile to build netperf benchmark tool
#
#
# This tells the script where the executables and scripts are supposed
# to go. Some people might be occustomed to "/usr/etc/net_perf", but
# for the rest of the world, it is probably better to put the binaries
# in /usr/local/netperf or /var/netperf. This will be more
# standard for people outside of the HP R&D labs...still working on it.
#
#NETPERF_HOME = /usr/etc/netperf
#NETPERF_HOME = /var/netperf
NETPERF_HOME = /export/nperf

# The compiler on your system might be somewhere else
CC = gcc

LIBS = -L/usr/ucblib -lucb -lsocket -lnsl

#LIBS = 

# These flags enable some non-mainline features used in the lab. For
# more information, please consult the source code.
#CFLAGS = -DDIRTY -DINTERVALS
CFLAGS  = -ansi -Wall -Dsun -D__STDC__=0


SHAR_SOURCE_FILES = netlib.c netlib.h netperf.c netserver.c \
		    netsh.c netsh.h nettest.c nettest.h makefile

SHAR_EXE_FILES    = ACKNWLDGMNTS COPYRIGHT README \
                    netperf.ps netperf.pcl netperf netserver \
		    netperf.man netserver.man

SHAR_SCRIPT_FILES = tcp_stream_script udp_stream_script \
                    tcp_rr_script udp_rr_script tcp_range_script

NETSERVER_OBJS	  = netserver.o nettest.o netlib.o netsh.o

NETPERF_OBJS	  = netperf.o netsh.o netlib.o nettest.o

NETPERF_SCRIPTS   = tcp_range_script tcp_stream_script tcp_rr_script \
                    udp_stream_script udp_rr_script

all: netperf netserver

netperf:	$(NETPERF_OBJS)
		$(CC) -o $@ $(NETPERF_OBJS) $(LIBS)

netserver:	$(NETSERVER_OBJS)
		$(CC) -o $@ $(NETSERVER_OBJS) $(LIBS)

netperf.o:	netperf.c netsh.h

netsh.o:	netsh.c netsh.h nettest.h netlib.h

netlib.o:	netlib.c netlib.h netsh.h

nettest.o:	nettest.c nettest.h netlib.h netsh.h

netserver.o:	netserver.c nettest.h netlib.h

install:	netperf netserver
		chmod -w *.[ch]
		chmod +x $(NETPERF_SCRIPTS)
		cp netperf $(NETPERF_HOME)
		cp netserver $(NETPERF_HOME)
		cp $(NETPERF_SCRIPTS) $(NETPERF_HOME)

clean:
	rm -f *.o netperf netserv core netperf.shar netperf.tar.Z

deinstall:
	echo rm -rf $(NETPERF_HOME)/*

netperf.shar:	$(SHAR_SOURCE_FILES) $(SHAR_EXE_FILES) $(SHAR_SCRIPT_FILES)
	shar -bcCsZ $(SHAR_SOURCE_FILES) $(SHAR_EXE_FILES) \
		$(SHAR_SCRIPT_FILES) > netperf.shar

netperf.tar:	$(SHAR_SOURCE_FILES) $(SHAR_EXE_FILES) $(SHAR_SCRIPT_FILES)
	tar -cf netperf.tar $(SHAR_SOURCE_FILES) $(SHAR_EXE_FILES) \
		$(SHAR_SCRIPT_FILES)
	compress netperf.tar


	
