# $Id: Makefile,v 1.1 1999/08/23 16:18:28 naamato Exp $
# Makefile for multicast test tool
#
#
IGMP_OBJ = igmp.o
INET_OBJ = inet.o if.o trace.o
DVMRP_OBJ = dvmrp.o ${IGMP_OBJ}
PIM_OBJ = pim.o ${IGMP_OBJ}
CONFIG_OBJ = config2/config2.o
MHOST_OBJ = mhost.o host.o timer.o ${CONFIG_OBJ}
DNBR_OBJ = nbr.o router.o timer.o route.o ${CONFIG_OBJ}
PIMNBR_OBJ = pimnbr.o pim_router.o timer.o route.o ${CONFIG_OBJ}

CC = gcc

# For FreeBSD, BSD/OS
CFLAGS = -g
#LFLAGS = -lkvm

# For SOLARIS
#CFLAGS = -g -DSOLARIS
#LFLAGS = -lsocket -lxnet

.c.o:
	${CC} ${CFLAGS} -c $*.c

all::	config2.o query join leave probe report prune graft gack hello bstrap crpadv jp reg reg_stop assert pim_graft pim_gack ippkt sping mhost dnbr pimnbr

config2.o:
	cd config2;${MAKE}

query:	query.o ${IGMP_OBJ} ${INET_OBJ}
	${CC} -g ${LFLAGS} query.o ${IGMP_OBJ} ${INET_OBJ} -o query

join:	join.o ${IGMP_OBJ} ${INET_OBJ}
	${CC} -g ${LFLAGS} join.o ${IGMP_OBJ} ${INET_OBJ} -o join

leave:	leave.o ${IGMP_OBJ} ${INET_OBJ}
	${CC} -g ${LFLAGS} leave.o ${IGMP_OBJ} ${INET_OBJ} -o leave

probe:	probe.o ${DVMRP_OBJ} ${INET_OBJ} 
	${CC} -g ${LFLAGS} probe.o ${DVMRP_OBJ} ${INET_OBJ} -o probe

report:	report.o ${DVMRP_OBJ} ${INET_OBJ} 
	${CC} -g ${LFLAGS} report.o ${DVMRP_OBJ} ${INET_OBJ} -o report

prune:	prune.o ${DVMRP_OBJ} ${INET_OBJ} 
	${CC} -g ${LFLAGS} prune.o ${DVMRP_OBJ} ${INET_OBJ} -o prune

graft:	graft.o ${DVMRP_OBJ} ${INET_OBJ} 
	${CC} -g ${LFLAGS} graft.o ${DVMRP_OBJ} ${INET_OBJ} -o graft

gack:	gack.o ${DVMRP_OBJ} ${INET_OBJ} 
	${CC} -g ${LFLAGS} gack.o ${DVMRP_OBJ} ${INET_OBJ} -o gack

hello:	hello.o ${PIM_OBJ} ${INET_OBJ} 
	${CC} -g ${LFLAGS} hello.o ${PIM_OBJ} ${INET_OBJ} -o hello

bstrap:	bstrap.o ${PIM_OBJ} ${INET_OBJ} 
	${CC} -g ${LFLAGS} bstrap.o ${PIM_OBJ} ${INET_OBJ} -o bstrap

crpadv:	crpadv.o ${PIM_OBJ} ${INET_OBJ} 
	${CC} -g ${LFLAGS} crpadv.o ${PIM_OBJ} ${INET_OBJ} -o crpadv

jp:	jp.o ${PIM_OBJ} ${INET_OBJ} 
	${CC} -g ${LFLAGS} jp.o ${PIM_OBJ} ${INET_OBJ} -o jp

reg:	reg.o ${PIM_OBJ} ${INET_OBJ} 
	${CC} -g ${LFLAGS} reg.o ${PIM_OBJ} ${INET_OBJ} -o reg

reg_stop:	reg_stop.o ${PIM_OBJ} ${INET_OBJ} 
	${CC} -g ${LFLAGS} reg_stop.o ${PIM_OBJ} ${INET_OBJ} -o reg_stop

assert:	assert.o ${PIM_OBJ} ${INET_OBJ} 
	${CC} -g ${LFLAGS} assert.o ${PIM_OBJ} ${INET_OBJ} -o assert

pim_graft:	pim_graft.o ${PIM_OBJ} ${INET_OBJ} 
	${CC} -g ${LFLAGS} pim_graft.o ${PIM_OBJ} ${INET_OBJ} -o pim_graft

pim_gack:	pim_gack.o ${PIM_OBJ} ${INET_OBJ} 
	${CC} -g ${LFLAGS} pim_gack.o ${PIM_OBJ} ${INET_OBJ} -o pim_gack

mhost:	${MHOST_OBJ} ${IGMP_OBJ} ${INET_OBJ}
	${CC} -g ${LFLAGS} ${MHOST_OBJ} ${IGMP_OBJ} ${INET_OBJ} -o mhost

dnbr:	${DNBR_OBJ} ${DVMRP_OBJ} ${INET_OBJ}
	${CC} -g ${LFLAGS} ${DNBR_OBJ} ${DVMRP_OBJ} ${INET_OBJ} -o dnbr

pimnbr:	${PIMNBR_OBJ} ${PIM_OBJ} ${INET_OBJ}
	${CC} -g ${LFLAGS} ${PIMNBR_OBJ} ${PIM_OBJ} ${INET_OBJ} -o pimnbr

ippkt:	ippkt.o ${INET_OBJ} 
	${CC} -g ${LFLAGS} ${INET_OBJ} ippkt.o -o ippkt

sping:	sping.o ${INET_OBJ} 
	${CC} -g ${LFLAGS} ${INET_OBJ} sping.o -o sping

clean:
	rm -f *.o *.core core query join leave probe report prune graft gack hello bstrap crpadv jp reg reg_stop assert pim_graft pim_gack ippkt sping mhost dnbr pimnbr
	cd config2; ${MAKE} clean

if.o: interface.h defs.h
igmp.o: defs.h igmp_def.h
query.o: igmp_def.h
join.o: igmp_def.h
dvmrp.o: defs.h igmp_def.h dvmrp_def.h
probe.o: dvmrp_def.h
pim.o: defs.h pim_def.h
hello.o: pim_def.h
mhost.o: defs.h igmp_def.h interface.h
sping.o: interface.h
nbr.o: defs.h igmp_def.h interface.h
host.o: defs.h igmp_def.h interface.h
router.o: defs.h igmp_def.h interface.h
route.o: defs.h
pimnbr.o: defs.h pim_def.h interface.h
pim_router.o: defs.h igmp_def.h pim_def.h interface.h
