| 1 | VERSION=3.6 |
| 2 | # |
| 3 | # Ex skeletal makefile for VAX VM/Unix version 7 |
| 4 | # |
| 5 | # NB: This makefile doesn't indicate any dependencies on header files. |
| 6 | # |
| 7 | # Ex is very large - this version will not fit on PDP-11's without overlay |
| 8 | # software. Things that can be turned off to save |
| 9 | # space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL |
| 10 | # (visual \ nonsense on upper case only terminals), CHDIR (the undocumented |
| 11 | # chdir command.) CRYPT includes the code to edit encrypted files (the -x |
| 12 | # option, like ed.) VMUNIX makes ex considerably larger, raising many limits |
| 13 | # and improving speed and simplicity of maintenance. It is suitable only |
| 14 | # for a VAX or other large machine, and then probably only in a paged system. |
| 15 | # |
| 16 | # Don't define VFORK unless your system has the VFORK system call, |
| 17 | # which is like fork but the two processes have only one data space until the |
| 18 | # child execs. This speeds up ex by saving the memory copy. |
| 19 | # |
| 20 | # If your system expands tabs to 4 spaces you should -DTABS=4 below |
| 21 | # |
| 22 | BINDIR= /usr/ucb |
| 23 | NBINDIR=/usr/new |
| 24 | LIBDIR= /usr/lib |
| 25 | FOLD= ${BINDIR}/fold |
| 26 | CTAGS= ${BINDIR}/ctags |
| 27 | XSTR= ${BINDIR}/xstr |
| 28 | DEBUGFLAGS= -DMDEBUG -DTRACE -g |
| 29 | NONDEBUGFLAGS= -O |
| 30 | DEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug |
| 31 | # NOTE: TIMEBOMB is NOT intended for production use, or even to |
| 32 | # get off our vax. It is there to help nail a bug that happens rarely. |
| 33 | CFLAGS= -DTABS=8 -DCRYPT -DLISPCODE -DCHDIR -DUCVISUAL -DVFORK -DVMUNIX -DTIMEBOMB ${DEB} |
| 34 | LDFLAGS= -z # or -i or -n |
| 35 | TERMLIB= -ltermcap |
| 36 | MKSTR= ${BINDIR}/mkstr |
| 37 | CXREF= ${BINDIR}/cxref |
| 38 | INCLUDE=/usr/include |
| 39 | PR= pr |
| 40 | OBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \ |
| 41 | ex_data.o ex_get.o ex_io.o ex_put.o ex_re.o \ |
| 42 | ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \ |
| 43 | ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \ |
| 44 | ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \ |
| 45 | printf.o bcopy.o strings.o |
| 46 | HDRS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h |
| 47 | SRC1= ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c |
| 48 | SRC2= ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c |
| 49 | SRC3= ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c |
| 50 | SRC4= ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c |
| 51 | SRC5= ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c |
| 52 | SRC6= printf.c bcopy.c expreserve.c exrecover.c |
| 53 | MISC= makefile READ_ME :rofix |
| 54 | VGRIND= csh /usr/ucb/vgrind |
| 55 | VHDR= "Ex Version ${VERSION}" |
| 56 | |
| 57 | .c.o: |
| 58 | # ifdef VMUNIX |
| 59 | ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - |
| 60 | # else |
| 61 | # ${MKSTR} - ex${VERSION}strings x $*.c |
| 62 | # ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c - |
| 63 | # rm -f x$*.c |
| 64 | # endif |
| 65 | ${CC} ${CFLAGS} -c x.c |
| 66 | mv x.o $*.o |
| 67 | |
| 68 | a.out: ${OBJS} |
| 69 | ${CC} ${LDFLAGS} ${OBJS} ${TERMLIB} |
| 70 | |
| 71 | all: a.out exrecover expreserve tags |
| 72 | |
| 73 | tags: /tmp |
| 74 | ${CTAGS} -w ex.[hc] ex_*.[hc] |
| 75 | |
| 76 | ${OBJS}: ex_vars.h |
| 77 | |
| 78 | # ex_vars.h: |
| 79 | # csh makeoptions ${CFLAGS} |
| 80 | |
| 81 | bcopy.o: bcopy.c |
| 82 | ${CC} -c ${CFLAGS} bcopy.c |
| 83 | |
| 84 | # xstr: hands off! |
| 85 | strings.o: strings |
| 86 | ${XSTR} |
| 87 | ${CC} -c -S xs.c |
| 88 | ed - <:rofix xs.s |
| 89 | ${AS} -o strings.o xs.s |
| 90 | rm xs.s |
| 91 | |
| 92 | exrecover: exrecover.o |
| 93 | ${CC} ${CFLAGS} exrecover.o -o exrecover |
| 94 | |
| 95 | exrecover.o: exrecover.c |
| 96 | ${CC} ${CFLAGS} -c -O exrecover.c |
| 97 | |
| 98 | expreserve: expreserve.o |
| 99 | ${CC} expreserve.o -o expreserve |
| 100 | |
| 101 | expreserve.o: |
| 102 | ${CC} ${CFLAGS} -c -O expreserve.c |
| 103 | |
| 104 | clean: |
| 105 | # If we dont have ex we cant make it so dont rm ex_vars.h |
| 106 | -rm -f a.out exrecover expreserve strings core errs trace |
| 107 | -rm -f *.o x*.[cs] |
| 108 | |
| 109 | # install a new version for testing in /usr/new |
| 110 | ninstall: a.out |
| 111 | -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view |
| 112 | cp a.out ${DESTDIR}${NBINDIR}/ex |
| 113 | # -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings |
| 114 | ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi |
| 115 | ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view |
| 116 | chmod 1755 ${DESTDIR}${NBINDIR}/ex |
| 117 | |
| 118 | # install in standard place (/usr/ucb) |
| 119 | install: a.out exrecover expreserve |
| 120 | strip a.out |
| 121 | -rm -f ${DESTDIR}${BINDIR}/ex |
| 122 | -rm -f ${DESTDIR}${BINDIR}/vi |
| 123 | -rm -f ${DESTDIR}${BINDIR}/view |
| 124 | -rm -f ${DESTDIR}${BINDIR}/edit |
| 125 | -rm -f ${DESTDIR}${BINDIR}/e |
| 126 | -rm -f ${DESTDIR}/usr/bin/ex |
| 127 | cp a.out ${DESTDIR}${BINDIR}/ex |
| 128 | # cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings |
| 129 | ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit |
| 130 | ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e |
| 131 | ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi |
| 132 | ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view |
| 133 | ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex |
| 134 | chmod 1755 ${DESTDIR}${BINDIR}/ex |
| 135 | cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover |
| 136 | cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve |
| 137 | chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve |
| 138 | # The following line normally fails. This is OK. |
| 139 | -mkdir ${DESTDIR}/usr/preserve |
| 140 | |
| 141 | # move from /usr/new to /usr/ucb |
| 142 | newucb: a.out |
| 143 | -rm -f ${DESTDIR}${BINDIR}/ex |
| 144 | -rm -f ${DESTDIR}${BINDIR}/vi |
| 145 | -rm -f ${DESTDIR}${BINDIR}/edit |
| 146 | -rm -f ${DESTDIR}${BINDIR}/e |
| 147 | -rm -f ${DESTDIR}/usr/bin/ex |
| 148 | mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex |
| 149 | -rm -f ${DESTDIR}${NBINDIR}/vi |
| 150 | ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit |
| 151 | ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e |
| 152 | ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi |
| 153 | ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex |
| 154 | chmod 1755 ${DESTDIR}${BINDIR}/ex |
| 155 | |
| 156 | lint: |
| 157 | lint ${CFLAGS} ex.c ex_?*.c |
| 158 | lint ${CFLAGS} -u exrecover.c |
| 159 | lint ${CFLAGS} expreserve.c |
| 160 | |
| 161 | print: |
| 162 | @${PR} READ* BUGS |
| 163 | @${PR} makefile* |
| 164 | @${PR} /etc/termcap |
| 165 | @(size -l a.out ; size *.o) | ${PR} -h sizes |
| 166 | @${PR} -h errno.h ${INCLUDE}/errno.h |
| 167 | @${PR} -h setjmp.h ${INCLUDE}/setjmp.h |
| 168 | @${PR} -h sgtty.h ${INCLUDE}/sgtty.h |
| 169 | @${PR} -h signal.h ${INCLUDE}/signal.h |
| 170 | @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h |
| 171 | @${PR} -h sys/types.h ${INCLUDE}/sys/types.h |
| 172 | @ls -ls | ${PR} |
| 173 | @${CXREF} *.c | ${PR} -h XREF |
| 174 | @${PR} *.h *.c |
| 175 | vgrind: |
| 176 | tee index < /dev/null |
| 177 | ${VGRIND} -h ${VHDR} ${HDRS} |
| 178 | ${VGRIND} -h ${VHDR} ${SRC1} |
| 179 | ${VGRIND} -h ${VHDR} ${SRC2} |
| 180 | ${VGRIND} -h ${VHDR} ${SRC3} |
| 181 | ${VGRIND} -h ${VHDR} ${SRC4} |
| 182 | ${VGRIND} -h ${VHDR} ${SRC5} |
| 183 | ${VGRIND} -h ${VHDR} ${SRC6} |
| 184 | ${VGRIND} -n -h ${VHDR} ${MISC} |
| 185 | ${VGRIND} -i -h ${VHDR} index |