#Copyright 1987 by Rensselaer Polytechnic Institute
#
#Permission to use, copy, modify, and distribute this
#software and its documentation for any purpose and without
#fee is hereby granted, provided that the above copyright
#notice appear in all copies and that both that copyright
#notice and this permission notice appear in supporting
#documentation, and that the name of RPI not be used in
#advertising or publicity pertaining to distribution of the
#software without specific, written prior permission.
#RPI makes no representations about the suitability of
#this software for any purpose.  It is provided "as is"
#without express or implied warranty.
#
# Makefile for sgmptrapd
#
TRAPDSRC=	main.c util.c tbl_util.c trapd.y trapd.l 
TRAPDOBJ=	main.o util.o tbl_util.o y.tab.o lex.yy.o
O=		-O
CFLAGS=		$O -I../../h
LIBES=		-ll -lsgmp -lresolv -lBSD

sgmptrapd: $(TRAPDOBJ)
	cc $(CFLAGS) -o sgmptrapd $(TRAPDOBJ) $(LIBES)

install: sgmptrapd
	cp sgmptrapd /usr/local/sgmptrapd

clean:
	/bin/rm $(TRAPDOBJ) lex.yy.c y.tab.c sgmptrapd

main.o: main.c

util.o: util.c

tbl_util.o: tbl_util.c

y.tab.o: y.tab.c

y.tab.c: trapd.y lex.yy.c
	yacc -d trapd.y

lex.yy.c: trapd.l
	lex trapd.l
#	patch lex.yy.c lex.yy.diff
#	rm lex.yy.c.orig

lex.yy.o: lex.yy.c

getservbyname.o: getservbyname.c
