1# 2# Copyright (c) 1980 Regents of the University of California. 3# All rights reserved. The Berkeley software License Agreement 4# specifies the terms and conditions for redistribution. 5# 6# @(#)Makefile 5.20 (Berkeley) 02/13/87 7# 8DESTDIR= 9CFLAGS= -O 10 11# Programs that live in subdirectories, and have makefiles of their own. 12# 13SUBDIR= adb as awk csh diff make sed sh tp 14 15# Shell scripts that need only be installed and are never removed. 16# 17SCRIPT= false true 18 19# C programs that live in the current directory and do not need 20# explicit make lines. 21# 22STD= ar cat cc chgrp chmod cmp date dd du echo ed grep hostid \ 23 hostname kill ld ln ls machine mkdir mt nice nm od pagesize pr \ 24 pwd rm rmail rmdir size stty sync tar tee test time who 25 26# C programs that live in the current directory and need explicit make lines. 27# 28NSTD= expr 29 30# Programs that must run setuid to root 31# 32SETUID= login mail passwd rcp su 33 34# Programs that run set-group-id operator 35# 36OPERATOR= df 37 38# Programs that must run set-group-id kmem. 39# 40KMEM= ps 41 42# Programs that must run set-group-id tty. 43# 44TTY= wall write 45 46BINS= ${STD} ${NSTD} ${SETUID} ${OPERATOR} ${KMEM} ${TTY} cp mv strip 47 48all: ${SUBDIR} ${BINS} 49 50${SUBDIR}: FRC 51 cd $@; make ${MFLAGS} 52 53FRC: 54 55 56${STD} ${SETUID} ${OPERATOR} ${TTY} mv cp strip: 57 ${CC} ${CFLAGS} -o $@ $@.c 58 59# take care with cp, strip, and mv, install uses them 60install: 61 install -s cp ${DESTDIR}/bin/newcp; \ 62 mv ${DESTDIR}/bin/newcp ${DESTDIR}/bin/cp; 63 install -s strip ${DESTDIR}/bin/newstrip; \ 64 mv ${DESTDIR}/bin/newstrip ${DESTDIR}/bin/strip; 65 rm -f ${DESTDIR}/bin/mv; cp mv ${DESTDIR}/bin/mv; rm -f mv; \ 66 strip ${DESTDIR}/bin/mv; chmod 755 ${DESTDIR}/bin/mv 67 -for i in ${SUBDIR}; do \ 68 (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done 69 -for i in ${SCRIPT}; do (install -c $$i.sh ${DESTDIR}/bin/$$i); done 70 -for i in ${STD} ${NSTD}; do (install -s $$i ${DESTDIR}/bin/$$i); done 71 -for i in ${SETUID}; do \ 72 (install -o root -m 4755 -s $$i ${DESTDIR}/bin/$$i); done 73 -for i in ${OPERATOR}; do \ 74 (install -g operator -m 2755 -s $$i ${DESTDIR}/bin/$$i); done 75 -for i in ${KMEM}; do \ 76 (install -g kmem -m 2755 -s $$i ${DESTDIR}/bin/$$i); done 77 -for i in ${TTY}; do \ 78 (install -g tty -m 2755 -s $$i ${DESTDIR}/bin/$$i); done 79 rm -f ${DESTDIR}/bin/[; ln ${DESTDIR}/bin/test ${DESTDIR}/bin/[ 80 rm -f ${DESTDIR}/bin/e; ln ${DESTDIR}/bin/ed ${DESTDIR}/bin/e 81 rm -f ${DESTDIR}/bin/chfn; ln ${DESTDIR}/bin/passwd ${DESTDIR}/bin/chfn 82 rm -f ${DESTDIR}/bin/chsh; ln ${DESTDIR}/bin/passwd ${DESTDIR}/bin/chsh 83 84clean: 85 rm -f ${BINS} expr.c a.out core *.s *.o errs 86 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done 87 88depend: expr.c 89 for i in ${BINS}; do \ 90 cc -M ${INCPATH} $$i.c | sed 's/\.o//' | \ 91 awk ' { if ($$1 != prev) \ 92 { if (rec != "") print rec; rec = $$0; prev = $$1; } \ 93 else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ 94 else rec = rec " " $$2 } } \ 95 END { print rec } ' >> makedep; done 96 echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep 97 echo '$$r makedep' >>eddep 98 echo 'w' >>eddep 99 cp Makefile Makefile.bak 100 ed - Makefile < eddep 101 rm eddep makedep 102 echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile 103 echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile 104 echo '# see make depend above' >> Makefile 105 106# Files listed in ${NSTD} have explicit make lines given below. 107 108expr: expr.o 109 cc ${CFLAGS} -o expr expr.o 110 111ps: 112 cc ${CFLAGS} -o ps ps.c -lm 113 114# DO NOT DELETE THIS LINE -- make depend uses it 115 116ar: ar.c /usr/include/sys/param.h /usr/include/sys/types.h 117ar: /usr/include/signal.h /usr/include/machine/machparam.h 118ar: /usr/include/sys/stat.h /usr/include/sys/time.h /usr/include/time.h 119ar: /usr/include/stdio.h /usr/include/ar.h 120cat: cat.c /usr/include/stdio.h /usr/include/sys/types.h 121cat: /usr/include/sys/stat.h 122cc: cc.c /usr/include/sys/param.h /usr/include/sys/types.h 123cc: /usr/include/signal.h /usr/include/machine/machparam.h /usr/include/stdio.h 124cc: /usr/include/ctype.h /usr/include/signal.h /usr/include/sys/dir.h 125chgrp: chgrp.c /usr/include/stdio.h /usr/include/ctype.h 126chgrp: /usr/include/sys/types.h /usr/include/sys/stat.h /usr/include/grp.h 127chgrp: /usr/include/pwd.h /usr/include/sys/dir.h 128chmod: chmod.c /usr/include/stdio.h /usr/include/sys/types.h 129chmod: /usr/include/sys/stat.h /usr/include/sys/dir.h 130cmp: cmp.c /usr/include/sys/param.h /usr/include/sys/types.h 131cmp: /usr/include/signal.h /usr/include/machine/machparam.h 132cmp: /usr/include/sys/file.h /usr/include/sys/stat.h /usr/include/stdio.h 133cmp: /usr/include/ctype.h 134date: date.c /usr/include/sys/param.h /usr/include/sys/types.h 135date: /usr/include/signal.h /usr/include/machine/machparam.h 136date: /usr/include/stdio.h /usr/include/sys/time.h /usr/include/time.h 137date: /usr/include/sys/file.h /usr/include/errno.h /usr/include/syslog.h 138date: /usr/include/utmp.h /usr/include/sys/socket.h /usr/include/netinet/in.h 139date: /usr/include/netdb.h /usr/include/protocols/timed.h 140dd: dd.c /usr/include/stdio.h /usr/include/signal.h 141du: du.c /usr/include/stdio.h /usr/include/sys/param.h /usr/include/sys/types.h 142du: /usr/include/signal.h /usr/include/machine/machparam.h 143du: /usr/include/sys/stat.h /usr/include/sys/dir.h 144echo: echo.c /usr/include/stdio.h 145ed: ed.c /usr/include/signal.h /usr/include/sgtty.h /usr/include/sys/ioctl.h 146ed: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h /usr/include/setjmp.h 147grep: grep.c /usr/include/stdio.h /usr/include/ctype.h 148hostid: hostid.c /usr/include/sys/types.h /usr/include/stdio.h 149hostid: /usr/include/ctype.h /usr/include/netdb.h 150hostname: hostname.c /usr/include/stdio.h 151kill: kill.c /usr/include/signal.h /usr/include/ctype.h 152ld: ld.c /usr/include/sys/param.h /usr/include/sys/types.h 153ld: /usr/include/signal.h /usr/include/machine/machparam.h 154ld: /usr/include/signal.h /usr/include/stdio.h /usr/include/ctype.h 155ld: /usr/include/ar.h /usr/include/a.out.h /usr/include/sys/exec.h 156ld: /usr/include/ranlib.h /usr/include/sys/stat.h /usr/include/sys/file.h 157ln: ln.c /usr/include/stdio.h /usr/include/sys/types.h /usr/include/sys/stat.h 158ln: /usr/include/errno.h 159ls: ls.c /usr/include/sys/param.h /usr/include/sys/types.h 160ls: /usr/include/signal.h /usr/include/machine/machparam.h 161ls: /usr/include/sys/stat.h /usr/include/sys/dir.h /usr/include/stdio.h 162ls: /usr/include/sgtty.h /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h 163ls: /usr/include/sys/ttydev.h /usr/include/pwd.h /usr/include/grp.h 164ls: /usr/include/utmp.h 165machine: machine.c 166mkdir: mkdir.c /usr/include/stdio.h 167mt: mt.c /usr/include/stdio.h /usr/include/ctype.h /usr/include/sys/types.h 168mt: /usr/include/sys/mtio.h /usr/include/sys/ioctl.h 169mt: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h 170mt: /usr/include/tahoevba/cyreg.h 171nice: nice.c /usr/include/stdio.h /usr/include/sys/time.h /usr/include/time.h 172nice: /usr/include/sys/resource.h 173nm: nm.c /usr/include/sys/types.h /usr/include/ar.h /usr/include/stdio.h 174nm: /usr/include/ctype.h /usr/include/a.out.h /usr/include/sys/exec.h 175nm: /usr/include/stab.h /usr/include/sys/stat.h 176od: od.c /usr/include/stdio.h /usr/include/sys/types.h /usr/include/sys/stat.h 177pagesize: pagesize.c 178pr: pr.c /usr/include/stdio.h /usr/include/signal.h /usr/include/sys/types.h 179pr: /usr/include/sys/stat.h 180pwd: pwd.c /usr/include/stdio.h /usr/include/sys/param.h 181pwd: /usr/include/sys/types.h /usr/include/signal.h 182pwd: /usr/include/machine/machparam.h 183rm: rm.c /usr/include/stdio.h /usr/include/sys/param.h /usr/include/sys/types.h 184rm: /usr/include/signal.h /usr/include/machine/machparam.h 185rm: /usr/include/sys/stat.h /usr/include/sys/dir.h /usr/include/sys/file.h 186rmail: rmail.c /usr/include/stdio.h /usr/include/sysexits.h 187rmdir: rmdir.c /usr/include/stdio.h 188size: size.c /usr/include/stdio.h /usr/include/a.out.h /usr/include/sys/exec.h 189stty: stty.c /usr/include/stdio.h /usr/include/sys/ioctl.h 190stty: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h 191sync: sync.c 192tar: tar.c /usr/include/stdio.h /usr/include/sys/param.h 193tar: /usr/include/sys/types.h /usr/include/signal.h 194tar: /usr/include/machine/machparam.h /usr/include/sys/stat.h 195tar: /usr/include/sys/dir.h /usr/include/sys/ioctl.h 196tar: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h 197tar: /usr/include/sys/mtio.h /usr/include/sys/time.h /usr/include/time.h 198tar: /usr/include/signal.h /usr/include/errno.h /usr/include/fcntl.h 199tee: tee.c /usr/include/signal.h /usr/include/sys/types.h 200tee: /usr/include/sys/stat.h /usr/include/errno.h 201test: test.c /usr/include/stdio.h /usr/include/sys/types.h 202test: /usr/include/sys/stat.h 203time: time.c /usr/include/stdio.h /usr/include/signal.h 204time: /usr/include/sys/types.h /usr/include/sys/time.h /usr/include/time.h 205time: /usr/include/sys/resource.h 206who: who.c /usr/include/sys/param.h /usr/include/sys/types.h 207who: /usr/include/signal.h /usr/include/machine/machparam.h /usr/include/utmp.h 208who: /usr/include/pwd.h /usr/include/stdio.h /usr/include/strings.h 209who: /usr/include/ctype.h 210expr: expr.c /usr/include/stdio.h 211login: login.c /usr/include/sys/param.h /usr/include/sys/types.h 212login: /usr/include/signal.h /usr/include/machine/machparam.h 213login: /usr/include/sys/quota.h /usr/include/sys/stat.h /usr/include/sys/time.h 214login: /usr/include/time.h /usr/include/sys/resource.h /usr/include/sys/file.h 215login: /usr/include/sgtty.h /usr/include/sys/ioctl.h 216login: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h 217login: /usr/include/utmp.h /usr/include/signal.h /usr/include/pwd.h 218login: /usr/include/stdio.h /usr/include/lastlog.h /usr/include/errno.h 219login: /usr/include/ttyent.h /usr/include/syslog.h /usr/include/grp.h 220mail: mail.c /usr/include/sys/param.h /usr/include/sys/types.h 221mail: /usr/include/signal.h /usr/include/machine/machparam.h 222mail: /usr/include/sys/stat.h /usr/include/sys/file.h /usr/include/ctype.h 223mail: /usr/include/stdio.h /usr/include/pwd.h /usr/include/utmp.h 224mail: /usr/include/signal.h /usr/include/setjmp.h /usr/include/sysexits.h 225mail: /usr/include/sys/socket.h /usr/include/netinet/in.h /usr/include/netdb.h 226passwd: passwd.c /usr/include/sys/types.h /usr/include/sys/file.h 227passwd: /usr/include/sys/time.h /usr/include/time.h /usr/include/sys/resource.h 228passwd: /usr/include/stdio.h /usr/include/signal.h /usr/include/pwd.h 229passwd: /usr/include/ndbm.h /usr/include/errno.h /usr/include/strings.h 230passwd: /usr/include/ctype.h 231rcp: rcp.c /usr/include/sys/param.h /usr/include/sys/types.h 232rcp: /usr/include/signal.h /usr/include/machine/machparam.h 233rcp: /usr/include/sys/stat.h /usr/include/sys/time.h /usr/include/time.h 234rcp: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h 235rcp: /usr/include/sys/ttydev.h /usr/include/netinet/in.h /usr/include/stdio.h 236rcp: /usr/include/signal.h /usr/include/pwd.h /usr/include/ctype.h 237rcp: /usr/include/netdb.h /usr/include/errno.h /usr/include/sys/dir.h 238su: su.c /usr/include/stdio.h /usr/include/pwd.h /usr/include/grp.h 239su: /usr/include/syslog.h /usr/include/sys/types.h /usr/include/sys/time.h 240su: /usr/include/time.h /usr/include/sys/resource.h 241df: df.c /usr/include/sys/param.h /usr/include/sys/types.h 242df: /usr/include/signal.h /usr/include/machine/machparam.h 243df: /usr/include/sys/fs.h /usr/include/sys/stat.h /usr/include/errno.h 244df: /usr/include/stdio.h /usr/include/fstab.h /usr/include/mtab.h 245ps: ps.c /usr/include/stdio.h /usr/include/ctype.h /usr/include/a.out.h 246ps: /usr/include/sys/exec.h /usr/include/pwd.h /usr/include/sys/param.h 247ps: /usr/include/sys/types.h /usr/include/signal.h 248ps: /usr/include/machine/machparam.h /usr/include/sys/ioctl.h 249ps: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h 250ps: /usr/include/sys/tty.h /usr/include/sys/ttychars.h 251ps: /usr/include/sys/ttydev.h /usr/include/sys/dir.h /usr/include/sys/user.h 252ps: /usr/include/machine/pcb.h /usr/include/sys/dmap.h /usr/include/sys/time.h 253ps: /usr/include/time.h /usr/include/sys/resource.h /usr/include/sys/namei.h 254ps: /usr/include/sys/uio.h /usr/include/errno.h /usr/include/sys/proc.h 255ps: /usr/include/machine/pte.h /usr/include/sys/vm.h /usr/include/sys/vmparam.h 256ps: /usr/include/machine/vmparam.h /usr/include/sys/vmmac.h 257ps: /usr/include/sys/vmmeter.h /usr/include/sys/vmsystm.h 258ps: /usr/include/sys/text.h /usr/include/sys/stat.h /usr/include/sys/mbuf.h 259ps: /usr/include/math.h /usr/include/errno.h /usr/include/utmp.h 260wall: wall.c /usr/include/stdio.h /usr/include/utmp.h /usr/include/errno.h 261wall: /usr/include/signal.h /usr/include/sys/time.h /usr/include/time.h 262wall: /usr/include/fcntl.h /usr/include/sys/types.h /usr/include/sys/stat.h 263write: write.c /usr/include/stdio.h /usr/include/ctype.h 264write: /usr/include/sys/types.h /usr/include/sys/stat.h /usr/include/signal.h 265write: /usr/include/utmp.h /usr/include/sys/time.h /usr/include/time.h 266cp: cp.c /usr/include/stdio.h /usr/include/sys/param.h /usr/include/sys/types.h 267cp: /usr/include/signal.h /usr/include/machine/machparam.h 268cp: /usr/include/sys/stat.h /usr/include/sys/dir.h /usr/include/sys/time.h 269cp: /usr/include/time.h 270mv: mv.c /usr/include/sys/param.h /usr/include/sys/types.h 271mv: /usr/include/signal.h /usr/include/machine/machparam.h 272mv: /usr/include/sys/stat.h /usr/include/sys/time.h /usr/include/time.h 273mv: /usr/include/stdio.h /usr/include/sys/dir.h /usr/include/errno.h 274mv: /usr/include/signal.h 275strip: strip.c /usr/include/a.out.h /usr/include/sys/exec.h 276strip: /usr/include/signal.h /usr/include/stdio.h /usr/include/sys/file.h 277# DEPENDENCIES MUST END AT END OF FILE 278# IF YOU PUT STUFF HERE IT WILL GO AWAY 279# see make depend above 280