#$Header:Makefile 12.0$
#$ACIS:Makefile 12.0$
#$Source: /ibm/acis/usr/src/usr.lib/learn/RCS/Makefile,v $
#
#	Makefile	4.2	83/07/08
#
# Make install will build the learn lesson libraries
# from this directory. 
#
LESSONS = C editor eqn files macros morefiles vi
FILES =	Linfo Xinfo

# There are files in the C directory that need to be compiled
CDIR = C
SRCS = ${CDIR}/getline.c ${CDIR}/getnum.c 
OBJS = ${CDIR}/getline.o ${CDIR}/getnum.o

DESTDIR =

all:	objects

objects:
	@cd ${CDIR}; make "CC=${CC}"

install: all ${LESSONS} ${FILES}
	-rm -rf ${DESTDIR}/usr/lib/learn
	-mkdir ${DESTDIR}/usr/lib/learn ${DESTDIR}/usr/lib/learn/log \
		${DESTDIR}/usr/lib/learn/bin
	chmod 755 ${DESTDIR}/usr/lib/learn ${DESTDIR}/usr/lib/learn/log \
		${DESTDIR}/usr/lib/learn/bin
	chown root ${DESTDIR}/usr/lib/learn ${DESTDIR}/usr/lib/learn/log \
		${DESTDIR}/usr/lib/learn/bin
	chgrp staff ${DESTDIR}/usr/lib/learn ${DESTDIR}/usr/lib/learn/log \
		${DESTDIR}/usr/lib/learn/bin
	@for i in ${FILES}; do \
		echo copy $$i; \
		install -c -m 644 $$i ${DESTDIR}/usr/lib/learn/$$i; \
	done
	@for i in ${LESSONS}; do \
		echo tar $$i lessons; \
		tar cf - $$i | (cd ${DESTDIR}/usr/lib/learn; tar xpf -); \
	done
	@-for i in ${LESSONS}; do \
		if [ -r ${DESTDIR}/usr/lib/learn/$$i/Init ]; \
			then chmod 555 ${DESTDIR}/usr/lib/learn/$$i/Init; fi;\
	done

clean:
	-rm -f ${CDIR}/*.o
