CC = gcc

CFLAGS = -g

INCLUDE = -I /usr/src/kismet-3.0.1/libpcap-0.7.2

SNIF_LIBS = -L /usr/src/kismet-3.0.1/libpcap-0.7.2 -lpcap -lm

AWACS_LIBS = -lm

AWACS_OBJS = awacs.o node.o hash.o geom.o
SNIF_OBJS = sniffer.o node.o hash.o batch_ipc.o radius.o
CALIBR_OBJS = calibr.o node.o hash.o batch_ipc.o radius.o
RADIUS_OBJS = radius.o node.o hash.o batch_ipc.o
TRIANGLE_OBJS = triangle.o node.o hash.o batch_ipc.o radius.o

all: sniffer calibr triangle

sniffer: ${SNIF_OBJS}
	${CC} ${CFLAGS} -o sniffer ${SNIF_OBJS} ${SNIF_LIBS}

calibr: ${CALIBR_OBJS}
	${CC} ${CFLAGS} -o calibr ${CALIBR_OBJS} ${AWACS_LIBS}

radius: ${RADIUS_OBJS}
	${CC} ${CFLAGS} -o radius ${RADIUS_OBJS} ${AWACS_LIBS}

triangle: ${TRIANGLE_OBJS}
	${CC} ${CFLAGS} -o triangle ${TRIANGLE_OBJS} ${AWACS_LIBS}

awacs: ${AWACS_OBJS}
	${CC} ${CFLAGS} -o awacs ${AWACS_OBJS} ${AWACS_LIBS}

avacs.o: awacs.c node.h hash.h geom.h
	${CC} ${CFLAGS} -c avacs.c

sniffer.o: sniffer.c node.h hash.h
	${CC} ${CFLAGS} -c sniffer.c

node.o: node.c node.h
	${CC} ${CFLAGS} -c node.c

hash.o: hash.c hash.h
	${CC} ${CFLAGS} -c hash.c

geom.o: geom.c geom.h
	${CC} ${CFLAGS} -c geom.c

batch_ipc.o: batch_ipc.c batch_ipc.h
	${CC} ${CFLAGS} -c batch_ipc.c

clean:
	rm *.o
