14301SmarkVERSION=3.7 24301Smark# 34301Smark# Ex skeletal makefile for USG Unix 4.0 on a VAX. 44301Smark# 54301Smark# NB: This makefile doesn't indicate any dependencies on header files. 64301Smark# 74301Smark# Ex is very large - this version will not fit on PDP-11's without overlay 84301Smark# software. Things that can be turned off to save 94301Smark# space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL 104301Smark# (visual \ nonsense on upper case only terminals), CHDIR (the undocumented 114301Smark# chdir command.) CRYPT includes the code to edit encrypted files (the -x 124301Smark# option, like ed.) VMUNIX makes ex considerably larger, raising many limits 134301Smark# and improving speed and simplicity of maintenance. It is suitable only 144301Smark# for a VAX or other large machine, and then probably only in a paged system. 154301Smark# 164301Smark# Don't define VFORK unless your system has the VFORK system call, 174301Smark# which is like fork but the two processes have only one data space until the 184301Smark# child execs. This speeds up ex by saving the memory copy. 194301Smark# 204301Smark# If your system expands tabs to 4 spaces you should -DTABS=4 below 214301Smark# 224301SmarkBINDIR= /usr/bin 234301SmarkNBINDIR=/usr/ucb/new 244301SmarkLIBDIR= /usr/lib 254301SmarkFOLD= ${BINDIR}/fold 264301SmarkCTAGS= ctags 274301SmarkXSTR= /usr/ucb/bin/xstr 284301SmarkDEBUGFLAGS= -DTRACE -g 294301SmarkNONDEBUGFLAGS= -O 304301SmarkDEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug 314301SmarkOPTIONS= -DCRYPT -DLISPCODE -DCHDIR -DUCVISUAL -DUSG3TTY -DSTDIO 324301SmarkCFLAGS= -I/usr/ucb/include -DTABS=8 ${OPTIONS} ${DEB} 334301SmarkLDFLAGS= -n # or -i or -z 344301SmarkTERMLIB= -ltermcap 354301SmarkMKSTR= /usr/ucb/bin/mkstr 364301SmarkCXREF= cxref 374301SmarkINCLUDE=/usr/include 384301SmarkPR= pr 394301SmarkOBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \ 404301Smark ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \ 414301Smark ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \ 424301Smark ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \ 434301Smark ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \ 444301Smark printf.o bcopy.o strings.o 454301SmarkHDRS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h 464301SmarkSRC1= ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c 474301SmarkSRC2= ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c 484301SmarkSRC3= ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c 494301SmarkSRC4= ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c 504301SmarkSRC5= ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c 514301SmarkSRC6= printf.c bcopy.c expreserve.c exrecover.c 524301SmarkMISC= makefile READ_ME rofix 534301SmarkVGRIND= csh /usr/ucb/vgrind 544301SmarkVHDR= "Ex Version ${VERSION}" 554301Smark 564301Smark.c.o: 574301Smark# ifdef VMUNIX 584301Smark# ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - 594301Smark# else 604301Smark ${MKSTR} - ex${VERSION}strings x $*.c 614301Smark ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c - 624301Smark rm -f x$*.c 634301Smark# endif 644301Smark ${CC} ${CFLAGS} -c x.c 654301Smark mv x.o $*.o 664301Smark 674301Smarka.out: ${OBJS} 684301Smark ${CC} ${LDFLAGS} ${OBJS} ${TERMLIB} 694301Smark 704301Smarkall:: a.out exrecover expreserve 714301Smark 724301Smarktags: /tmp 734301Smark ${CTAGS} -w ex.[hc] ex_*.[hc] 744301Smark 754301Smark${OBJS}: ex_vars.h 764301Smark 774301Smark# ex_vars.h: 784301Smark# csh makeoptions ${CFLAGS} 794301Smark 804301Smarkbcopy.o: bcopy.c 814301Smark ${CC} -c ${CFLAGS} bcopy.c 824301Smark 834301Smark# xstr: hands off! 844301Smarkstrings.o: strings 854301Smark ${XSTR} 864301Smark ${CC} -c -S xs.c 874301Smark ed - <rofix xs.s 884301Smark ${AS} -o strings.o xs.s 894301Smark rm xs.s 904301Smark 914301Smarkexrecover: exrecover.o 924301Smark ${CC} ${CFLAGS} exrecover.o ex_extern.o -o exrecover 934301Smark 944301Smarkexrecover.o: exrecover.c 954301Smark ${CC} ${CFLAGS} -c -O exrecover.c 964301Smark 974301Smarkexpreserve: expreserve.o 98*4523Smark ${CC} expreserve.o -o expreserve 994301Smark 1004301Smarkexpreserve.o: 1014301Smark ${CC} ${CFLAGS} -c -O expreserve.c 1024301Smark 1034301Smarkclean: 1044301Smark# If we dont have ex we cant make it so dont rm ex_vars.h 1054301Smark -rm -f a.out exrecover expreserve strings core errs trace 1064301Smark -rm -f *.o x*.[cs] 1074301Smark 1084301Smark# install a new version for testing in /usr/new 1094301Smarkninstall: a.out 1104301Smark -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view 1114301Smark cp a.out ${DESTDIR}${NBINDIR}/ex 1124301Smark# -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings 1134301Smark ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi 1144301Smark ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view 1154301Smark chmod 1755 ${DESTDIR}${NBINDIR}/ex 1164301Smark 1174301Smark# install in standard place (/usr/ucb) 1184301Smarkinstall: a.out exrecover expreserve 1194301Smark -strip a.out 1204301Smark -rm -f ${DESTDIR}${BINDIR}/ex 1214301Smark -rm -f ${DESTDIR}${BINDIR}/vi 1224301Smark -rm -f ${DESTDIR}${BINDIR}/view 1234301Smark -rm -f ${DESTDIR}${BINDIR}/edit 1244301Smark cp a.out ${DESTDIR}${BINDIR}/ex 1254301Smark cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings 1264301Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 1274301Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 1284301Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view 1294301Smark chmod 1755 ${DESTDIR}${BINDIR}/ex 1304301Smark cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover 1314301Smark cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 1324301Smark chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 1334301Smark# The following line normally fails. This is OK. 1344301Smark -mkdir ${DESTDIR}/usr/preserve 1354301Smark 1364301Smark# move from /usr/new to /usr/ucb 1374301Smarknewucb: a.out 1384301Smark -rm -f ${DESTDIR}${BINDIR}/ex 1394301Smark -rm -f ${DESTDIR}${BINDIR}/vi 1404301Smark -rm -f ${DESTDIR}${BINDIR}/edit 1414301Smark -rm -f ${DESTDIR}${BINDIR}/e 1424301Smark -rm -f ${DESTDIR}/usr/bin/ex 1434301Smark mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex 1444301Smark -rm -f ${DESTDIR}${NBINDIR}/vi 1454301Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 1464301Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e 1474301Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 1484301Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex 1494301Smark chmod 1755 ${DESTDIR}${BINDIR}/ex 1504301Smark 1514301Smarklint: 1524301Smark lint ${CFLAGS} ex.c ex_?*.c 1534301Smark lint ${CFLAGS} -u exrecover.c 1544301Smark lint ${CFLAGS} expreserve.c 1554301Smark 1564301Smarkprint: 1574301Smark @${PR} READ* BUGS 1584301Smark @${PR} makefile* 1594301Smark @${PR} /etc/termcap 1604301Smark @(size -l a.out ; size *.o) | ${PR} -h sizes 1614301Smark @${PR} -h errno.h ${INCLUDE}/errno.h 1624301Smark @${PR} -h setjmp.h ${INCLUDE}/setjmp.h 1634301Smark @${PR} -h sgtty.h ${INCLUDE}/sgtty.h 1644301Smark @${PR} -h signal.h ${INCLUDE}/signal.h 1654301Smark @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h 1664301Smark @${PR} -h sys/types.h ${INCLUDE}/sys/types.h 1674301Smark @ls -ls | ${PR} 1684301Smark @${CXREF} *.c | ${PR} -h XREF 1694301Smark @${PR} *.h *.c 1704301Smarkvgrind: 1714301Smark tee index < /dev/null 1724301Smark ${VGRIND} -h ${VHDR} ${HDRS} 1734301Smark ${VGRIND} -h ${VHDR} ${SRC1} 1744301Smark ${VGRIND} -h ${VHDR} ${SRC2} 1754301Smark ${VGRIND} -h ${VHDR} ${SRC3} 1764301Smark ${VGRIND} -h ${VHDR} ${SRC4} 1774301Smark ${VGRIND} -h ${VHDR} ${SRC5} 1784301Smark ${VGRIND} -h ${VHDR} ${SRC6} 1794301Smark ${VGRIND} -n -h ${VHDR} ${MISC} 1804301Smark ${VGRIND} -i -h ${VHDR} index 181