#	$Source: /afs/athena.mit.edu/user/j/jik/sipbsrc/src/memo/RCS/Makefile,v $
#	$Header: /afs/athena.mit.edu/user/j/jik/sipbsrc/src/memo/RCS/Makefile,v 1.4 90/04/04 12:21:02 jik Exp $
#
#	Makefile for the memo program.
#
DESTDIR=
BINDIR=/usr/sipb/${MACHINE}bin
MANDIR=/usr/sipb/man
CFLAGS= -O
SRCS=	ltime.c mdelete.c mlist.c mspecs.c maketime.c memo.c mset.c mutils.c \
	mclean.c mfiles.c mshow.c partime.c time.h memo.h

OBJS=	ltime.o mdelete.o mlist.o mspecs.o maketime.o memo.o mset.o mutils.o \
	mclean.o mfiles.o mshow.o partime.o

all: memo

memo:	${OBJS}
	$(CC) ${CFLAGS} ${OBJS} -o memo -lbsd

links:
	-for i in ${SRCS}; do \
		(ln -s /source/uus/vs2/memo/$$i); done

install: memo
	install -c -s memo ${DESTDIR}${BINDIR}/memo
	install -c memo.1 ${DESTDIR}${MANDIR}/man1

clean:
	rm -f a.out core *.s *.o errs memo

depend:
	makedepend -v ${CFLAGS} ${SRCS}
#	for i in ${SRCS}; do \
#	    ${CC} -M $$i | sed 's/\.o//' | \
#	    awk ' { if ($$1 != prev) \
#		{ if (rec != "") print rec; rec = $$0; prev = $$1; } \
#		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
#		else rec = rec " " $$2 } } \
#		END { print rec } ' >> makedep; done
#	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
#	echo '$$r makedep' >>eddep
#	echo 'w' >>eddep
#	cp Makefile Makefile.bak
#	ed - Makefile < eddep
#	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 depends on it.

ltime.o: time.h /usr/include/stdio.h /usr/include/strings.h
ltime.o: /usr/include/ctype.h
mdelete.o: memo.h
# memo.h includes:
#	stdio.h
#	strings.h
mdelete.o: /usr/include/stdio.h /usr/include/strings.h
mlist.o: memo.h /usr/include/stdio.h /usr/include/strings.h
mspecs.o: memo.h /usr/include/stdio.h /usr/include/strings.h
maketime.o: time.h /usr/include/sys/types.h /usr/include/sys/timeb.h
memo.o: memo.h /usr/include/stdio.h /usr/include/strings.h
mset.o: memo.h /usr/include/stdio.h /usr/include/strings.h
mclean.o: memo.h /usr/include/stdio.h /usr/include/strings.h
mfiles.o: memo.h /usr/include/stdio.h /usr/include/strings.h
mshow.o: memo.h /usr/include/stdio.h /usr/include/strings.h
partime.o: /usr/include/stdio.h /usr/include/ctype.h time.h
memo.o: /usr/include/stdio.h /usr/include/strings.h
