#-----------------------------------------------------------------------------
# Copyright (c) 1990 Regents of the University of Michigan.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and that due credit is given
# to the University of Michigan at Ann Arbor. The name of the University
# may not be used to endorse or promote products derived from this
# software without specific prior written permission. This software
# is provided ``as is'' without express or implied warranty.
#
#	wpwhois makefile
#
#	Use -DDEBUG for debugging info
#	Use -DSTINKBUG to turn off shell escapes
#-----------------------------------------------------------------------------
CSRCS=	main.c update.c print.c # bind.c mod.c search.c show.c main.c util.c cache.c help.c
SRCS=	${CSRCS} # commands.c tokens.c
OBJS=	main.o update.o print.o # bind.o mod.o search.o send.o show.o main.o util.o\
	cache.o commands.o tokens.o help.o
INCLUDES= -I../include -I./regexp
DEFINES= -DDEBUG
CFLAGS= -O4 ${INCLUDES} ${DEFINES} $(ADDCFLAGS)
LDFLAGS= -L../lib -ldixie -Lregexp -lregexp
BINDIR=/usr/local/bin

all: wpwhois

wpwhois : libdixie.a libregexp.a ${OBJS}
	cc ${CFLAGS} -o $@ ${OBJS} ${LDFLAGS}

libregexp.a: regexp
	( cd regexp ; make libregexp.a )

libdixie.a: ../lib
	( cd ../lib ; make libdixie.a )

commands.c : commands.y
	yacc -d commands.y
	mv y.tab.c commands.c

install: wpwhois
	install -c -m 0755 wpwhois $(BINDIR)

install.man:
	cp wpwhois.man /usr/man/man1/wpwhois.1

depend: FRC
	mkdep ${CFLAGS} ${SRCS}

clean: FRC
	rm -f wpwhois *.o core a.out commands.c lex.yy.c tokens.c y.tab.c

lint: FRC
	lint -Dlint ${INCLUDES} ${DEFINES} ${SRCS} | grep -v llib-lc

FRC:

