head     1.2;
access   ;
symbols  ;
locks    ; strict;
comment  @# @;


1.2
date     89.04.27.08.16.01;  author root;  state Exp;
branches ;
next     1.1;

1.1
date     89.04.27.08.12.04;  author root;  state Exp;
branches ;
next     ;


desc
@initial 5.1 beta
@


1.2
log
@all nfs utilities moved to /usr/src/NFS/usr.bin
@
text
@#	Makefile	4.39	85/10/11
#
DESTDIR=
CFLAGS=	-O -20

# Programs that live in subdirectories, and have makefiles of their own.
#
# ISI KLUDGE STUFF THAT NEEDS WORK
#	f77
SUBDIR=	at calendar dc diction diff3 efl eqn f77 find graph learn lex lint \
	m4 neqn nroff plot prof ratfor refer spell struct tbl tip troff uucp \
	xsend yacc

# Shell scripts that need only be installed and are never removed.
#
SCRIPT=	install lorder nohup

# C programs that live in the current directory and do not need
# explicit make lines.
#
STD=	ar11 basename cal cb checkeq col comm crypt deroff \
	fgrep file join look mesg ptx ranlib \
	rev sleep sort spline split sum tabs tc tk touch tr tsort tty \
	uniq units 

# C programs that live in the current directory and need explicit make lines.
# (make depend has special rules for these files)
#
NSTD=	bc das egrep

# Programs that must run set-group-id kmem.
#
KMEM=	iostat

all:	${SUBDIR} ${STD} ${NSTD} ${KMEM}

${SUBDIR}: FRC
	cd $@@; make ${MFLAGS}
	@@echo "------------------------------"

FRC:


bc egrep:
	${YACC} ${YFLAGS} $@@.y
	${CC} -c ${CFLAGS} y.tab.c
	mv y.tab.o $@@.o
	${CC} -o $@@ $@@.o
	rm -f $@@.o

das:	das.c
	${CC} ${CFLAGS} -DSTANDALONE -o das das.c

${STD} ${KMEM}:
	${CC} ${CFLAGS} -o $@@ $@@.c

install: ${STD} ${NSTD} ${KMEM}
	-mkdir ${DESTDIR}/usr/bin
	-for i in ${SUBDIR}; do \
		(cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done
	-for i in ${SCRIPT}; do \
		(install -c -m 555 $$i.sh ${DESTDIR}/usr/bin/$$i); done
	-for i in ${STD} ${NSTD}; do \
		(install -s $$i ${DESTDIR}/usr/bin/$$i); done
	-for i in ${KMEM}; do \
		(install -s -g kmem -m 2755 $$i ${DESTDIR}/usr/bin/$$i); done
	install -c units.lib ${DESTDIR}/usr/lib/units

clean:
	rm -f a.out core *.s *.o y.tab.c
	for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done
	rm -f ${STD} ${NSTD} ${KMEM}

# beware of the non-standard stuff for bc and egrep
depend:
	for i in ${STD} ${KMEM}; do \
	    cc -M ${INCPATH} $$i.c | 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
	for i in bc egrep; do \
	    cc -M ${INCPATH} $$i.y | 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

# Files listed in ${NSTD} have explicit make lines given below.

# DO NOT DELETE THIS LINE -- make depend uses it
@


1.1
log
@Initial revision
@
text
@a12 1
NFSDIR= rpcgen
a25 6
# Standard NFS utilities
#
NFS=	ypcat ypmatch ypwhich

RPC=	yppasswd

d35 1
a35 1
all:	${SUBDIR} ${STD} ${NSTD} ${KMEM} nfs
d37 1
a37 3
nfs:	${NFSDIR} ${NFS} ${RPC}

${SUBDIR} ${NFSDIR}: FRC
d54 1
a54 1
${STD} ${KMEM} ${NFS}:
d57 1
a57 6
${RPC}:
	${CC} ${CFLAGS} -o $@@ $@@.c -lrpcsvc

install: install-dist install-nfs

install-dist: ${STD} ${NSTD} ${KMEM}
a67 7

install-nfs: ${NFS} ${RPC}
	-mkdir ${DESTDIR}/usr/bin
	-for i in ${NFSDIR}; do \
		(cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done
	-for i in ${NFS} ${RPC}; do \
		(install -s $$i ${DESTDIR}/usr/bin/$$i); done
@
