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


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

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


desc
@initial 5.1 beta
@


1.2
log
@moved rup and rusers to /usr/src/NFS/ucb
@
text
@#
# Copyright (c) 1980 Regents of the University of California.
# All rights reserved.  The Berkeley software License Agreement
# specifies the terms and conditions for redistribution.
#
#	@@(#)Makefile	5.17 (Berkeley) 6/7/86
#
DESTDIR=
CFLAGS=	-O

# Programs that live in subdirectories, and have makefiles of their own.
#
SUBDIR=	Mail compress dbx error ex ftp indent \
	more msgs netstat rdist sendbug systat talk tftp \
	tn3270 tset vgrind sysline window gprof

# Subdirectories which are not currently supported by ISI
#
ISI_TODO_SUBDIR= fp lisp pascal vlp

# Shell scripts that need only be installed and are never removed.
#
CSHSCRIPT= which

# C programs that live in the current directory and do not need
# explicit make lines.
#
STD=	apply biff checknr colcrt colrm ctags expand finger fold \
	from grep groups head last lastcomm leave lock logger mkstr \
	printenv ruptime rwho sccs script soelim strings symorder tail tcopy \
	telnet unexpand unifdef users whereis whoami whois what wc xstr yes


# C programs that live in the current directory and need explicit make lines.
#
NSTD=	clear ul vacation man

# Programs that must run setuid to root
#
SETUID=	rlogin rsh

# NFS utilities that must run setuid to root
#
NFS_SETUID=	quota 

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

MDEP20= w.V20 gcore.V20

MDEP30= w.V30 gcore.V30

all:	${SUBDIR} ${STD} ${NSTD} \
	${KMEM} ${SETUID} ${NFS_SETUID} \
	${MDEP20} ${MDEP30}


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

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

${MDEP20}:
	cc ${CFLAGS} -o $@@ $@@.c

${MDEP30}:
	cc ${CFLAGS} -o $@@ $@@.c -DM68030

${NFS_SETUID}:
	cc ${CFLAGS} -o $@@ $@@.c -lrpcsvc

install: ${STD} ${NSTD} ${KMEM} ${SETUID} ${NFS_SETUID}
	-mkdir ${DESTDIR}/usr/ucb
	-for i in ${SUBDIR}; do \
		(cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done
	-for i in ${CSHSCRIPT}; do \
		(install -m 755 -c $$i.csh ${DESTDIR}/usr/ucb/$$i); done
	-for i in ${STD} ${NSTD}; do \
		(install -c -s $$i ${DESTDIR}/usr/ucb/$$i); done
	-for i in ${KMEM}; do \
		(install -c -g kmem -m 2755 -s $$i ${DESTDIR}/usr/ucb/$$i); done
	-for i in ${SETUID} ${NFS_SETUID}; do \
		(install -c -o root -m 4755 -s $$i ${DESTDIR}/usr/ucb/$$i); done
	rm -f ${DESTDIR}/usr/ucb/f
	ln ${DESTDIR}/usr/ucb/finger ${DESTDIR}/usr/ucb/f
	rm -f ${DESTDIR}/usr/ucb/apropos ${DESTDIR}/usr/ucb/whatis
	ln ${DESTDIR}/usr/ucb/man ${DESTDIR}/usr/ucb/apropos
	ln ${DESTDIR}/usr/ucb/man ${DESTDIR}/usr/ucb/whatis
	rm -f ${DESTDIR}/usr/ucb/u
	ln ${DESTDIR}/usr/ucb/users ${DESTDIR}/usr/ucb/u
#
# machine specific stuff
#
	-for i in ${MDEP20}; do \
	    (install -c -g kmem -m 2755 -s $$i ${DESTDIR}/usr/ucb/.$$i); done
	-for i in ${MDEP30}; do \
	    (install -c -g kmem -m 2755 -s $$i ${DESTDIR}/usr/ucb/.$$i); done
	-for i in w uptime gcore; do \
	    rm ${DESTDIR}/usr/ucb/$$i ; \
	    rm ${DESTDIR}/usr/ucb/.$$i.V25 ; \
	    cd ${DESTDIR}/usr/ucb ; ln .$$i.V20 .$$i.V25 ; \
	done
	-rm ${DESTDIR}/usr/ucb/.uptime.V20
	-rm ${DESTDIR}/usr/ucb/.uptime.V25
	-rm ${DESTDIR}/usr/ucb/.uptime.V30
	cd ${DESTDIR}/usr/ucb ; ln .w.V20 .uptime.V20
	cd ${DESTDIR}/usr/ucb ; ln .w.V25 .uptime.V25
	cd ${DESTDIR}/usr/ucb ; ln .w.V30 .uptime.V30
	cd ${DESTDIR}/usr/ucb ; ln -s .w.'$$MACHINE' w
	cd ${DESTDIR}/usr/ucb ; ln -s .uptime.'$$MACHINE' uptime
	cd ${DESTDIR}/usr/ucb ; ln -s .gcore.'$$MACHINE' gcore
	cd ${DESTDIR}/usr/ucb ; ln -s .netstat.'$$MACHINE' netstat
	cd ${DESTDIR}/usr/ucb ; ln -s .systat.'$$MACHINE' systat
	cd ${DESTDIR}/usr/ucb ; ln -s .dbx.'$$MACHINE' dbx
	

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

FRC:

depend:
	for i in ${STD} ${NSTD} ${SETUID} ${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
	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.

clear:
	${CC} -o clear ${CFLAGS} clear.c -ltermlib

ul:
	${CC} -o ul ${CFLAGS} ul.c -ltermlib

vacation: vacation.c
	${CC} -o vacation ${CFLAGS} vacation.c -ldbm

man:
	${CC} -o man ${CFLAGS} man.c -lvt

# 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
@


1.1
log
@Initial revision
@
text
@a32 3
# Standard NFS utilities
#
NFS=	rup rusers
d55 1
a55 1
	${KMEM} ${SETUID} ${NFS_SETUID} nfs \
a57 1
nfs: ${NFS}
d72 1
a72 1
${NFS} ${NFS_SETUID}:
d75 1
a75 3
install: install-nfs install-dist

install-dist: ${STD} ${NSTD} ${KMEM} ${SETUID} ${NFS_SETUID}
a118 5

install-nfs: ${NFS}
	-mkdir ${DESTDIR}/usr/ucb
	-for i in ${NFS}; do \
		(install -s $$i ${DESTDIR}/usr/ucb/$$i); done
@
