#    Irix version
#
# Nevil Brownlee, Computer Centre, The University of Auckland
#

SRC= ../../src/meter
SINCLUDE= ../../src/snmplib/include
MINCLUDE=  ../../src/meter/include
TINCLUDE= ../../src/meter/include/tcpdump

SNMPH = $(SINCLUDE)/asn1.h $(SINCLUDE)/mib.h $(SINCLUDE)/parse.h \
	$(SINCLUDE)/snmp.h $(SINCLUDE)/snmpapi.h \
	$(SINCLUDE)/snmpclnt.h $(SINCLUDE)/snmpimpl.h

METERH = $(MINCLUDE)/flowhash.h $(MINCLUDE)/met_vars.h \
	$(MINCLUDE)/decnet.h $(MINCLUDE)/pktsnap.h

PKTH =	$(TINCLUDE)/pcap.h $(TINCLUDE)/pcap-int.h \
      	$(TINCLUDE)/llc.h $(TINCLUDE)/fddi.h

TARG=	 NeTraMet  test

SNMPLIBS=  ../snmplib/libsnmp.a 

LIBS=  ../snmplib/libsnmp.a libpcap.a

CFLAGS=	-g -I$(SINCLUDE) -I$(MINCLUDE) -I$(TINCLUDE) -DCLNS
CC= cc  #  Irix C compiler


all: $(TARG)

test.o:	$(METERH) $(SRC)/test.c
	$(CC) $(CFLAGS) -c $(SRC)/test.c

test:	test.o
	${CC} -o $@ test.o libpcap.a


meter_ux.o:  $(SNMPH) $(PKTH) $(METERH) $(SRC)/meter_ux.c
	${CC} $(CFLAGS) -c $(SRC)/meter_ux.c

#ether_ux.o:  $(SNMPH) $(PKTH) $(METERH) $(SRC)/ether_ux.c
#	${CC} $(CFLAGS) -c $(SRC)/ether_ux.c

flowhash.o:	$(SNMPH) $(METERH) $(SRC)/flowhash.c
	${CC} $(CFLAGS) -c $(SRC)/flowhash.c

met_vars.o:	$(SNMPH) $(METERH) $(SRC)/met_vars.c
	${CC} $(CFLAGS) -c $(SRC)/met_vars.c


NeTraMet:	flowhash.o met_vars.o meter_ux.o ${SNMPLIBS}
	${CC} -o $@ meter_ux.o flowhash.o met_vars.o ${LIBS}


clean:
	rm -f *.o ${TARG}

install:
	cp ${TARG} ../bin
