1*21720Sdist# 2*21720Sdist# Copyright (c) 1980 Regents of the University of California. 3*21720Sdist# All rights reserved. The Berkeley software License Agreement 4*21720Sdist# specifies the terms and conditions for redistribution. 5*21720Sdist# 6*21720Sdist# @(#)makefile.70 7.3 (Berkeley) 05/31/85 7*21720Sdist# 84297SmarkVERSION=3.7 9464Smark# 10723Sroot# Ex skeletal makefile for version 7, USGS Overlay 11/70 system 11464Smark# 12464Smark# NB: This makefile doesn't indicate any dependencies on header files. 13464Smark# 14558Smark# Ex is very large - this version will not fit on PDP-11's without overlay 15558Smark# software. Things that can be turned off to save 16485Smark# space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL 17485Smark# (visual \ nonsense on upper case only terminals), CHDIR (the undocumented 18723Sroot# chdir command.) CRYPT includes code to handle the -x option to allow 191634Smark# encrypted files. Defining CRYPT drags in most of stdio (from the call 201634Smark# to getpass) and makes vi about 4k text and 4k data bigger). 211634Smark# VMUNIX makes ex considerably larger, raising many limits 22558Smark# and improving speed and simplicity of maintenance. It is suitable only 23558Smark# for a VAX or other large machine, and then probably only in a paged system. 24464Smark# 25485Smark# Don't define VFORK unless your system has the VFORK system call, 26485Smark# which is like fork but the two processes have only one data space until the 27485Smark# child execs. This speeds up ex by saving the memory copy. 28485Smark# 29464Smark# If your system expands tabs to 4 spaces you should -DTABS=4 below 30464Smark# 315209Scarl# If your system has no floating point unit, you should use FP= -f 325209Scarl# and change the the appropriate invocation of ${LD}. 335209Scarl# 34723SrootBINDIR= /usr/ucb/bin 35723SrootNBINDIR=/usr/new/bin 36806SrootLIBDIR= /usr/ucb/lib 37485SmarkFOLD= ${BINDIR}/fold 38485SmarkCTAGS= ${BINDIR}/ctags 39485SmarkXSTR= ${BINDIR}/xstr 40875SmarkCC= cc -V 41806SrootAS= ovas 42723SrootLD= ovld 43723SrootDEBUGFLAGS= -DTRACE 44681SmarkNONDEBUGFLAGS= -O 45558SmarkDEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug 46723SrootCFLAGS= -DTABS=8 -DLISPCODE -DCHDIR -DUCVISUAL ${DEB} 475209ScarlFP= 48723SrootTERMLIB= -lovtermlib 49485SmarkMKSTR= ${BINDIR}/mkstr 50485SmarkCXREF= ${BINDIR}/cxref 51812Sroot# PRINTF= printf.o; PRINTFS=printf.c 52723SrootPRINTF= ovprintf.o ovdoprnt.o 53812SrootPRINTFS=ovprintf.c ovdoprnt.s 54723SrootFMT= -i # 11/45, 70 55723Sroot# FMT= -n # 11/23, 34, 40 56464SmarkINCLUDE=/usr/include 57464SmarkPR= pr 58812SrootGET= sccs get 59558SmarkOBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \ 60558Smark ex_data.o ex_get.o ex_io.o ex_put.o ex_re.o \ 61558Smark ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \ 62812Sroot ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \ 63464Smark ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \ 644331Smark ${PRINTF} bcopy.o ex_extern.o strings.o 65812SrootSRCS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h\ 66812Sroot ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c \ 67812Sroot ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c \ 68812Sroot ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c \ 69812Sroot ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c \ 70812Sroot ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c \ 71813Sroot ${PRINTFS} bcopy.c 72464Smark 73485Smark.c.o: 74723Sroot ${MKSTR} - ex${VERSION}strings x $*.c 75723Sroot ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c - 76723Sroot rm -f x$*.c 77485Smark ${CC} ${CFLAGS} -c x.c 78485Smark mv x.o $*.o 79464Smark 80723Sroot# 11/23, 34, 40 and other non split I/D machines 815209Scarl# each of the 6 overlays must stay less than 16K. 82723Sroot# a.out: ${OBJS} 835209Scarl# if no floating point unit 845209Scarl# ${LD} -X /lib/fcrt0.o ${FMT} \ 855209Scarl# end no floating point unit 865209Scarl ${LD} -X /lib/crt0.o ${FMT} \ 875209Scarl -Z ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_re.o \ 885209Scarl -Z ex_vadj.o ex_vmain.o ex_voper.o ex_vwind.o ex_vops3.o\ 895209Scarl -Z ex_v.o ex_vget.o ex_vops.o ex_vops2.o ex_vput.o\ 905209Scarl -Z ex_get.o ex_io.o ex_temp.o ex_tty.o ex_unix.o ex_addr.o ex.o ex_set.o \ 915209Scarl -Z ex_put.o ex_subr.o ${TERMLIB} \ 925209Scarl -L ex_data.o ex_extern.o ${PRINTF} strings.o -lovc 93723Sroot 94485Smarka.out: ${OBJS} 955209Scarl# if no floating point unit 965209Scarl# ${LD} -X /lib/fcrt0.o -i \ 975209Scarl# end no floating point unit 98723Sroot ${LD} -X /lib/crt0.o ${FMT}\ 99812Sroot -Z ex_voper.o ex_vget.o ex_vops.o ex_vops2.o ex_vops3.o \ 1005209Scarl -Z ex_set.o ex_re.o ex_io.o ex_tty.o ex_unix.o ex.o ex_v.o \ 101723Sroot -L ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_get.o ex_temp.o\ 1025209Scarl ex_vadj.o ex_vmain.o ex_vwind.o\ 103723Sroot ex_vput.o ex_put.o ex_subr.o ${PRINTF} strings.o \ 1044331Smark ex_data.o ex_extern.o ${TERMLIB} -lovc 105485Smark 106814Srootall: a.out exrecover expreserve 107464Smark 108558Smarktags: /tmp 109558Smark ${CTAGS} -w ex.[hc] ex_*.[hc] 110558Smark 111812Sroot# ex_vars.h: 112812Sroot# csh makeoptions ${CFLAGS} 113485Smark 114464Smarkstrings.o: strings 115464Smark ${XSTR} 116485Smark ${CC} -c -S xs.c 1174297Smark# ed - <rofix xs.s 118806Sroot ${AS} -o strings.o xs.s 119485Smark rm xs.s 120464Smark 121464Smarkexrecover: exrecover.o 1225209Scarl ${CC} ${FP} ${CFLAGS} exrecover.o ex_extern.o -o exrecover 123464Smark 124485Smarkexrecover.o: exrecover.c 125464Smark ${CC} ${CFLAGS} -c -O exrecover.c 126464Smark 127485Smarkexpreserve: expreserve.o 1285209Scarl ${CC} ${FP} expreserve.o ex_extern.o -o expreserve 129464Smark 130464Smarkexpreserve.o: 131485Smark ${CC} ${CFLAGS} -c -O expreserve.c 132464Smark 133576Sbillclean: 134485Smark# If we dont have ex we cant make it so dont rm ex_vars.h 135558Smark -rm -f a.out exrecover expreserve strings core errs trace 136485Smark -rm -f *.o x*.[cs] 137464Smark 138558Smark# install a new version for testing in /usr/new 139485Smarkninstall: a.out 140558Smark -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view 141558Smark cp a.out ${DESTDIR}${NBINDIR}/ex 142485Smark# -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings 143558Smark ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi 144534Smark ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view 145558Smark chmod 1755 ${DESTDIR}${NBINDIR}/ex 146464Smark 147558Smark# install in standard place (/usr/ucb) 148485Smarkinstall: a.out exrecover expreserve 149485Smark -rm -f ${DESTDIR}${BINDIR}/ex 150485Smark -rm -f ${DESTDIR}${BINDIR}/vi 151534Smark -rm -f ${DESTDIR}${BINDIR}/view 152485Smark -rm -f ${DESTDIR}${BINDIR}/edit 153485Smark -rm -f ${DESTDIR}${BINDIR}/e 154485Smark -rm -f ${DESTDIR}/usr/bin/ex 155485Smark cp a.out ${DESTDIR}${BINDIR}/ex 156485Smark# cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings 157485Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 158485Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e 159485Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 160534Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view 161485Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex 162485Smark chmod 1755 ${DESTDIR}${BINDIR}/ex 163485Smark cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover 164558Smark cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 165485Smark chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 166558Smark# The following line normally fails. This is OK. 167485Smark mkdir ${DESTDIR}/usr/preserve 168464Smark 169558Smark# move from /usr/new to /usr/ucb 170558Smarknewucb: a.out 171558Smark -rm -f ${DESTDIR}${BINDIR}/ex 172558Smark -rm -f ${DESTDIR}${BINDIR}/vi 173558Smark -rm -f ${DESTDIR}${BINDIR}/edit 174558Smark -rm -f ${DESTDIR}${BINDIR}/e 175558Smark -rm -f ${DESTDIR}/usr/bin/ex 176558Smark mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex 177558Smark -rm -f ${DESTDIR}${NBINDIR}/vi 178558Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 179558Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e 180558Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 181558Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex 182558Smark chmod 1755 ${DESTDIR}${BINDIR}/ex 183558Smark 184464Smarklint: 185558Smark lint ${CFLAGS} ex.c ex_?*.c 186558Smark lint ${CFLAGS} -u exrecover.c 187558Smark lint ${CFLAGS} expreserve.c 188464Smark 189464Smarkprint: 190464Smark @${PR} READ* BUGS 191485Smark @${PR} makefile* 192485Smark @${PR} /etc/termcap 193464Smark @(size -l a.out ; size *.o) | ${PR} -h sizes 194464Smark @${PR} -h errno.h ${INCLUDE}/errno.h 195464Smark @${PR} -h setjmp.h ${INCLUDE}/setjmp.h 196464Smark @${PR} -h sgtty.h ${INCLUDE}/sgtty.h 197464Smark @${PR} -h signal.h ${INCLUDE}/signal.h 198464Smark @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h 199464Smark @${PR} -h sys/types.h ${INCLUDE}/sys/types.h 200464Smark @ls -ls | ${PR} 201464Smark @${CXREF} *.c | ${PR} -h XREF 202464Smark @${PR} *.h *.c 203