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