1*4297SmarkVERSION=3.7 2464Smark# 3723Sroot# Ex skeletal makefile for version 7, USGS Overlay 11/70 system 4464Smark# 5464Smark# NB: This makefile doesn't indicate any dependencies on header files. 6464Smark# 7558Smark# Ex is very large - this version will not fit on PDP-11's without overlay 8558Smark# software. Things that can be turned off to save 9485Smark# space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL 10485Smark# (visual \ nonsense on upper case only terminals), CHDIR (the undocumented 11723Sroot# chdir command.) CRYPT includes code to handle the -x option to allow 121634Smark# encrypted files. Defining CRYPT drags in most of stdio (from the call 131634Smark# to getpass) and makes vi about 4k text and 4k data bigger). 141634Smark# VMUNIX makes ex considerably larger, raising many limits 15558Smark# and improving speed and simplicity of maintenance. It is suitable only 16558Smark# for a VAX or other large machine, and then probably only in a paged system. 17464Smark# 18485Smark# Don't define VFORK unless your system has the VFORK system call, 19485Smark# which is like fork but the two processes have only one data space until the 20485Smark# child execs. This speeds up ex by saving the memory copy. 21485Smark# 22464Smark# If your system expands tabs to 4 spaces you should -DTABS=4 below 23464Smark# 24723SrootBINDIR= /usr/ucb/bin 25723SrootNBINDIR=/usr/new/bin 26806SrootLIBDIR= /usr/ucb/lib 27485SmarkFOLD= ${BINDIR}/fold 28485SmarkCTAGS= ${BINDIR}/ctags 29485SmarkXSTR= ${BINDIR}/xstr 30875SmarkCC= cc -V 31806SrootAS= ovas 32723SrootLD= ovld 33723SrootDEBUGFLAGS= -DTRACE 34681SmarkNONDEBUGFLAGS= -O 35558SmarkDEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug 36723SrootCFLAGS= -DTABS=8 -DLISPCODE -DCHDIR -DUCVISUAL ${DEB} 37723SrootTERMLIB= -lovtermlib 38485SmarkMKSTR= ${BINDIR}/mkstr 39485SmarkCXREF= ${BINDIR}/cxref 40812Sroot# PRINTF= printf.o; PRINTFS=printf.c 41723SrootPRINTF= ovprintf.o ovdoprnt.o 42812SrootPRINTFS=ovprintf.c ovdoprnt.s 43723SrootFMT= -i # 11/45, 70 44723Sroot# FMT= -n # 11/23, 34, 40 45464SmarkINCLUDE=/usr/include 46464SmarkPR= pr 47812SrootGET= sccs get 48558SmarkOBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \ 49558Smark ex_data.o ex_get.o ex_io.o ex_put.o ex_re.o \ 50558Smark ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \ 51812Sroot ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \ 52464Smark ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \ 53723Sroot ${PRINTF} bcopy.o strings.o 54812SrootSRCS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h\ 55812Sroot ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c \ 56812Sroot ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c \ 57812Sroot ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c \ 58812Sroot ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c \ 59812Sroot ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c \ 60813Sroot ${PRINTFS} bcopy.c 61464Smark 62485Smark.c.o: 63723Sroot ${MKSTR} - ex${VERSION}strings x $*.c 64723Sroot ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c - 65723Sroot rm -f x$*.c 66485Smark ${CC} ${CFLAGS} -c x.c 67485Smark mv x.o $*.o 68464Smark 69723Sroot# 11/23, 34, 40 and other non split I/D machines 70723Sroot# each of the 5 overlays must stay less than 16K. 71723Sroot# a.out: ${OBJS} 72723Sroot# ${LD} -X /lib/crt0.o ${FMT}\ 73723Sroot# -Z ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_re.o \ 74812Sroot# -Z ex_vadj.o ex_vmain.o ex_voper.o ex_vwind.o ex_vops3.o\ 75723Sroot# -Z ex_v.o ex_vget.o ex_vops.o ex_vops2.o ex_vput.o\ 76723Sroot# -Z ex_get.o ex_io.o ex_temp.o ex_tty.o ex_unix.o ex_addr.o ex.o ex_set.o \ 77723Sroot# -L ex_put.o ex_subr.o ${PRINTF} strings.o \ 78723Sroot# ex_data.o ${TERMLIB} -lovc 79723Sroot 80485Smarka.out: ${OBJS} 81723Sroot ${LD} -X /lib/crt0.o ${FMT}\ 82812Sroot -Z ex_voper.o ex_vget.o ex_vops.o ex_vops2.o ex_vops3.o \ 83806Sroot -Z ex_set.o ex_re.o ex_io.o ex_tty.o ex_unix.o ex.o\ 84723Sroot -L ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_get.o ex_temp.o\ 85806Sroot ex_v.o ex_vadj.o ex_vmain.o ex_vwind.o\ 86723Sroot ex_vput.o ex_put.o ex_subr.o ${PRINTF} strings.o \ 87723Sroot ex_data.o ${TERMLIB} -lovc 88485Smark 89814Srootall: a.out exrecover expreserve 90464Smark 91558Smarktags: /tmp 92558Smark ${CTAGS} -w ex.[hc] ex_*.[hc] 93558Smark 94812Sroot# ex_vars.h: 95812Sroot# csh makeoptions ${CFLAGS} 96485Smark 97464Smarkstrings.o: strings 98464Smark ${XSTR} 99485Smark ${CC} -c -S xs.c 100*4297Smark# ed - <rofix xs.s 101806Sroot ${AS} -o strings.o xs.s 102485Smark rm xs.s 103464Smark 104464Smarkexrecover: exrecover.o 105485Smark ${CC} ${CFLAGS} exrecover.o -o exrecover 106464Smark 107485Smarkexrecover.o: exrecover.c 108464Smark ${CC} ${CFLAGS} -c -O exrecover.c 109464Smark 110485Smarkexpreserve: expreserve.o 111485Smark ${CC} expreserve.o -o expreserve 112464Smark 113464Smarkexpreserve.o: 114485Smark ${CC} ${CFLAGS} -c -O expreserve.c 115464Smark 116576Sbillclean: 117485Smark# If we dont have ex we cant make it so dont rm ex_vars.h 118558Smark -rm -f a.out exrecover expreserve strings core errs trace 119485Smark -rm -f *.o x*.[cs] 120464Smark 121558Smark# install a new version for testing in /usr/new 122485Smarkninstall: a.out 123558Smark -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view 124558Smark cp a.out ${DESTDIR}${NBINDIR}/ex 125485Smark# -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings 126558Smark ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi 127534Smark ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view 128558Smark chmod 1755 ${DESTDIR}${NBINDIR}/ex 129464Smark 130558Smark# install in standard place (/usr/ucb) 131485Smarkinstall: a.out exrecover expreserve 132485Smark -rm -f ${DESTDIR}${BINDIR}/ex 133485Smark -rm -f ${DESTDIR}${BINDIR}/vi 134534Smark -rm -f ${DESTDIR}${BINDIR}/view 135485Smark -rm -f ${DESTDIR}${BINDIR}/edit 136485Smark -rm -f ${DESTDIR}${BINDIR}/e 137485Smark -rm -f ${DESTDIR}/usr/bin/ex 138485Smark cp a.out ${DESTDIR}${BINDIR}/ex 139485Smark# cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings 140485Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 141485Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e 142485Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 143534Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view 144485Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex 145485Smark chmod 1755 ${DESTDIR}${BINDIR}/ex 146485Smark cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover 147558Smark cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 148485Smark chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 149558Smark# The following line normally fails. This is OK. 150485Smark mkdir ${DESTDIR}/usr/preserve 151464Smark 152558Smark# move from /usr/new to /usr/ucb 153558Smarknewucb: a.out 154558Smark -rm -f ${DESTDIR}${BINDIR}/ex 155558Smark -rm -f ${DESTDIR}${BINDIR}/vi 156558Smark -rm -f ${DESTDIR}${BINDIR}/edit 157558Smark -rm -f ${DESTDIR}${BINDIR}/e 158558Smark -rm -f ${DESTDIR}/usr/bin/ex 159558Smark mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex 160558Smark -rm -f ${DESTDIR}${NBINDIR}/vi 161558Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 162558Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e 163558Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 164558Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex 165558Smark chmod 1755 ${DESTDIR}${BINDIR}/ex 166558Smark 167464Smarklint: 168558Smark lint ${CFLAGS} ex.c ex_?*.c 169558Smark lint ${CFLAGS} -u exrecover.c 170558Smark lint ${CFLAGS} expreserve.c 171464Smark 172464Smarkprint: 173464Smark @${PR} READ* BUGS 174485Smark @${PR} makefile* 175485Smark @${PR} /etc/termcap 176464Smark @(size -l a.out ; size *.o) | ${PR} -h sizes 177464Smark @${PR} -h errno.h ${INCLUDE}/errno.h 178464Smark @${PR} -h setjmp.h ${INCLUDE}/setjmp.h 179464Smark @${PR} -h sgtty.h ${INCLUDE}/sgtty.h 180464Smark @${PR} -h signal.h ${INCLUDE}/signal.h 181464Smark @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h 182464Smark @${PR} -h sys/types.h ${INCLUDE}/sys/types.h 183464Smark @ls -ls | ${PR} 184464Smark @${CXREF} *.c | ${PR} -h XREF 185464Smark @${PR} *.h *.c 186