# Make file for the research project
#
# $Header$
# $Source$
#

CFILES	= dp.c

COBJS 	= dp.o

SUBCOBJS =

HFILES = ../include/prdef.h ../include/prstr.h

TARGET  = bell

SOURCE=	${HFILES} ${CFILES}
 
ALLFILES= ${SOURCE} makefile tags .pr

LINTFLAGS =

CFLAGS = -g -X ${LINTFLAGS}

LDFLAGS=

LIBS = -lm

CTAGS	= ctags

.c.o :
	cc ${CFLAGS} ${LIBS} -c $*.c

${TARGET}:	${COBJS} tags
	touch ${TARGET}

lint:
	lint -hav ${CFILES} > lint.out
 
tags:	${CFILES}
	${CTAGS} -u $?
clean:
	-rm -f ${COBJS} 

lp: .pr
.pr: NONEXISTENT
	csh .pr ${SOURCE} makefile tags
#	touch .pr
NONEXISTENT:
	echo force the make
 
get:
	sccs get ${SOURCE}
edit:
	sccs edit ${SOURCE} ${HFILE}
ip:
	pr -f ${SOURCE} | lpr -Pkip &
 
depend: ${SOURCE}
	grep	'^#include' ${CFILES}		| grep -v '<'		\
	| sed	's/:[^"]*"\([^"]*\)".*/: \1/'				\
	| sed	's/\.c/.o/' | sed 's,../[a-z]*/,,'			\
	| awk	' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; }\
		else { if (length(rec $$2) > 78) { print rec; rec = $$0; }\
		else rec = rec " " $$2 } }				\
		END { print rec } '					\
	> makedep
#	grep	'^#include' ${HFILES}		| grep -v '<'		\
#	| sed	-e 's/:[^"]*"\([^"]*\)".*/: \1/p'			\
#		-e 's/\([^:]*\):.*/	$${TOUCH} \1/'			\
#	>> makedep
	echo '/^# DO NOT DELETE THIS LINE/+1,$$d'	>  eddep
	echo '$$r makedep'				>> eddep
	echo 'w'					>> eddep
	ed - < eddep makefile
	rm eddep makedep
	echo '# DEPENDENCIES MUST END AT END OF FILE'	>> makefile
	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY'	>> makefile
	echo '# see make depend above'			>> makefile

#-----------------------------------------------------------------
# DO NOT DELETE THIS LINE -- make depend uses it
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above
