1VERSION=3.7 2# 3# Ex skeletal makefile for USG Unix 4.0 on a VAX. 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# 22BINDIR= /usr/bin 23NBINDIR=/usr/ucb/new 24LIBDIR= /usr/lib 25FOLD= ${BINDIR}/fold 26CTAGS= ctags 27XSTR= /usr/ucb/bin/xstr 28DEBUGFLAGS= -DTRACE -g 29NONDEBUGFLAGS= -O 30DEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug 31OPTIONS= -DCRYPT -DLISPCODE -DCHDIR -DUCVISUAL -DUSG3TTY -DSTDIO 32CFLAGS= -I/usr/ucb/include -DTABS=8 ${OPTIONS} ${DEB} 33LDFLAGS= -n # or -i or -z 34TERMLIB= -ltermcap 35MKSTR= /usr/ucb/bin/mkstr 36CXREF= cxref 37INCLUDE=/usr/include 38PR= pr 39OBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \ 40 ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \ 41 ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \ 42 ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \ 43 ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \ 44 printf.o bcopy.o strings.o 45HDRS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h 46SRC1= ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c 47SRC2= ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c 48SRC3= ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c 49SRC4= ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c 50SRC5= ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c 51SRC6= printf.c bcopy.c expreserve.c exrecover.c 52MISC= makefile READ_ME rofix 53VGRIND= csh /usr/ucb/vgrind 54VHDR= "Ex Version ${VERSION}" 55 56.c.o: 57# ifdef VMUNIX 58# ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - 59# else 60 ${MKSTR} - ex${VERSION}strings x $*.c 61 ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c - 62 rm -f x$*.c 63# endif 64 ${CC} ${CFLAGS} -c x.c 65 mv x.o $*.o 66 67a.out: ${OBJS} 68 ${CC} ${LDFLAGS} ${OBJS} ${TERMLIB} 69 70all:: a.out exrecover expreserve 71 72tags: /tmp 73 ${CTAGS} -w ex.[hc] ex_*.[hc] 74 75${OBJS}: ex_vars.h 76 77# ex_vars.h: 78# csh makeoptions ${CFLAGS} 79 80bcopy.o: bcopy.c 81 ${CC} -c ${CFLAGS} bcopy.c 82 83# xstr: hands off! 84strings.o: strings 85 ${XSTR} 86 ${CC} -c -S xs.c 87 ed - <rofix xs.s 88 ${AS} -o strings.o xs.s 89 rm xs.s 90 91exrecover: exrecover.o 92 ${CC} ${CFLAGS} exrecover.o ex_extern.o -o exrecover 93 94exrecover.o: exrecover.c 95 ${CC} ${CFLAGS} -c -O exrecover.c 96 97expreserve: expreserve.o 98 ${CC} expreserve.o -o expreserve 99 100expreserve.o: 101 ${CC} ${CFLAGS} -c -O expreserve.c 102 103clean: 104# If we dont have ex we cant make it so dont rm ex_vars.h 105 -rm -f a.out exrecover expreserve strings core errs trace 106 -rm -f *.o x*.[cs] 107 108# install a new version for testing in /usr/new 109ninstall: a.out 110 -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view 111 cp a.out ${DESTDIR}${NBINDIR}/ex 112# -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings 113 ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi 114 ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view 115 chmod 1755 ${DESTDIR}${NBINDIR}/ex 116 117# install in standard place (/usr/ucb) 118install: a.out exrecover expreserve 119 -strip a.out 120 -rm -f ${DESTDIR}${BINDIR}/ex 121 -rm -f ${DESTDIR}${BINDIR}/vi 122 -rm -f ${DESTDIR}${BINDIR}/view 123 -rm -f ${DESTDIR}${BINDIR}/edit 124 cp a.out ${DESTDIR}${BINDIR}/ex 125 cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings 126 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 127 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 128 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view 129 chmod 1755 ${DESTDIR}${BINDIR}/ex 130 cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover 131 cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 132 chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 133# The following line normally fails. This is OK. 134 -mkdir ${DESTDIR}/usr/preserve 135 136# move from /usr/new to /usr/ucb 137newucb: a.out 138 -rm -f ${DESTDIR}${BINDIR}/ex 139 -rm -f ${DESTDIR}${BINDIR}/vi 140 -rm -f ${DESTDIR}${BINDIR}/edit 141 -rm -f ${DESTDIR}${BINDIR}/e 142 -rm -f ${DESTDIR}/usr/bin/ex 143 mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex 144 -rm -f ${DESTDIR}${NBINDIR}/vi 145 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 146 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e 147 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 148 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex 149 chmod 1755 ${DESTDIR}${BINDIR}/ex 150 151lint: 152 lint ${CFLAGS} ex.c ex_?*.c 153 lint ${CFLAGS} -u exrecover.c 154 lint ${CFLAGS} expreserve.c 155 156print: 157 @${PR} READ* BUGS 158 @${PR} makefile* 159 @${PR} /etc/termcap 160 @(size -l a.out ; size *.o) | ${PR} -h sizes 161 @${PR} -h errno.h ${INCLUDE}/errno.h 162 @${PR} -h setjmp.h ${INCLUDE}/setjmp.h 163 @${PR} -h sgtty.h ${INCLUDE}/sgtty.h 164 @${PR} -h signal.h ${INCLUDE}/signal.h 165 @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h 166 @${PR} -h sys/types.h ${INCLUDE}/sys/types.h 167 @ls -ls | ${PR} 168 @${CXREF} *.c | ${PR} -h XREF 169 @${PR} *.h *.c 170vgrind: 171 tee index < /dev/null 172 ${VGRIND} -h ${VHDR} ${HDRS} 173 ${VGRIND} -h ${VHDR} ${SRC1} 174 ${VGRIND} -h ${VHDR} ${SRC2} 175 ${VGRIND} -h ${VHDR} ${SRC3} 176 ${VGRIND} -h ${VHDR} ${SRC4} 177 ${VGRIND} -h ${VHDR} ${SRC5} 178 ${VGRIND} -h ${VHDR} ${SRC6} 179 ${VGRIND} -n -h ${VHDR} ${MISC} 180 ${VGRIND} -i -h ${VHDR} index 181