# ipband - IP bandwidth watchdog 
 
# Note: When the version changes, you also have to change
# the RPM spec file

V=0.6
CIDIR=-I/usr/include/pcap
LIBS=-lpcap
DFLAGS=-Wall
CC=gcc

LIB=-lpcap

all: ipband

ipband: hash.o ipband.o
	$(CC) -o ipband ipband.o hash.o $(LIBS) $(DFLAGS)
	strip ipband

hash.o: hash.c hash.h
	$(CC) -c hash.c $(DFLAGS)

ipband.o: ipband.c
	$(CC) -c ipband.c $(CIDIR) $(DFLAGS)

SOURCES = Makefile ipband.c hash.c hash.h ipband.1 ipband.spec ipband.sample.conf ipband.rc CHANGELOG COPYING README INSTALL  

tgz:
	mkdir ipband-$(V)
	cp $(SOURCES) ipband-$(V)
	tar -czvf ipband-$(V).tgz ipband-$(V)/
	rm -rf ipband-$(V)

rpm:	tgz
	cp ipband-$(V).tgz /usr/src/redhat/SOURCES
	cp ipband.spec /usr/src/redhat/SPECS
	rpm -bb ipband.spec

install:
	install -D ipband   /usr/local/bin/ipband
	install -D ipband.1 /usr/local/man/man1/ipband.1
	install -D ipband.sample.conf /etc/ipband.sample.conf
	install -D ipband.rc /etc/rc.d/init.d/ipband

clean:
	rm -f *.o
	rm -f ipband
