#
# Copyright (c) 1987 Regents of the University of California.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation,
# advertising materials, and other materials related to such
# distribution and use acknowledge that the software was developed
# by the University of California, Berkeley.  The name of the
# University may not be used to endorse or promote products derived
# from this software without specific prior written permission.
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
#	@(#)Makefile	5.10 (Berkeley) 9/20/88
#
SRCS=	inet.c if.c main.c route.c 
OBJS=	inet.o if.o main.o route.o
TARG= snmpnetstat

CPPFLAGS=@CPPFLAGS@ -I../.. -I$(srcdir)/../.. -I$(srcdir)/../../snmplib
CC = @CC@ $(CPPFLAGS)

USELIBS=../../snmplib/libsnmp.$(SHLIB_EXTENSION)
LIBS=	 -L../../snmplib $(CC_RUNTIME_ARG) -lsnmp @LIBS@

all: $(TARG)

snmpnetstat: ${OBJS} ${USELIBS}
	${CC} -o $@ ${CFLAGS} ${OBJS} ${LDFLAGS} ${LIBS}

distclean: clean

clean:
	rm -f ${OBJS} core snmpnetstat

cleandir: clean
	rm -f ${MAN} tags .depend

lint: ${SRCS}
	lint ${CFLAGS} ${SRCS}

tags: ${SRCS}
	ctags ${SRCS}

installdirs:
	@$(SHELL) $(srcdir)/../../mkinstalldirs $(snmplibdir) $(bindir)

install: installdirs $(TARG)
	@for i in $(TARG) ; do $(INSTALL) $$i $(bindir) ; echo "install:  installed $$i in $(bindir)" ; done

depend: 
	makedepend $(CPPFLAGS) $(srcdir)/*.c

nosysdepend:
	makedepend $(CPPFLAGS) *.c
	perl -n -i.bak -e ' if (/^# DO NOT DELETE THIS LINE/) {$$doit=1;} if ($$doit == 1) {s#/usr/(include|lib)/[^\s]+##g ; print if (! /^[\w]+\.o:\s*$$/);} else {print;}' Makefile

makefileindepend: nosysdepend
	perl -e ' rename("Makefile.in","Makefile.in.bak"); open(F,"Makefile.in.bak"); open(G,"Makefile"); open(O,">Makefile.in"); $$_ = <F>; while(!/^# DO NOT DELETE THIS LINE/) { print O $$_; $$_ = <F>; } print O $$_; $$_ = <G>; while(!/^# DO NOT DELETE THIS LINE/) { $$_ = <G>; } while (<G>) {print O $$_;} '

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

if.o: ../../config.h ../../mib_module_config.h 
if.o:   ../../s/linux.h
if.o: ../../s/generic.h ../../m/i686.h ../../m/i586.h ../../m/i386.h
if.o:   main.h
if.o: ./../../snmplib/asn1.h ./../../snmplib/snmp.h
if.o: ./../../snmplib/snmp_api.h ./../../snmplib/snmp_impl.h
if.o: ./../../snmplib/snmp_client.h ./../../snmplib/mib.h
if.o: ../../snmplib/system.h netstat.h
inet.o: ../../config.h ../../mib_module_config.h 
inet.o:   ../../s/linux.h
inet.o: ../../s/generic.h ../../m/i686.h ../../m/i586.h ../../m/i386.h
inet.o:   main.h
inet.o: ./../../snmplib/asn1.h ./../../snmplib/snmp_api.h
inet.o: ./../../snmplib/snmp_impl.h ./../../snmplib/snmp_client.h
inet.o: ./../../snmplib/mib.h ./../../snmplib/snmp.h netstat.h
main.o: ../../config.h ../../mib_module_config.h 
main.o:   ../../s/linux.h
main.o: ../../s/generic.h ../../m/i686.h ../../m/i586.h ../../m/i386.h
main.o:  ./../../snmplib/asn1.h ./../../snmplib/mib.h
main.o: ./../../snmplib/snmp.h ./../../snmplib/snmp_api.h
main.o: ./../../snmplib/snmp_impl.h ./../../snmplib/snmp_client.h
main.o: ./../../snmplib/party.h ./../../snmplib/context.h
main.o: ./../../snmplib/view.h ./../../snmplib/acl.h ../../version.h
main.o: netstat.h
route.o: ../../config.h ../../mib_module_config.h 
route.o:   ../../s/linux.h
route.o: ../../s/generic.h ../../m/i686.h ../../m/i586.h ../../m/i386.h
route.o:  main.h ./../../snmplib/asn1.h
route.o: ./../../snmplib/snmp.h ./../../snmplib/snmp_api.h
route.o: ./../../snmplib/snmp_impl.h ./../../snmplib/snmp_client.h
route.o: ./../../snmplib/mib.h netstat.h
