1534SmarkVERSION=3.4 2464Smark# 3558Smark# Ex skeletal makefile for VAX VM/Unix version 7 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 11558Smark# chdir command.) VMUNIX makes ex considerably larger, raising many limits 12558Smark# and improving speed and simplicity of maintenance. It is suitable only 13558Smark# for a VAX or other large machine, and then probably only in a paged system. 14464Smark# 15485Smark# Don't define VFORK unless your system has the VFORK system call, 16485Smark# which is like fork but the two processes have only one data space until the 17485Smark# child execs. This speeds up ex by saving the memory copy. 18485Smark# 19464Smark# If your system expands tabs to 4 spaces you should -DTABS=4 below 20464Smark# 21485SmarkBINDIR= /usr/ucb 22485SmarkNBINDIR=/usr/new 23464SmarkLIBDIR= /usr/lib 24485SmarkFOLD= ${BINDIR}/fold 25485SmarkCTAGS= ${BINDIR}/ctags 26485SmarkXSTR= ${BINDIR}/xstr 27558SmarkDEBUGFLAGS= -DTRACE -g 28558Smark# 29558Smark# D O N O T D I S T R I B U T E E X W I T H H O R S E I N I T!!! 30558SmarkNONDEBUGFLAGS= -O -DHORSE 31558SmarkDEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug 32558SmarkCFLAGS= -DTABS=8 -DLISPCODE -DCHDIR -DUCVISUAL -DVFORK -DVMUNIX ${DEB} 33558SmarkLDFLAGS= -z # or -i or -n 34485SmarkTERMLIB= -ltermlib 35485SmarkMKSTR= ${BINDIR}/mkstr 36485SmarkCXREF= ${BINDIR}/cxref 37464SmarkINCLUDE=/usr/include 38464SmarkPR= pr 39558SmarkOBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \ 40558Smark ex_data.o ex_get.o ex_io.o ex_put.o ex_re.o \ 41558Smark ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \ 42464Smark ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voperate.o \ 43464Smark ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \ 44558Smark printf.o bcopy.o horse.o strings.o 45558SmarkHDRS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h 46558SmarkSRC1= ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c 47558SmarkSRC2= ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c 48558SmarkSRC3= ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c 49558SmarkSRC4= ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voperate.c 50558SmarkSRC5= ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c 51*567SmarkSRC6= printf.c horse.c bcopy.c expreserve.c exrecover.c 52558SmarkMISC= makefile READ_ME :rofix 53558SmarkVGRIND= csh /usr/ucb/vgrind 54558SmarkVHDR= "Ex Version ${VERSION}" 55464Smark 56485Smark.c.o: 57485Smark# ${MKSTR} - ex${VERSION}strings x $*.c 58485Smark ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - 59485Smark# rm -f x$*.c 60485Smark ${CC} ${CFLAGS} -c x.c 61485Smark mv x.o $*.o 62464Smark 63485Smarka.out: ${OBJS} 64558Smark cc ${LDFLAGS} ${OBJS} ${TERMLIB} 65485Smark 66558Smarkall: a.out exrecover expreserve tags 67464Smark 68558Smarktags: /tmp 69558Smark ${CTAGS} -w ex.[hc] ex_*.[hc] 70558Smark 71485Smark${OBJS}: ex_vars.h 72485Smark 73566Smark# ex_vars.h: 74566Smark# csh makeoptions ${CFLAGS} 75485Smark 76558Smarkbcopy.o: bcopy.c 77558Smark cc -c ${CFLAGS} bcopy.c 78558Smark 79558Smark# xstr: hands off! 80464Smarkstrings.o: strings 81464Smark ${XSTR} 82485Smark ${CC} -c -S xs.c 83485Smark ed - <:rofix xs.s 84485Smark as -o strings.o xs.s 85485Smark rm xs.s 86464Smark 87464Smarkexrecover: exrecover.o 88485Smark ${CC} ${CFLAGS} exrecover.o -o exrecover 89464Smark 90485Smarkexrecover.o: exrecover.c 91464Smark ${CC} ${CFLAGS} -c -O exrecover.c 92464Smark 93485Smarkexpreserve: expreserve.o 94485Smark ${CC} expreserve.o -o expreserve 95464Smark 96464Smarkexpreserve.o: 97485Smark ${CC} ${CFLAGS} -c -O expreserve.c 98464Smark 99*567Smarksimpclean: 100485Smark# If we dont have ex we cant make it so dont rm ex_vars.h 101558Smark -rm -f a.out exrecover expreserve strings core errs trace 102485Smark -rm -f *.o x*.[cs] 103464Smark 104*567Smarkclean: simpclean 105*567Smark -rm -f ${HDRS} 106*567Smark -rm -f ${SRC1} 107*567Smark -rm -f ${SRC2} 108*567Smark -rm -f ${SRC3} 109*567Smark -rm -f ${SRC4} 110*567Smark -rm -f ${SRC5} 111*567Smark -rm -f ${SRC6} 112*567Smark 113558Smark# install a new version for testing in /usr/new 114485Smarkninstall: a.out 115558Smark -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view 116558Smark cp a.out ${DESTDIR}${NBINDIR}/ex 117485Smark# -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings 118558Smark ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi 119534Smark ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view 120558Smark chmod 1755 ${DESTDIR}${NBINDIR}/ex 121464Smark 122558Smark# install in standard place (/usr/ucb) 123485Smarkinstall: a.out exrecover expreserve 124485Smark -rm -f ${DESTDIR}${BINDIR}/ex 125485Smark -rm -f ${DESTDIR}${BINDIR}/vi 126534Smark -rm -f ${DESTDIR}${BINDIR}/view 127485Smark -rm -f ${DESTDIR}${BINDIR}/edit 128485Smark -rm -f ${DESTDIR}${BINDIR}/e 129485Smark -rm -f ${DESTDIR}/usr/bin/ex 130485Smark cp a.out ${DESTDIR}${BINDIR}/ex 131485Smark# cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings 132485Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 133485Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e 134485Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 135534Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view 136485Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex 137485Smark chmod 1755 ${DESTDIR}${BINDIR}/ex 138485Smark cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover 139558Smark cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 140485Smark chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 141558Smark# The following line normally fails. This is OK. 142485Smark mkdir ${DESTDIR}/usr/preserve 143464Smark 144558Smark# move from /usr/new to /usr/ucb 145558Smarknewucb: a.out 146558Smark -rm -f ${DESTDIR}${BINDIR}/ex 147558Smark -rm -f ${DESTDIR}${BINDIR}/vi 148558Smark -rm -f ${DESTDIR}${BINDIR}/edit 149558Smark -rm -f ${DESTDIR}${BINDIR}/e 150558Smark -rm -f ${DESTDIR}/usr/bin/ex 151558Smark mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex 152558Smark -rm -f ${DESTDIR}${NBINDIR}/vi 153558Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 154558Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e 155558Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 156558Smark ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex 157558Smark chmod 1755 ${DESTDIR}${BINDIR}/ex 158558Smark 159464Smarklint: 160558Smark lint ${CFLAGS} ex.c ex_?*.c 161558Smark lint ${CFLAGS} -u exrecover.c 162558Smark lint ${CFLAGS} expreserve.c 163464Smark 164464Smarkprint: 165464Smark @${PR} READ* BUGS 166485Smark @${PR} makefile* 167485Smark @${PR} /etc/termcap 168464Smark @(size -l a.out ; size *.o) | ${PR} -h sizes 169464Smark @${PR} -h errno.h ${INCLUDE}/errno.h 170464Smark @${PR} -h setjmp.h ${INCLUDE}/setjmp.h 171464Smark @${PR} -h sgtty.h ${INCLUDE}/sgtty.h 172464Smark @${PR} -h signal.h ${INCLUDE}/signal.h 173464Smark @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h 174464Smark @${PR} -h sys/types.h ${INCLUDE}/sys/types.h 175464Smark @ls -ls | ${PR} 176464Smark @${CXREF} *.c | ${PR} -h XREF 177464Smark @${PR} *.h *.c 178558Smarkvgrind: 179558Smark tee index < /dev/null 180558Smark# ${VGRIND} -h ${VHDR} ${HDRS} 181558Smark# ${VGRIND} -h ${VHDR} ${SRC1} 182558Smark# ${VGRIND} -h ${VHDR} ${SRC2} 183558Smark ${VGRIND} -h ${VHDR} ${SRC3} 184558Smark ${VGRIND} -h ${VHDR} ${SRC4} 185558Smark ${VGRIND} -h ${VHDR} ${SRC5} 186558Smark ${VGRIND} -h ${VHDR} ${SRC6} 187558Smark# ${VGRIND} -n -h ${VHDR} ${MISC} 188558Smark ${VGRIND} -i -h ${VHDR} index 189564Smark 190565Smarkex.c: SCCS/s.ex.c ${HDRS}; rm -f ex.c; sccs get ex.c 191565Smarkex.h: SCCS/s.ex.h; rm -f ex.h; sccs get ex.h 192565Smarkex_addr.c: SCCS/s.ex_addr.c; rm -f ex_addr.c; sccs get ex_addr.c 193565Smarkex_argv.h: SCCS/s.ex_argv.h; rm -f ex_argv.h; sccs get ex_argv.h 194565Smarkex_cmds.c: SCCS/s.ex_cmds.c; rm -f ex_cmds.c; sccs get ex_cmds.c 195565Smarkex_cmds2.c: SCCS/s.ex_cmds2.c; rm -f ex_cmds2.c; sccs get ex_cmds2.c 196565Smarkex_cmdsub.c: SCCS/s.ex_cmdsub.c; rm -f ex_cmdsub.c; sccs get ex_cmdsub.c 197565Smarkex_data.c: SCCS/s.ex_data.c; rm -f ex_data.c; sccs get ex_data.c 198565Smarkex_get.c: SCCS/s.ex_get.c; rm -f ex_get.c; sccs get ex_get.c 199565Smarkex_io.c: SCCS/s.ex_io.c; rm -f ex_io.c; sccs get ex_io.c 200565Smarkex_put.c: SCCS/s.ex_put.c; rm -f ex_put.c; sccs get ex_put.c 201565Smarkex_re.c: SCCS/s.ex_re.c; rm -f ex_re.c; sccs get ex_re.c 202565Smarkex_re.h: SCCS/s.ex_re.h; rm -f ex_re.h; sccs get ex_re.h 203565Smarkex_set.c: SCCS/s.ex_set.c; rm -f ex_set.c; sccs get ex_set.c 204565Smarkex_subr.c: SCCS/s.ex_subr.c; rm -f ex_subr.c; sccs get ex_subr.c 205565Smarkex_temp.c: SCCS/s.ex_temp.c; rm -f ex_temp.c; sccs get ex_temp.c 206565Smarkex_temp.h: SCCS/s.ex_temp.h; rm -f ex_temp.h; sccs get ex_temp.h 207565Smarkex_tty.c: SCCS/s.ex_tty.c; rm -f ex_tty.c; sccs get ex_tty.c 208565Smarkex_tty.h: SCCS/s.ex_tty.h; rm -f ex_tty.h; sccs get ex_tty.h 209565Smarkex_tune.h: SCCS/s.ex_tune.h; rm -f ex_tune.h; sccs get ex_tune.h 210564Smarkex_unix.c: SCCS/s.ex_unix.c; rm -f ex_unix.c; sccs get ex_unix.c 211565Smarkex_v.c: SCCS/s.ex_v.c; rm -f ex_v.c; sccs get ex_v.c 212565Smarkex_vadj.c: SCCS/s.ex_vadj.c; rm -f ex_vadj.c; sccs get ex_vadj.c 213565Smarkex_vars.h: SCCS/s.ex_vars.h; rm -f ex_vars.h; sccs get ex_vars.h 214565Smarkex_vget.c: SCCS/s.ex_vget.c; rm -f ex_vget.c; sccs get ex_vget.c 215565Smarkex_vis.h: SCCS/s.ex_vis.h; rm -f ex_vis.h; sccs get ex_vis.h 216565Smarkex_vmain.c: SCCS/s.ex_vmain.c; rm -f ex_vmain.c; sccs get ex_vmain.c 217564Smarkex_voperate.c: SCCS/s.ex_voperate.c; rm -f ex_voperate.c; sccs get ex_voperate.c 218565Smarkex_vops.c: SCCS/s.ex_vops.c; rm -f ex_vops.c; sccs get ex_vops.c 219565Smarkex_vops2.c: SCCS/s.ex_vops2.c; rm -f ex_vops2.c; sccs get ex_vops2.c 220565Smarkex_vops3.c: SCCS/s.ex_vops3.c; rm -f ex_vops3.c; sccs get ex_vops3.c 221565Smarkex_vput.c: SCCS/s.ex_vput.c; rm -f ex_vput.c; sccs get ex_vput.c 222565Smarkex_vwind.c: SCCS/s.ex_vwind.c; rm -f ex_vwind.c; sccs get ex_vwind.c 223565Smarkexpreserve.c: SCCS/s.expreserve.c; rm -f expreserve.c; sccs get expreserve.c 224565Smarkexrecover.c: SCCS/s.exrecover.c; rm -f exrecover.c; sccs get exrecover.c 225565Smarkmakeoptions: SCCS/s.makeoptions; rm -f makeoptions; sccs get makeoptions 226564Smarkbcopy.c: SCCS/s.bcopy.c; rm -f bcopy.c; sccs get bcopy.c 227565Smarkhorse.c: SCCS/s.horse.c; rm -f horse.c; sccs get horse.c 228565Smarkprintf.c: SCCS/s.printf.c; rm -f printf.c; sccs get printf.c 229