#
# @(#)Makefile	3.0.0
#
# Makefile to build netperf benchmark tool
#
# for those folks running csh, this may help with makes
#SHELL="/bin/sh"

#what version of netperf is this for?
VERSION = 3.0.1

#
# This tells the script where the executables and scripts are supposed
# to go. Some people might be used 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 /opt/netperf
#
#NETPERF_HOME = /usr/local/netperf
NETPERF_HOME = /opt/netperf

# The compiler on your system might be somewhere else, and/or have
# a different name.
#
# /bin/cc              - the location on HP-UX 9.X and previous
# /usr/bin/cc          - the location on HP-UX 10.0 and some other
#                        platforms (IRIX, OSF/1)
# /opt/SUNWspro/bin/cc - the unbundled C compiler under Solaris
# cc                   - if your paths are set, this may be all you 
#                        need
# 
# one most systems, netperf spends very little time in user code, and
# most of its time in the kernel, so I *suspect* that different
# optimization levels won't make very much of a difference. however,
# might as well compile -O... If you are using the HP-UX unbundled
# compiler, this will generate a warning about an unsupported option.
# You may safely ignore that warning.
#

#CC = cc -g +M +w1
CC = cc -O +ESlit -Wl,-a,archive

# Adding flags to CFLAGS enables some non-mainline features. For
# more information, please consult the source code.
# -Ae         - enable ANSI C on HP-UX with namespace extensions. ANSI
#               compilation is required for -DHISTOGRAM
# -DDIRTY     - include code to dirty buffers before calls to send
# -DHISTOGRAM - include code to keep a histogram of r/r times or
#               time spent in send() - requires -Ae on HP-UX
#               This option requires -D_BSD_TYPES under IRIX
# -DINTERVALS - include code to allow pacing of sends in a UDP or TCP 
#               test. this may have unexpected results on non-HP-UX
#               systems as I have not learned how to emulate the
#               functionality found within the __hpux defines in
#               the catcher() routine of netlib.c
# -DDO_DLPI   - include code to test the DLPI implementation (may also 
#               require changes to LIBS. see below)
# -DDO_UNIX   - include code to test Unix Domain sockets
# -DDO_FORE   - include code to test the Fore ATM API (requires 
#               -DFORE_KLUDGE and -I/usr/fore/include).  Also, add
#               -DFORE_FT400 if you're running FT 4.0.0 or above.
# -DDO_HIPPI  - include code to test the HP HiPPI LLA interface. if 
#               you just want vanilla HP LLA, then also add
#               -DBUTNOTHIPPI
# -D$(LOG_FILE) Specifies where netserver should put its debug output 
#               when debug is enabled
# -DUSE_LOOPER- use looper or soaker processes to measure CPU
#               utilization. these will be forked-off at the
#               beginning. if you are running this way, it is
#               important to see how much impact these have on the
#               measurement. A loopback test on uniprocessor should be
#               able to consume ~100% of the CPU, and the difference
#               between throughput with USE_LOOPER CPU and without
#               should be small for a real network. if it is not, then
#               some work proably needs to be done on reducing the
#               priority of the looper processes.
# -DUSE_PSTAT - If used on HP-UX 10.0 and later, this will make CPU
#               utilization measurements with some information
#               returned byt he 10.X pstat() call. This is very
#               accurate, and should have no impact on the
#               measurement. Astute observers will notice that the
#               LOC_CPU and REM_CPU rates with this method look
#               remarkably close to the clockrate of the machine :)
# -DDO_IPV6   - Include tests which use a sockets interface to IPV6.
#               The control connection remains IPV4
# -U__hpux    - Use this when compiling _on_ HP-UX *for* an HP-RT system
#
# -DDO_DNS    - Include tests (experimental) that measure the performance
#               of a DNS server.
# -DDO_FTP    - Include tests that measure the performance of file
#               dowload from an FTP server.
# -DUSE_THREADS Use threads instead of processes for the multple stream
#               tests

LOG_FILE=DEBUG_LOG_FILE="\"/tmp/netperf.debug\""
CFLAGS = -Ae -D$(LOG_FILE) -DDO_FTP

# Some platforms, and some options, require additional libraries.
# you can add to the "LIBS =" line to accomplish this. if you find
# that additional libs are required for your platform, please let
# me know. rick jones <raj@cup.hp.com>
# -lstr                 - required for -DDO_DLPI on HP-UX 9.X
# -lsocket -lnsl -lelf  - required for Solaris 2.3 (2.4?)
# -L/usr/fore/lib -latm - required on all platforms for the Fore
#                         ATM API tests
# -lelf                 - on IRIX 5.2 to resolve nlist. with 2.0PL1
#                         and later, this should not be needed since
#                         netperf no longer uses nlist()
# -lsys5                - on Digital Unix (OSF) this helps insure that
#                         netserver processes are reaped?
# -lm                   - required for ALL platforms
# -lxti                 - required for -DDO_XTI on HP_UX 10.X
# -lpthread		- required for pthreads

LIBS= -lm

# ---------------------------------------------------------------
# it should not be the case that anything below this line needs to
# be changed. if it does, please let me know.
# rick jones <raj@cup.hp.com>

SRCS = netperf3.c netserver3.c netlib3.c nettest3_bsd.c nettest3_dns.c\
       nettest3_ftp.c

NETPERF3_OBJS	= netperf3.o netlib3.o nettest3_bsd.o nettest3_dns.o\
                  nettest3_ftp.o ../libftpio/ftperr.o ../libftpio/ftpio.o

NETSERVER3_OBJS	= netserver3.o netlib3.o nettest3_bsd.o nettest3_dns.o\
                  nettest3_ftp.o ../libftpio/ftperr.o ../libftpio/ftpio.o

all: netperf3 netserver3

depend:
	makedepend -- $(CFLAGS) -- $(SRCS)

clean:
	rm -f *.o netperf3 netserver3 core

netperf3:	$(NETPERF3_OBJS)
		$(CC) -o $@ $(NETPERF3_OBJS) $(LIBS)

netserver3:	$(NETSERVER3_OBJS)
		$(CC) -o $@ $(NETSERVER3_OBJS) $(LIBS)

# DO NOT DELETE THIS LINE -- make depend depends on it.

netperf3.o: /usr/include/unistd.h /usr/include/sys/unistd.h
netperf3.o: /usr/include/sys/stdsyms.h /usr/include/stdio.h
netperf3.o: /usr/include/sys/types.h /usr/include/sys/_inttypes.h
netperf3.o: /usr/include/stdlib.h /usr/include/assert.h netlib3.h
netperf3.o: /usr/include/sys/mman.h /usr/include/limits.h
netperf3.o: /usr/include/sys/time.h nettypes.h netperf3.h
netserver3.o: /usr/include/sys/types.h /usr/include/sys/_inttypes.h
netserver3.o: /usr/include/sys/stdsyms.h /usr/include/stdio.h
netserver3.o: /usr/include/errno.h /usr/include/sys/errno.h
netserver3.o: /usr/include/signal.h /usr/include/sys/signal.h
netserver3.o: /usr/include/sys/sigevent.h /usr/include/sys/siginfo.h
netserver3.o: /usr/include/sys/newsig.h /usr/include/sys/ipc.h
netserver3.o: /usr/include/fcntl.h /usr/include/sys/fcntl.h
netserver3.o: /usr/include/sys/time.h /usr/include/sys/ioctl.h
netserver3.o: /usr/include/sys/socket.h /usr/include/sys/stat.h
netserver3.o: /usr/include/netinet/in.h /usr/include/netdb.h
netserver3.o: /usr/include/unistd.h /usr/include/sys/unistd.h
netserver3.o: /usr/include/sys/wait.h /usr/include/string.h
netserver3.o: /usr/include/stdlib.h netlib3.h /usr/include/sys/mman.h
netserver3.o: /usr/include/limits.h nettypes.h netperf3.h nettest3_bsd.h
netlib3.o: /usr/include/stdio.h /usr/include/sys/types.h
netlib3.o: /usr/include/sys/_inttypes.h /usr/include/sys/stdsyms.h
netlib3.o: /usr/include/unistd.h /usr/include/sys/unistd.h
netlib3.o: /usr/include/fcntl.h /usr/include/sys/fcntl.h
netlib3.o: /usr/include/sys/wait.h /usr/include/signal.h
netlib3.o: /usr/include/sys/signal.h /usr/include/sys/sigevent.h
netlib3.o: /usr/include/sys/siginfo.h /usr/include/sys/newsig.h
netlib3.o: /usr/include/errno.h /usr/include/sys/errno.h
netlib3.o: /usr/include/sys/socket.h /usr/include/netinet/in.h
netlib3.o: /usr/include/netdb.h /usr/include/sys/mman.h /usr/include/assert.h
netlib3.o: netlib3.h /usr/include/limits.h /usr/include/sys/time.h nettypes.h
nettest3_bsd.o: /usr/include/stdio.h /usr/include/sys/types.h
nettest3_bsd.o: /usr/include/sys/_inttypes.h /usr/include/sys/stdsyms.h
nettest3_bsd.o: /usr/include/stdlib.h /usr/include/assert.h
nettest3_bsd.o: /usr/include/sys/socket.h /usr/include/netinet/in.h
nettest3_bsd.o: /usr/include/netinet/tcp.h /usr/include/arpa/inet.h
nettest3_bsd.o: /usr/include/netdb.h /usr/include/string.h
nettest3_bsd.o: /usr/include/errno.h /usr/include/sys/errno.h netlib3.h
nettest3_bsd.o: /usr/include/sys/mman.h /usr/include/unistd.h
nettest3_bsd.o: /usr/include/sys/unistd.h /usr/include/limits.h
nettest3_bsd.o: /usr/include/sys/time.h nettypes.h netperf3.h nettest3_bsd.h
nettest3_ftp.o: /usr/include/stdio.h /usr/include/sys/types.h
nettest3_ftp.o: /usr/include/sys/_inttypes.h /usr/include/sys/stdsyms.h
nettest3_ftp.o: /usr/include/stdlib.h /usr/include/assert.h
nettest3_ftp.o: /usr/include/sys/socket.h /usr/include/netinet/in.h
nettest3_ftp.o: /usr/include/netinet/tcp.h /usr/include/arpa/inet.h
nettest3_ftp.o: /usr/include/netdb.h /usr/include/string.h
nettest3_ftp.o: /usr/include/errno.h /usr/include/sys/errno.h netlib3.h
nettest3_ftp.o: /usr/include/sys/mman.h /usr/include/unistd.h
nettest3_ftp.o: /usr/include/sys/unistd.h /usr/include/limits.h
nettest3_ftp.o: /usr/include/sys/time.h nettypes.h netperf3.h nettest3_ftp.h
