Subject: Top level make problems (and others) + fixes (9 of 11 - #114) Index: src/*/{Makefile,.c} 2.11BSD Description: The process of recompiling the complete system from sources does not completely succeed, there are programs not compiled, programs installed in the wrong place, files (objects, man pages,etc) which are not removed when a "make clean" is done, man pages not formatted, other man pages which are the wrong ones being installed, programs compiling with errors and so on and so forth. In short, most of the Makefiles and a number of sourcefiles in the system were in need of repair. Much of the credit (or blame ;-)) for the series of patches to follow is due to Paul Taylor (taylor@oswego.oswego.edu). Takes a high amount of "patience" to do multiple top level 'make's on a pdp-11/73. Thanks. Repeat-By: cd /usr/src make all make install make clean After anywhere between 12 and 18 hours note the debris and errors left behind. Fix: Apply this (#114) and the following patches (115 and 116). This update corrects the problems with the /usr/src/ucb Makefiles. The 'last' program is updated to handle alternate wtmp files. Some of the patches may not apply because the programs (notably in /usr/src/new and /usr/src/local) may not be present in the system (having been ported/added since the initial release of the system). There was an earlier posting of these programs ('popper', 'less', etc), if those articles are not present they may be obtained (along with these and previous patches) via anonymous FTP to 'ftp.iipo.gtegsc.com' in the directory pub/2.11BSD. The patches have been grouped and split along directory boundaries. The contents are: #106 - script to remove some redundant man pages and rename others to their correct resting place. /usr/src/Makefile (top level makefile) patch. NOTE: the choice of hostfile or nameserver is made only in lib/libc/Makefile now, not in both /usr/src/Makefile and lib/libc/Makefile #107 - /usr/src/bin updates. There are two source (.c and .h) updates as well as the Makefile patches. #108 - /usr/src/etc updates. Several source patches are included. #109 - /usr/src/games updates. A couple of .c files are also updated to remove compile time warnings. NOTE: before doing a top level make you will have to configure 'warp' and do a 'make depend'. #110 - /usr/src/lib updates. Only Makefiles are updated. #111 - /usr/src/local updates. Only Makefile are updated but some of the directories/programs may not exist on all systems. #112 - /usr/src/man updates. One man page (last.1) is updated along with the Makefiles. #113 - /usr/src/new updates. Some programs may not exist ('tcsh') on all systems (but are available via ftp). Other programs (rn, etc) may require some attention if the patches do not apply cleanly. #114 - /usr/src/ucb updates. The 'last' command is updated to handle alternate wtmp files. A couple other .h or .c files are updated to remove compile time warning errors. #115 - /usr/src/usr.bin updates. The 'struct' and 'tbl' program sources receive numerous updates to remove compile time errors. The remaining updates apply to the Makefiles. #116 - /usr/src/usr.lib updates. Makefiles are fixed. ======================================================================== *** /usr/src/ucb/Makefile.old Sun Mar 18 08:39:09 1990 --- /usr/src/ucb/Makefile Mon Jan 18 09:35:42 1993 *************** *** 47,53 **** ${STD} ${KMEM} ${SETUID}: cc ${CFLAGS} ${SEPFLAG} -o $@ $@.c ! install: -for i in ${SUBDIR}; do \ (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done -for i in ${CSHSCRIPT}; do \ --- 47,53 ---- ${STD} ${KMEM} ${SETUID}: cc ${CFLAGS} ${SEPFLAG} -o $@ $@.c ! install: ${STD} ${NSTD} ${KMEM} ${SETUID} -for i in ${SUBDIR}; do \ (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done -for i in ${CSHSCRIPT}; do \ *** /usr/src/ucb/dbx/Makefile.old Wed Mar 18 18:53:33 1987 --- /usr/src/ucb/dbx/Makefile Mon Jan 18 09:35:48 1993 *************** *** 10,16 **** dbx: ${OBJS} ${CC} -o dbx ${SEPFLAG} ${OBJS} ! install: install -s dbx ${DESTDIR}/usr/ucb clean: --- 10,16 ---- dbx: ${OBJS} ${CC} -o dbx ${SEPFLAG} ${OBJS} ! install: dbx install -s dbx ${DESTDIR}/usr/ucb clean: *** /usr/src/ucb/error/Makefile.old Mon Feb 16 22:48:35 1987 --- /usr/src/ucb/error/Makefile Mon Jan 18 09:35:49 1993 *************** *** 32,38 **** $(OBJS): $(HDRS) ! install: install -s error $(DESTDIR)/usr/ucb clean: --- 32,38 ---- $(OBJS): $(HDRS) ! install: error install -s error $(DESTDIR)/usr/ucb clean: *** /usr/src/ucb/ex/ex_tune.h.old Mon Feb 16 22:07:31 1987 --- /usr/src/ucb/ex/ex_tune.h Mon Jan 18 09:35:50 1993 *************** *** 107,115 **** * hardcopy mode when a line gets longer than 80 characters. */ #ifndef VMUNIX ! #define TUBELINES 60 /* Number of screen lines for visual */ #define TUBECOLS 160 /* Number of screen columns for visual */ ! #define TUBESIZE 5000 /* Maximum screen size for visual */ #else #define TUBELINES 70 #define TUBECOLS 160 --- 107,115 ---- * hardcopy mode when a line gets longer than 80 characters. */ #ifndef VMUNIX ! #define TUBELINES 70 /* Number of screen lines for visual */ #define TUBECOLS 160 /* Number of screen columns for visual */ ! #define TUBESIZE 6000 /* Maximum screen size for visual */ #else #define TUBELINES 70 #define TUBECOLS 160 *** /usr/src/ucb/finger/Makefile.old Sun Mar 18 08:55:50 1990 --- /usr/src/ucb/finger/Makefile Thu Jan 21 09:23:19 1993 *************** *** 17,22 **** --- 17,23 ---- # @(#)Makefile 5.2 (Berkeley) 5/10/89 # + SEPFLAG= -i CFLAGS= -O -DSECSPERDAY=86400 -DDAYSPERNYEAR=365 ${SEPFLAG} LIBC= /lib/libc.a SRCS= finger.c lprint.c net.c sprint.c util.c *************** *** 29,35 **** ${CC} -o $@ ${CFLAGS} ${OBJS} clean: ! rm -f ${OBJS} core finger cleandir: clean rm -f ${MAN} tags .depend --- 30,36 ---- ${CC} -o $@ ${CFLAGS} ${OBJS} clean: ! rm -f ${OBJS} core finger ${MAN} cleandir: clean rm -f ${MAN} tags .depend *************** *** 38,46 **** mkdep -p ${CFLAGS} ${SRCS} # install: ${MAN} ! install: finger install -s -o bin -g bin -m 755 finger ${DESTDIR}/usr/ucb ! # install -c -o bin -g bin -m 444 finger.0 ${DESTDIR}/usr/man/cat1 lint: ${SRCS} lint ${CFLAGS} ${SRCS} --- 39,50 ---- mkdep -p ${CFLAGS} ${SRCS} # install: ${MAN} ! install: finger ${MAN} install -s -o bin -g bin -m 755 finger ${DESTDIR}/usr/ucb ! install -c -o bin -g bin -m 444 finger.0 ${DESTDIR}/usr/man/cat1 ! ! ${MAN}: finger.1 ! /usr/man/manroff finger.1 > ${MAN} lint: ${SRCS} lint ${CFLAGS} ${SRCS} *** /usr/src/ucb/fp/Makefile.old Wed Mar 18 18:53:53 1987 --- /usr/src/ucb/fp/Makefile Mon Jan 18 09:35:52 1993 *************** *** 10,16 **** fp: ${OBJS} ${CC} -o fp ${SEPFLAG} ${OBJS} ! install: install -s fp ${DESTDIR}/usr/ucb clean: --- 10,16 ---- fp: ${OBJS} ${CC} -o fp ${SEPFLAG} ${OBJS} ! install: fp install -s fp ${DESTDIR}/usr/ucb clean: *** /usr/src/ucb/ftp/Makefile.old Tue May 29 08:34:50 1990 --- /usr/src/ucb/ftp/Makefile Mon Jan 18 09:35:53 1993 *************** *** 22,27 **** --- 22,28 ---- SRCS= cmds.c cmdtab.c ftp.c glob.c main.c ruserpass.c domacro.c OBJS= cmds.o cmdtab.o ftp.o glob.o main.o ruserpass.o domacro.o MAN= ftp.0 + MANSRC= ftp.1 all: ftp *************** *** 28,45 **** ftp: ${OBJS} ${LIBC} ${CC} ${SEPFLAG} -o $@ ${CFLAGS} ${OBJS} clean: ! rm -f ${OBJS} core ftp cleandir: clean ! rm -f ${MAN} tags .depend depend: ${SRCS} mkdep ${CFLAGS} ${SRCS} ! install: ${MAN} install -s -o bin -g bin -m 751 ftp ${DESTDIR}/usr/ucb ! -install -c -o bin -g bin -m 444 ftp.0 ${DESTDIR}/usr/man/cat1 lint: ${SRCS} lint ${CFLAGS} ${SRCS} --- 29,49 ---- ftp: ${OBJS} ${LIBC} ${CC} ${SEPFLAG} -o $@ ${CFLAGS} ${OBJS} + ftp.0: ${MANSRC} + /usr/man/manroff ${MANSRC} > ${MAN} + clean: ! rm -f ${OBJS} ${MAN} core ftp cleandir: clean ! rm -f tags .depend depend: ${SRCS} mkdep ${CFLAGS} ${SRCS} ! install: ftp ${MAN} install -s -o bin -g bin -m 751 ftp ${DESTDIR}/usr/ucb ! install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1 lint: ${SRCS} lint ${CFLAGS} ${SRCS} *** /usr/src/ucb/last.c.old Sun Jul 3 19:58:20 1988 --- /usr/src/ucb/last.c Mon Jan 18 09:35:43 1993 *************** *** 52,61 **** --- 52,64 ---- int wtmp; off_t bl; char *ct; + char wtmpfile[256]; + char progname[256]; register struct utmp *bp; long otime; struct stat stb; int print; + int sinput = 0; char * crmsg = (char *)0; long crtime; long outrec = 0; *************** *** 62,76 **** long maxrec = 0x7fffffffL; time(&buf[0].ut_time); ac--, av++; nameargs = argc = ac; argv = av; for (i = 0; i < argc; i++) { ! if (argv[i][0] == '-' && ! argv[i][1] >= '0' && argv[i][1] <= '9') { ! maxrec = atoi(argv[i]+1); ! nameargs--; ! continue; } if (strlen(argv[i])>2) continue; --- 65,95 ---- long maxrec = 0x7fffffffL; time(&buf[0].ut_time); + strcpy(wtmpfile,"/usr/adm/wtmp"); + strcpy(progname,av[0]); ac--, av++; nameargs = argc = ac; argv = av; for (i = 0; i < argc; i++) { ! if (argv[i][0] == '-' ) { ! if ( argv[i][1] >= '0' && argv[i][1] <= '9') { ! maxrec = atoi(argv[i]+1); ! nameargs--; ! continue; ! } else { ! if (argv[i][1] == 'f') { ! i++; ! if ( i < argc) { ! strcpy(wtmpfile,argv[i]); ! nameargs = nameargs -2; ! continue; ! } else { ! usage(progname); ! } ! } else { ! usage(progname); ! } ! } } if (strlen(argv[i])>2) continue; *************** *** 84,92 **** continue; argv[i] = strspl("tty", argv[i]); } ! wtmp = open("/usr/adm/wtmp", 0); if (wtmp < 0) { ! perror("/usr/adm/wtmp"); exit(1); } fstat(wtmp, &stb); --- 103,111 ---- continue; argv[i] = strspl("tty", argv[i]); } ! wtmp = open(wtmpfile, 0); if (wtmp < 0) { ! perror(wtmpfile); exit(1); } fstat(wtmp, &stb); *************** *** 212,215 **** --- 231,243 ---- strcpy(res, left); strcat(res, right); return (res); + } + + void + usage(progname) + char *progname; + { + printf("Usage: %s [ -f filename ] [-number] [name...] [tty...]\n", + progname); + exit(1); } *** /usr/src/ucb/lisp/Makefile.old Sat Mar 7 14:03:04 1987 --- /usr/src/ucb/lisp/Makefile Mon Jan 18 09:35:54 1993 *************** *** 10,16 **** lisp: ${OBJS} ${CC} -o lisp ${SEPFLAG} ${OBJS} ! install: install -s -m 711 lisp ${DESTDIR}/usr/ucb clean: --- 10,16 ---- lisp: ${OBJS} ${CC} -o lisp ${SEPFLAG} ${OBJS} ! install: lisp install -s -m 711 lisp ${DESTDIR}/usr/ucb clean: *** /usr/src/ucb/lock/Makefile.old Tue May 29 08:49:41 1990 --- /usr/src/ucb/lock/Makefile Mon Jan 18 09:35:55 1993 *************** *** 23,28 **** --- 23,29 ---- SRCS= lock.c OBJS= MAN= lock.0 + MANSRC= lock.1 all: lock *************** *** 29,46 **** lock: ${LIBC} ${CC} ${SEPFLAG} -o $@ ${CFLAGS} $@.c clean: ! rm -f ${OBJS} core lock cleandir: clean ! rm -f ${MAN} tags .depend depend: ${SRCS} mkdep -p ${CFLAGS} ${SRCS} ! install: ${MAN} install -s -o root -g bin -m 4755 lock ${DESTDIR}/usr/ucb ! -install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1 lint: ${SRCS} lint ${CFLAGS} ${SRCS} --- 30,50 ---- lock: ${LIBC} ${CC} ${SEPFLAG} -o $@ ${CFLAGS} $@.c + lock.0: ${MANSRC} + /usr/man/manroff ${MANSRC} > ${MAN} + clean: ! rm -f ${OBJS} ${MAN} core lock cleandir: clean ! rm -f tags .depend depend: ${SRCS} mkdep -p ${CFLAGS} ${SRCS} ! install: lock ${MAN} install -s -o root -g bin -m 4755 lock ${DESTDIR}/usr/ucb ! install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1 lint: ${SRCS} lint ${CFLAGS} ${SRCS} *** /usr/src/ucb/man/Makefile.old Mon Dec 26 15:34:31 1988 --- /usr/src/ucb/man/Makefile Tue Jan 26 08:48:52 1993 *************** *** 17,22 **** --- 17,23 ---- # @(#)Makefile 5.5 (Berkeley) 6/29/88 # CFLAGS= -O + SEPFLAG= -i LIBC= /lib/libc.a ASRCS= apropos.c MSRCS= man.c *************** *** 24,33 **** all: man apropos apropos: ${LIBC} ! ${CC} -o $@ ${CFLAGS} ${ASRCS} man: ${LIBC} ! ${CC} -o $@ ${CFLAGS} ${MSRCS} clean: FRC rm -f core apropos man --- 25,34 ---- all: man apropos apropos: ${LIBC} ! ${CC} ${SEPFLAG} -o $@ ${CFLAGS} ${ASRCS} man: ${LIBC} ! ${CC} ${SEPFLAG} -o $@ ${CFLAGS} ${MSRCS} clean: FRC rm -f core apropos man *************** *** 35,41 **** depend: FRC mkdep -p ${CFLAGS} ${ASRCS} ${MSRCS} ! install: FRC rm -f ${DESTDIR}/usr/ucb/whatis ${DESTDIR}/usr/ucb/apropos install -s -o bin -g bin -m 755 apropos ${DESTDIR}/usr/ucb/apropos install -s -o bin -g bin -m 755 man ${DESTDIR}/usr/ucb/man --- 36,42 ---- depend: FRC mkdep -p ${CFLAGS} ${ASRCS} ${MSRCS} ! install: man apropos rm -f ${DESTDIR}/usr/ucb/whatis ${DESTDIR}/usr/ucb/apropos install -s -o bin -g bin -m 755 apropos ${DESTDIR}/usr/ucb/apropos install -s -o bin -g bin -m 755 man ${DESTDIR}/usr/ucb/man *** /usr/src/ucb/msgs/Makefile.old Mon Feb 16 23:16:59 1987 --- /usr/src/ucb/msgs/Makefile Mon Jan 18 09:35:57 1993 *************** *** 11,17 **** SRCS = msgs.c msgs.h Makefile msgs: msgs.c msgs.h cc ${SEPFLAG} $(CFLAGS) -o msgs msgs.c -ltermlib ! install: install -s msgs ${DESTDIR}/usr/ucb clean: -rm -f msgs --- 11,17 ---- SRCS = msgs.c msgs.h Makefile msgs: msgs.c msgs.h cc ${SEPFLAG} $(CFLAGS) -o msgs msgs.c -ltermlib ! install: msgs install -s msgs ${DESTDIR}/usr/ucb clean: -rm -f msgs *** /usr/src/ucb/netstat/Makefile.old Sun Jul 3 20:13:49 1988 --- /usr/src/ucb/netstat/Makefile Mon Jan 18 09:35:58 1993 *************** *** 27,33 **** depend: FRC mkdep ${CFLAGS} ${SRCS} ! install: FRC install -s -g kmem -m 2755 netstat ${DESTDIR}/usr/ucb/netstat lint: FRC --- 27,33 ---- depend: FRC mkdep ${CFLAGS} ${SRCS} ! install: netstat install -s -g kmem -m 2755 netstat ${DESTDIR}/usr/ucb/netstat lint: FRC *** /usr/src/ucb/pascal/Makefile.old Sat Jul 25 11:29:16 1987 --- /usr/src/ucb/pascal/Makefile Mon Jan 25 19:50:02 1993 *************** *** 18,24 **** cd $@; make CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" SEPFLAG=${SEPFLAG} \ BINDIR=${BINDIR} LIBDIR=${LIBDIR} ! install: for i in ${PASCAL}; do \ (cd $$i; make install DESTDIR=${DESTDIR}); \ done --- 18,24 ---- cd $@; make CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" SEPFLAG=${SEPFLAG} \ BINDIR=${BINDIR} LIBDIR=${LIBDIR} ! install: ${UTILS} for i in ${PASCAL}; do \ (cd $$i; make install DESTDIR=${DESTDIR}); \ done *** /usr/src/ucb/pascal/pi/Makefile.old Tue Sep 4 15:01:27 1990 --- /usr/src/ucb/pascal/pi/Makefile Mon Jan 18 09:35:59 1993 *************** *** 82,88 **** version: version.c ${CC} -o version version.c ! install: install -c ${ERRORSTRINGS} ${DESTDIR}/usr/lib install -c how_pi ${DESTDIR}/usr/lib install -c how_pix ${DESTDIR}/usr/lib --- 82,88 ---- version: version.c ${CC} -o version version.c ! install: ${ALL} install -c ${ERRORSTRINGS} ${DESTDIR}/usr/lib install -c how_pi ${DESTDIR}/usr/lib install -c how_pix ${DESTDIR}/usr/lib *** /usr/src/ucb/pascal/px/Makefile.old Sat Jul 25 13:05:16 1987 --- /usr/src/ucb/pascal/px/Makefile Mon Jan 18 09:36:01 1993 *************** *** 47,53 **** E.s E.h: Edata Emake.ed ed - Edata < Emake.ed ! install: install -s px ${DESTDIR}/usr/ucb/px install -s gather ${DESTDIR}/usr/lib/gather --- 47,53 ---- E.s E.h: Edata Emake.ed ed - Edata < Emake.ed ! install: ${ALL} install -s px ${DESTDIR}/usr/ucb/px install -s gather ${DESTDIR}/usr/lib/gather *** /usr/src/ucb/pascal/pxp/Makefile.old Sat Jul 25 13:09:15 1987 --- /usr/src/ucb/pascal/pxp/Makefile Mon Jan 18 09:36:02 1993 *************** *** 50,56 **** ${EYACC} -v pas.y ${ED} - y.tab.c < gram.ex ! install: install -s pxp ${DESTDIR}/usr/ucb/pxp install -c how_pxp ${DESTDIR}/usr/lib/how_pxp --- 50,56 ---- ${EYACC} -v pas.y ${ED} - y.tab.c < gram.ex ! install: pxp how_pxp install -s pxp ${DESTDIR}/usr/ucb/pxp install -c how_pxp ${DESTDIR}/usr/lib/how_pxp *** /usr/src/ucb/rdist/Makefile.old Mon Feb 16 23:45:41 1987 --- /usr/src/ucb/rdist/Makefile Mon Jan 18 09:36:03 1993 *************** *** 19,25 **** ${OBJS}: defs.h clean: ! rm -f *.o gram.c errs install: rdist install -s -m 4751 rdist ${DESTDIR}${RDIST} --- 19,25 ---- ${OBJS}: defs.h clean: ! rm -f *.o gram.c errs rdist install: rdist install -s -m 4751 rdist ${DESTDIR}${RDIST} *** /usr/src/ucb/sccs.c.old Mon Feb 16 22:11:07 1987 --- /usr/src/ucb/sccs.c Mon Jan 18 09:35:47 1993 *************** *** 1106,1111 **** --- 1106,1114 ---- ** entries are removed from pfile. */ + char *rindex(); + char *tail(); + bool unedit(fn) char *fn; *** /usr/src/ucb/tftp/Makefile.old Mon Sep 7 05:58:18 1987 --- /usr/src/ucb/tftp/Makefile Tue Jan 19 16:00:33 1993 *************** *** 5,11 **** # # @(#)Makefile 5.2 (Berkeley) 2/6/86 # ! ALL= tftp DESTDIR= CFLAGS=-O SEPFLAG=-i --- 5,11 ---- # # @(#)Makefile 5.2 (Berkeley) 2/6/86 # ! ALL= tftp tftp.0 DESTDIR= CFLAGS=-O SEPFLAG=-i *************** *** 15,22 **** tftp: main.o tftp.o tftpsubs.o ${CC} main.o tftp.o tftpsubs.o ${SEPFLAG} -o tftp clean: ! rm -f ${ALL} *.o *.s errs core a.out t.? ! install: install -s tftp ${DESTDIR}/usr/ucb --- 15,26 ---- tftp: main.o tftp.o tftpsubs.o ${CC} main.o tftp.o tftpsubs.o ${SEPFLAG} -o tftp + tftp.0: tftp.1 + /usr/man/manroff tftp.1 > tftp.0 + clean: ! rm -f ${ALL} *.o *.s errs core a.out t.? tftp.0 ! install: tftp tftp.0 install -s tftp ${DESTDIR}/usr/ucb + install -c -m 444 tftp.0 ${DESTDIR}/usr/man/cat1 *** /usr/src/ucb/tn3270/Makefile.old Sat Jul 30 19:59:13 1988 --- /usr/src/ucb/tn3270/Makefile Mon Jan 18 09:36:05 1993 *************** *** 80,86 **** mset: mset.o map3270.o ${CC} ${CFLAGS} ${SEPFLAG} -o mset mset.o map3270.o $(LIBCURSES) ! install: install -s tn3270 $(BINDIR) install -s mset $(BINDIR) install -c -m 444 map3270 $(ETCDIR) --- 80,86 ---- mset: mset.o map3270.o ${CC} ${CFLAGS} ${SEPFLAG} -o mset mset.o map3270.o $(LIBCURSES) ! install: tn3270 mset map3270 install -s tn3270 $(BINDIR) install -s mset $(BINDIR) install -c -m 444 map3270 $(ETCDIR) *** /usr/src/ucb/tset/tset.c.old Mon Feb 16 22:08:18 1987 --- /usr/src/ucb/tset/tset.c Mon Jan 18 09:36:19 1993 *************** *** 1369,1374 **** --- 1369,1376 ---- exit(0); } + char *tgetstr(); + /* * Set the hardware tabs on the terminal, using the ct (clear all tabs), * st (set one tab) and ch (horizontal cursor addressing) capabilities. *** /usr/src/ucb/vlp/Makefile.old Wed Mar 18 18:56:56 1987 --- /usr/src/ucb/vlp/Makefile Mon Jan 18 09:36:20 1993 *************** *** 10,16 **** vlp: ${OBJS} ${CC} -o vlp ${SEPFLAG} ${OBJS} ! install: install -s vlp ${DESTDIR}/usr/ucb clean: --- 10,16 ---- vlp: ${OBJS} ${CC} -o vlp ${SEPFLAG} ${OBJS} ! install: vlp install -s vlp ${DESTDIR}/usr/ucb clean: