COPT=-Wall

all: main.o sniff.o conn.o hash.o segment.o stream.o http.o
	gcc -o httpsniff main.o sniff.o conn.o hash.o segment.o stream.o http.o -lpcap

sniff.o: sniff.c conn.h config.h
	gcc $(COPT) -c sniff.c

conn.o: conn.c conn.h hash.h segment.h stream.h config.h
	gcc $(COPT) -c conn.c

segment.o: segment.c segment.h
	gcc $(COPT) -c segment.c

hash.o: hash.c hash.h config.h
	gcc $(COPT) -c hash.c

stream.o: stream.c stream.h config.h
	gcc $(COPT) -c stream.c

http.o: http.c http.h
	gcc $(COPT) -c http.c

main.o: main.c sniff.h
	gcc $(COPT) -c main.c

clean:
	rm -f *.o *~ httpsniff
