SHELL = /bin/sh
MAKE = make
CC = cc

LIBS = -lnsl -lsocket -s

# FLAGS REQUIRED FOR PORTING
# CFLAGS=-DBZERO -O
# FREEBSD NEEDS SPECIAL ZOMBIE HANDLING
# -DENABLE_DISABLE - INCLUDE CODE TO TEMPORARELY DISABLE NOTIFICATIONS ON A HOST
# -DGETTIMEOFDAY  IF YOUR OS SUPPORTS gettimeofday()
#   
CFLAGS=-DBZERO -DSIGSETJMP -DZOMBIE -D&BBOSTYPE -O 
LDFLAGS=-s

all: bb bbd bbnet touchtime dumphostsvc getipaddr

bb: bb.o bb.h
	${CC} ${CFLAGS} -o $@ bb.o ${LIBS}

bbd: dohostsvc.o utils.o bbd.o bb.h
	${CC} ${CFLAGS} -o $@ bbd.o dohostsvc.o utils.o ${LIBS}

bbnet: bbnet.o bb.h
	${CC} ${CFLAGS} -o $@ bbnet.o ${LIBS}

touchtime: touchtime.o bb.h
	${CC} ${CFLAGS} -o $@ touchtime.o ${LIBS}

dumphostsvc: dohostsvc.o utils.o dumphostsvc.o bb.h
	${CC} ${CFLAGS} -o $@ dumphostsvc.o dohostsvc.o utils.o ${LIBS}

getipaddr: utils.o getipaddr.o bb.h
	${CC} ${CFLAGS} -o $@ getipaddr.o utils.o ${LIBS}

install:
	rm -f *.o
	mv bb bbd bbnet touchtime dumphostsvc getipaddr ../bin

clean:	
	rm -f *.o bb bbd bbnet touchtime dumphostsvc getipaddr
