1#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.4 */ 2# 3# CDDL HEADER START 4# 5# The contents of this file are subject to the terms of the 6# Common Development and Distribution License, Version 1.0 only 7# (the "License"). You may not use this file except in compliance 8# with the License. 9# 10# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 11# or http://www.opensolaris.org/os/licensing. 12# See the License for the specific language governing permissions 13# and limitations under the License. 14# 15# When distributing Covered Code, include this CDDL HEADER in each 16# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 17# If applicable, add the following below this CDDL HEADER, with the 18# fields enclosed by brackets "[]" replaced with your own identifying 19# information: Portions Copyright [yyyy] [name of copyright owner] 20# 21# CDDL HEADER END 22# 23VERSION=3.9 24# 25# Ex skeletal makefile for BBN's C/70. 26# 27# NB: This makefile doesn't indicate any dependencies on header files. 28# 29# Ex is very large - this version will not fit on PDP-11's without overlay 30# software. Things that can be turned off to save 31# space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL 32# (visual \ nonsense on upper case only terminals), CHDIR (the undocumented 33# chdir command.) CRYPT includes the code to edit encrypted files (the -x 34# option, like ed.) VMUNIX makes ex considerably larger, raising many limits 35# and improving speed and simplicity of maintenance. It is suitable only 36# for a VAX or other large machine, and then probably only in a paged system. 37# 38# Don't define VFORK unless your system has the VFORK system call, 39# which is like fork but the two processes have only one data space until the 40# child execs. This speeds up ex by saving the memory copy. 41# 42# If your system expands tabs to 4 spaces you should -DTABS=4 below 43# 44BINDIR= /usr/bin 45NBINDIR=/usr/lbin 46LIBDIR= /usr/lib 47FOLD= ../misc/fold 48CTAGS= ../misc/ctags 49XSTR= ../misc/xstr 50DEBUGFLAGS= -DTRACE -g 51NONDEBUGFLAGS= -O 52DEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug 53OPTIONS= -DCRYPT 54CFLAGS= -DTABS=8 -DSINGLE -I${INCLUDE} ${OPTIONS} ${DEB} 55LDFLAGS= -n # or -i or -z 56TERMLIB= -lcurses 57MKSTR= ../misc/mkstr 58CXREF= ../misc/cxref 59INCLUDE=/usr/include 60PR= pr 61OBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \ 62 ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \ 63 ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \ 64 ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \ 65 ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \ 66 printf.o bcopy.o strings.o 67ASFIX= ex_cmdsub.o ex_io.o ex_subr.o ex_temp.o ex_vmain.o ex_voper.o \ 68 ex_vops.o ex_vops3.o ex_vwind.o 69HDRS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h 70SRC1= ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c 71SRC2= ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c 72SRC3= ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c 73SRC4= ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c 74SRC5= ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c 75SRC6= printf.c bcopy.c expreserve.c exrecover.c 76MISC= makefile READ_ME rofix 77VGRIND= csh /usr/ucb/vgrind 78VHDR= "Ex Version ${VERSION}" 79 80.c.o: 81# ifdef VMUNIX 82# ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - 83# else 84 ${MKSTR} - ex${VERSION}strings x $*.c 85 ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c - 86 rm -f x$*.c 87# endif 88 ${CC} ${CFLAGS} -c x.c 89 mv x.o $*.o 90 91a.out: ${OBJS} 92 ${CC} ${LDFLAGS} -o a.out ${OBJS} ${TERMLIB} 93 94all: a.out exrecover expreserve tags 95 96tags: /tmp 97 ${CTAGS} -w ex.[hc] ex_*.[hc] 98 99${OBJS}: ex_vars.h 100 101# ex_vars.h: 102# csh makeoptions ${CFLAGS} 103 104bcopy.o: bcopy.c 105 ${CC} -c ${CFLAGS} bcopy.c 106 107# The following can be deleted when the C70 compiler is 108# fixed to do pointer subtraction correctly. 109 110${ASFIX}: ex_vars.h ex_vis.h 111 ${MKSTR} - ex${VERSION}strings x $*.c 112 ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c - 113 rm -f x$*.c 114 ${CC} ${CFLAGS} -c -S x.c 115 ed - <asfix.c70 x.s 116 ${CC} -c x.s 117 mv x.o $*.o 118 rm x.s 119 120# xstr: hands off! 121strings.o: strings 122 ${XSTR} 123 ${CC} -c -S xs.c 124 ed - <rofix xs.s 125 ${AS} -o strings.o xs.s 126 rm xs.s 127 128exrecover: exrecover.o 129 ${CC} ${CFLAGS} exrecover.o ex_extern.o -o exrecover 130 131exrecover.o: exrecover.c 132 ${CC} ${CFLAGS} -c -O exrecover.c 133 134expreserve: expreserve.o 135 ${CC} expreserve.o -o expreserve 136 137expreserve.o: 138 ${CC} ${CFLAGS} -c -O expreserve.c 139 140clean: 141# If we dont have ex we cant make it so dont rm ex_vars.h 142 -rm -f a.out exrecover expreserve strings core errs trace 143 -rm -f *.o x*.[cs] 144 145# install a new version for testing in /usr/lbin 146ninstall: a.out 147 -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view ${DESTDIR}${NBINDIR}/vedit 148 cp a.out ${DESTDIR}${NBINDIR}/ex 149# -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings 150 ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi 151 ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view 152 ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vedit 153 chmod 1755 ${DESTDIR}${NBINDIR}/ex 154 155# install in standard place (/usr/bin) 156install: a.out exrecover expreserve 157 strip a.out 158 -rm -f ${DESTDIR}${BINDIR}/ex 159 -rm -f ${DESTDIR}${BINDIR}/vi 160 -rm -f ${DESTDIR}${BINDIR}/view 161 -rm -f ${DESTDIR}${BINDIR}/vedit 162 -rm -f ${DESTDIR}${BINDIR}/edit 163 -rm -f ${DESTDIR}${BINDIR}/e 164 -rm -f ${DESTDIR}/usr/bin/ex 165 cp a.out ${DESTDIR}${BINDIR}/ex 166# cp ex${VERSION}strings ${DESTDIR}${LIBDIR}/ex${VERSION}strings 167 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 168 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e 169 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 170 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view 171 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vedit 172 -ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex 173 chmod 1755 ${DESTDIR}${BINDIR}/ex 174 cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover 175 cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 176 chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 177# The following line normally fails. This is OK. 178 -mkdir ${DESTDIR}/usr/preserve 179 180# move from /usr/lbin to /usr/bin 181newucb: a.out 182 -rm -f ${DESTDIR}${BINDIR}/ex 183 -rm -f ${DESTDIR}${BINDIR}/vi 184 -rm -f ${DESTDIR}${BINDIR}/edit 185 -rm -f ${DESTDIR}${BINDIR}/e 186 -rm -f ${DESTDIR}/usr/bin/ex 187 mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${BINDIR}/ex 188 -rm -f ${DESTDIR}${NBINDIR}/vi 189 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 190 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e 191 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 192 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex 193 chmod 1755 ${DESTDIR}${BINDIR}/ex 194 195lint: 196 lint ${CFLAGS} ex.c ex_?*.c 197 lint ${CFLAGS} -u exrecover.c 198 lint ${CFLAGS} expreserve.c 199 200print: 201 @${PR} READ* BUGS 202 @${PR} makefile* 203 @${PR} /etc/terminfo 204 @(size -l a.out ; size *.o) | ${PR} -h sizes 205 @${PR} -h errno.h ${INCLUDE}/errno.h 206 @${PR} -h setjmp.h ${INCLUDE}/setjmp.h 207 @${PR} -h sgtty.h ${INCLUDE}/sgtty.h 208 @${PR} -h signal.h ${INCLUDE}/signal.h 209 @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h 210 @${PR} -h sys/types.h ${INCLUDE}/sys/types.h 211 @ls -ls | ${PR} 212 @${CXREF} *.c | ${PR} -h XREF 213 @${PR} *.h *.c 214vgrind: 215 tee index < /dev/null 216 ${VGRIND} -h ${VHDR} ${HDRS} 217 ${VGRIND} -h ${VHDR} ${SRC1} 218 ${VGRIND} -h ${VHDR} ${SRC2} 219 ${VGRIND} -h ${VHDR} ${SRC3} 220 ${VGRIND} -h ${VHDR} ${SRC4} 221 ${VGRIND} -h ${VHDR} ${SRC5} 222 ${VGRIND} -h ${VHDR} ${SRC6} 223 ${VGRIND} -n -h ${VHDR} ${MISC} 224 ${VGRIND} -i -h ${VHDR} index 225