1*21721Sdist# 2*21721Sdist# Copyright (c) 1980 Regents of the University of California. 3*21721Sdist# All rights reserved. The Berkeley software License Agreement 4*21721Sdist# specifies the terms and conditions for redistribution. 5*21721Sdist# 6*21721Sdist# @(#)makefile.c70 1.2 (Berkeley) 05/31/85 7*21721Sdist# 84705SmarkVERSION=3.7 94705Smark# 104705Smark# Ex skeletal makefile for BBN's C/70. 114705Smark# 124705Smark# NB: This makefile doesn't indicate any dependencies on header files. 134705Smark# 144705Smark# Ex is very large - this version will not fit on PDP-11's without overlay 154705Smark# software. Things that can be turned off to save 164705Smark# space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL 174705Smark# (visual \ nonsense on upper case only terminals), CHDIR (the undocumented 184705Smark# chdir command.) CRYPT includes the code to edit encrypted files (the -x 194705Smark# option, like ed.) VMUNIX makes ex considerably larger, raising many limits 204705Smark# and improving speed and simplicity of maintenance. It is suitable only 214705Smark# for a VAX or other large machine, and then probably only in a paged system. 224705Smark# 234705Smark# Don't define VFORK unless your system has the VFORK system call, 244705Smark# which is like fork but the two processes have only one data space until the 254705Smark# child execs. This speeds up ex by saving the memory copy. 264705Smark# 274705Smark# If your system expands tabs to 4 spaces you should -DTABS=4 below 284705Smark# 294705SmarkBINDIR= /usr/ucb/bin 304705SmarkNBINDIR=/usr/new 314705SmarkLIBDIR= /usr/lib 324705SmarkFOLD= ${BINDIR}/fold 334705SmarkCTAGS= ${BINDIR}/ctags 344705SmarkXSTR= ${BINDIR}/xstr 354705SmarkDEBUGFLAGS= -DTRACE -g 364705SmarkNONDEBUGFLAGS= -O 374705SmarkDEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug 384705SmarkOPTIONS= -DCRYPT -DLISPCODE -DCHDIR -DUCVISUAL 394705SmarkCFLAGS= -DTABS=8 -I${INCLUDE} ${OPTIONS} ${DEB} 404705SmarkLDFLAGS= -n # or -i or -z 414705SmarkTERMLIB= -ltermcap 424705SmarkMKSTR= ${BINDIR}/mkstr 434705SmarkCXREF= ${BINDIR}/cxref 444705SmarkINCLUDE=/usr/ucb/include 454705SmarkPR= pr 464705SmarkOBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \ 474705Smark ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \ 484705Smark ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \ 494705Smark ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \ 504705Smark ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \ 514705Smark printf.o bcopy.o strings.o 524705SmarkASFIX= ex_cmdsub.o ex_io.o ex_subr.o ex_temp.o ex_vmain.o ex_voper.o \ 534705Smark ex_vops.o ex_vops3.o ex_vwind.o 544705SmarkHDRS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h 554705SmarkSRC1= ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c 564705SmarkSRC2= ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c 574705SmarkSRC3= ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c 584705SmarkSRC4= ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c 594705SmarkSRC5= ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c 604705SmarkSRC6= printf.c bcopy.c expreserve.c exrecover.c 614705SmarkMISC= makefile READ_ME rofix 624705SmarkVGRIND= csh /usr/ucb/vgrind 634705SmarkVHDR= "Ex Version ${VERSION}" 644705Smark 654705Smark.c.o: 664705Smark# ifdef VMUNIX 674705Smark# ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - 684705Smark# else 694705Smark ${MKSTR} - ex${VERSION}strings x $*.c 704705Smark ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c - 714705Smark rm -f x$*.c 724705Smark# endif 734705Smark ${CC} ${CFLAGS} -c x.c 744705Smark mv x.o $*.o 754705Smark 764705Smarka.out: ${OBJS} 774705Smark ${CC} ${LDFLAGS} -o a.out ${OBJS} ${TERMLIB} 784705Smark 794705Smarkall: a.out exrecover expreserve tags 804705Smark 814705Smarktags: /tmp 824705Smark ${CTAGS} -w ex.[hc] ex_*.[hc] 834705Smark 844705Smark${OBJS}: ex_vars.h 854705Smark 864705Smark# ex_vars.h: 874705Smark# csh makeoptions ${CFLAGS} 884705Smark 894705Smarkbcopy.o: bcopy.c 904705Smark ${CC} -c ${CFLAGS} bcopy.c 914705Smark 924705Smark# The following can be deleted when the C70 compiler is 934705Smark# fixed to do pointer subtraction correctly. 944705Smark 954705Smark${ASFIX}: ex_vars.h ex_vis.h 964705Smark ${MKSTR} - ex${VERSION}strings x $*.c 974705Smark ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c - 984705Smark rm -f x$*.c 994705Smark ${CC} ${CFLAGS} -c -S x.c 1004705Smark ed - <asfix.c70 x.s 1014705Smark ${CC} -c x.s 1024705Smark mv x.o $*.o 1034705Smark rm x.s 1044705Smark 1054705Smark# xstr: hands off! 1064705Smarkstrings.o: strings 1074705Smark ${XSTR} 1084705Smark ${CC} -c -S xs.c 1094705Smark ed - <rofix xs.s 1104705Smark ${AS} -o strings.o xs.s 1114705Smark rm xs.s 1124705Smark 1134705Smarkexrecover: exrecover.o 1144705Smark ${CC} ${CFLAGS} exrecover.o ex_extern.o -o exrecover 1154705Smark 1164705Smarkexrecover.o: exrecover.c 1174705Smark ${CC} ${CFLAGS} -c -O exrecover.c 1184705Smark 1194705Smarkexpreserve: expreserve.o 1204705Smark ${CC} expreserve.o -o expreserve 1214705Smark 1224705Smarkexpreserve.o: 1234705Smark ${CC} ${CFLAGS} -c -O expreserve.c 1244705Smark 1254705Smarkclean: 1264705Smark# If we dont have ex we cant make it so dont rm ex_vars.h 1274705Smark -rm -f a.out exrecover expreserve strings core errs trace 1284705Smark -rm -f *.o x*.[cs] 1294705Smark 1304705Smark# install a new version for testing in /usr/new 1314705Smarkninstall: a.out 1324705Smark -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view 1334705Smark cp a.out ${DESTDIR}${NBINDIR}/ex 1344705Smark# -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings 1354705Smark ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi 1364705Smark ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view 1374705Smark chmod 1755 ${DESTDIR}${NBINDIR}/ex 1384705Smark 1394705Smark# install in standard place (/usr/ucb) 1404705Smarkinstall: a.out exrecover expreserve 1414705Smark strip a.out 1424705Smark -rm -f ${DESTDIR}${BINDIR}/ex 1434705Smark -rm -f ${DESTDIR}${BINDIR}/vi 1444705Smark -rm -f ${DESTDIR}${BINDIR}/view 1454705Smark -rm -f ${DESTDIR}${BINDIR}/edit 1464705Smark -rm -f ${DESTDIR}${BINDIR}/e 1474705Smark -rm -f ${DESTDIR}/usr/bin/ex 1484705Smark cp a.out ${DESTDIR}${BINDIR}/ex 1494705Smark# cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings 1504705Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 1514705Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e 1524705Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 1534705Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view 1544705Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex 1554705Smark chmod 1755 ${DESTDIR}${BINDIR}/ex 1564705Smark cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover 1574705Smark cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 1584705Smark chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 1594705Smark# The following line normally fails. This is OK. 1604705Smark -mkdir ${DESTDIR}/usr/preserve 1614705Smark 1624705Smark# move from /usr/new to /usr/ucb 1634705Smarknewucb: a.out 1644705Smark -rm -f ${DESTDIR}${BINDIR}/ex 1654705Smark -rm -f ${DESTDIR}${BINDIR}/vi 1664705Smark -rm -f ${DESTDIR}${BINDIR}/edit 1674705Smark -rm -f ${DESTDIR}${BINDIR}/e 1684705Smark -rm -f ${DESTDIR}/usr/bin/ex 1694705Smark mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex 1704705Smark -rm -f ${DESTDIR}${NBINDIR}/vi 1714705Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 1724705Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e 1734705Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 1744705Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex 1754705Smark chmod 1755 ${DESTDIR}${BINDIR}/ex 1764705Smark 1774705Smarklint: 1784705Smark lint ${CFLAGS} ex.c ex_?*.c 1794705Smark lint ${CFLAGS} -u exrecover.c 1804705Smark lint ${CFLAGS} expreserve.c 1814705Smark 1824705Smarkprint: 1834705Smark @${PR} READ* BUGS 1844705Smark @${PR} makefile* 1854705Smark @${PR} /etc/termcap 1864705Smark @(size -l a.out ; size *.o) | ${PR} -h sizes 1874705Smark @${PR} -h errno.h ${INCLUDE}/errno.h 1884705Smark @${PR} -h setjmp.h ${INCLUDE}/setjmp.h 1894705Smark @${PR} -h sgtty.h ${INCLUDE}/sgtty.h 1904705Smark @${PR} -h signal.h ${INCLUDE}/signal.h 1914705Smark @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h 1924705Smark @${PR} -h sys/types.h ${INCLUDE}/sys/types.h 1934705Smark @ls -ls | ${PR} 1944705Smark @${CXREF} *.c | ${PR} -h XREF 1954705Smark @${PR} *.h *.c 1964705Smarkvgrind: 1974705Smark tee index < /dev/null 1984705Smark ${VGRIND} -h ${VHDR} ${HDRS} 1994705Smark ${VGRIND} -h ${VHDR} ${SRC1} 2004705Smark ${VGRIND} -h ${VHDR} ${SRC2} 2014705Smark ${VGRIND} -h ${VHDR} ${SRC3} 2024705Smark ${VGRIND} -h ${VHDR} ${SRC4} 2034705Smark ${VGRIND} -h ${VHDR} ${SRC5} 2044705Smark ${VGRIND} -h ${VHDR} ${SRC6} 2054705Smark ${VGRIND} -n -h ${VHDR} ${MISC} 2064705Smark ${VGRIND} -i -h ${VHDR} index 207