#
# 5799-WZQ (C) COPYRIGHT = NONE
# LICENSED MATERIALS - PROPERTY OF IBM
#
# $Header:Makefile 12.0$ 
# $ACIS:Makefile 12.0$ 
# $Source: /ibm/acis/usr/src/usr.bin/find/RCS/Makefile,v $ 

#	@(#)Makefile	4.3	(Berkeley)	85/06/01
#
DESTDIR=
CFLAGS=	-O
LFLAGS=	

# The programs themselves
#
PROG=	find
LIBS=	bigram code

# Sources
#
SRCS=	find.c bigram.c code.c

all: ${PROG} ${LIBS}

find: find.c
	${CC} ${CFLAGS} -o find find.c

bigram: bigram.c
	${CC} ${CFLAGS} -o bigram bigram.c

code: code.c
	${CC} ${CFLAGS} -o code code.c

# install files. create find.codes file and set owner to nobody.
install: ${DESTDIR}/usr/lib/find all
	install -c -s ${PROG} ${DESTDIR}/usr/bin/${PROG}
	install -c -s bigram ${DESTDIR}/usr/lib/find/bigram
	install -c -s code ${DESTDIR}/usr/lib/find/code
	install -c -m 755 updatedb.csh ${DESTDIR}/usr/lib/find/updatedb
	touch ${DESTDIR}/usr/lib/find/find.codes
	chown nobody ${DESTDIR}/usr/lib/find/find.codes
	chmod 644 ${DESTDIR}/usr/lib/find/find.codes

${DESTDIR}/usr/lib/find:
	mkdir $@
	chmod 755 $@

clean:
	rm -f a.out core ${LIBS} ${PROG}

depend:
	${CC} -M ${SRCS} | \
	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
	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 uses it


find.o: find.c /usr/include/stdio.h /usr/include/sys/param.h
find.o: /usr/include/machine/param.h /usr/include/signal.h
find.o: /usr/include/sys/types.h /usr/include/sys/dir.h /usr/include/sys/stat.h
find.o: /usr/include/pwd.h /usr/include/grp.h /usr/include/utmp.h
bigram.o: bigram.c /usr/include/stdio.h
code.o: code.c /usr/include/stdio.h
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above
