1*7c478bd9Sstevel@tonic-gate#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.5 */ 2*7c478bd9Sstevel@tonic-gate# 3*7c478bd9Sstevel@tonic-gate# CDDL HEADER START 4*7c478bd9Sstevel@tonic-gate# 5*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 6*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only 7*7c478bd9Sstevel@tonic-gate# (the "License"). You may not use this file except in compliance 8*7c478bd9Sstevel@tonic-gate# with the License. 9*7c478bd9Sstevel@tonic-gate# 10*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 11*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 12*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 13*7c478bd9Sstevel@tonic-gate# and limitations under the License. 14*7c478bd9Sstevel@tonic-gate# 15*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 16*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 17*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 18*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 19*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 20*7c478bd9Sstevel@tonic-gate# 21*7c478bd9Sstevel@tonic-gate# CDDL HEADER END 22*7c478bd9Sstevel@tonic-gate# 23*7c478bd9Sstevel@tonic-gateVERSION=3.9 24*7c478bd9Sstevel@tonic-gate# 25*7c478bd9Sstevel@tonic-gate# Ex skeletal makefile for version 7, USGS Overlay 11/70 system 26*7c478bd9Sstevel@tonic-gate# 27*7c478bd9Sstevel@tonic-gate# NB: This makefile doesn't indicate any dependencies on header files. 28*7c478bd9Sstevel@tonic-gate# 29*7c478bd9Sstevel@tonic-gate# Ex is very large - this version will not fit on PDP-11's without overlay 30*7c478bd9Sstevel@tonic-gate# software. Things that can be turned off to save 31*7c478bd9Sstevel@tonic-gate# space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL 32*7c478bd9Sstevel@tonic-gate# (visual \ nonsense on upper case only terminals), CHDIR (the undocumented 33*7c478bd9Sstevel@tonic-gate# chdir command.) CRYPT includes code to handle the -x option to allow 34*7c478bd9Sstevel@tonic-gate# encrypted files. Defining CRYPT drags in most of stdio (from the call 35*7c478bd9Sstevel@tonic-gate# to getpass) and makes vi about 4k text and 4k data bigger). 36*7c478bd9Sstevel@tonic-gate# VMUNIX makes ex considerably larger, raising many limits 37*7c478bd9Sstevel@tonic-gate# and improving speed and simplicity of maintenance. It is suitable only 38*7c478bd9Sstevel@tonic-gate# for a VAX or other large machine, and then probably only in a paged system. 39*7c478bd9Sstevel@tonic-gate# 40*7c478bd9Sstevel@tonic-gate# Don't define VFORK unless your system has the VFORK system call, 41*7c478bd9Sstevel@tonic-gate# which is like fork but the two processes have only one data space until the 42*7c478bd9Sstevel@tonic-gate# child execs. This speeds up ex by saving the memory copy. 43*7c478bd9Sstevel@tonic-gate# 44*7c478bd9Sstevel@tonic-gate# If your system expands tabs to 4 spaces you should -DTABS=4 below 45*7c478bd9Sstevel@tonic-gate# 46*7c478bd9Sstevel@tonic-gateBINDIR= /usr/bin 47*7c478bd9Sstevel@tonic-gateNBINDIR=/usr/lbin 48*7c478bd9Sstevel@tonic-gateLIBDIR= /usr/lib 49*7c478bd9Sstevel@tonic-gateFOLD= ../misc/fold 50*7c478bd9Sstevel@tonic-gateCTAGS= ../misc/ctags 51*7c478bd9Sstevel@tonic-gateXSTR= ../misc/xstr 52*7c478bd9Sstevel@tonic-gateCC= cc -V 53*7c478bd9Sstevel@tonic-gateAS= ovas 54*7c478bd9Sstevel@tonic-gateLD= ovld 55*7c478bd9Sstevel@tonic-gateDEBUGFLAGS= -DTRACE 56*7c478bd9Sstevel@tonic-gateNONDEBUGFLAGS= -O 57*7c478bd9Sstevel@tonic-gateDEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug 58*7c478bd9Sstevel@tonic-gateCFLAGS= -DTABS=8 -DSINGLE -DUCBV7 ${DEB} 59*7c478bd9Sstevel@tonic-gateTERMLIB= -lovcurses 60*7c478bd9Sstevel@tonic-gateMKSTR= ../misc/mkstr 61*7c478bd9Sstevel@tonic-gateCXREF= ../misc/cxref 62*7c478bd9Sstevel@tonic-gate# PRINTF= printf.o; PRINTFS=printf.c 63*7c478bd9Sstevel@tonic-gatePRINTF= ovprintf.o ovdoprnt.o 64*7c478bd9Sstevel@tonic-gatePRINTFS=ovprintf.c ovdoprnt.s 65*7c478bd9Sstevel@tonic-gateFMT= -i # 11/45, 70 66*7c478bd9Sstevel@tonic-gate# FMT= -n # 11/23, 34, 40 67*7c478bd9Sstevel@tonic-gateINCLUDE=/usr/include 68*7c478bd9Sstevel@tonic-gatePR= pr 69*7c478bd9Sstevel@tonic-gateGET= sccs get 70*7c478bd9Sstevel@tonic-gateOBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \ 71*7c478bd9Sstevel@tonic-gate ex_data.o ex_get.o ex_io.o ex_put.o ex_re.o \ 72*7c478bd9Sstevel@tonic-gate ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \ 73*7c478bd9Sstevel@tonic-gate ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \ 74*7c478bd9Sstevel@tonic-gate ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \ 75*7c478bd9Sstevel@tonic-gate ${PRINTF} bcopy.o ex_extern.o strings.o 76*7c478bd9Sstevel@tonic-gateSRCS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h\ 77*7c478bd9Sstevel@tonic-gate ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c \ 78*7c478bd9Sstevel@tonic-gate ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c \ 79*7c478bd9Sstevel@tonic-gate ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c \ 80*7c478bd9Sstevel@tonic-gate ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c \ 81*7c478bd9Sstevel@tonic-gate ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c \ 82*7c478bd9Sstevel@tonic-gate ${PRINTFS} bcopy.c 83*7c478bd9Sstevel@tonic-gate 84*7c478bd9Sstevel@tonic-gate.c.o: 85*7c478bd9Sstevel@tonic-gate ${MKSTR} - ex${VERSION}strings x $*.c 86*7c478bd9Sstevel@tonic-gate ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c - 87*7c478bd9Sstevel@tonic-gate rm -f x$*.c 88*7c478bd9Sstevel@tonic-gate ${CC} ${CFLAGS} -c x.c 89*7c478bd9Sstevel@tonic-gate mv x.o $*.o 90*7c478bd9Sstevel@tonic-gate 91*7c478bd9Sstevel@tonic-gate# 11/23, 34, 40 and other non split I/D machines 92*7c478bd9Sstevel@tonic-gate# each of the 5 overlays must stay less than 16K. 93*7c478bd9Sstevel@tonic-gate# a.out: ${OBJS} 94*7c478bd9Sstevel@tonic-gate# ${LD} -X /lib/crt0.o ${FMT}\ 95*7c478bd9Sstevel@tonic-gate# -Z ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_re.o \ 96*7c478bd9Sstevel@tonic-gate# -Z ex_vadj.o ex_vmain.o ex_voper.o ex_vwind.o ex_vops3.o\ 97*7c478bd9Sstevel@tonic-gate# -Z ex_v.o ex_vget.o ex_vops.o ex_vops2.o ex_vput.o\ 98*7c478bd9Sstevel@tonic-gate# -Z ex_get.o ex_io.o ex_temp.o ex_tty.o ex_unix.o ex_addr.o ex.o ex_set.o \ 99*7c478bd9Sstevel@tonic-gate# -L ex_put.o ex_subr.o ${PRINTF} strings.o \ 100*7c478bd9Sstevel@tonic-gate# ex_data.o ex_extern.o ${TERMLIB} -lovc 101*7c478bd9Sstevel@tonic-gate 102*7c478bd9Sstevel@tonic-gatea.out: ${OBJS} 103*7c478bd9Sstevel@tonic-gate ${LD} -X /lib/crt0.o ${FMT}\ 104*7c478bd9Sstevel@tonic-gate -Z ex_voper.o ex_vget.o ex_vops.o ex_vops2.o ex_vops3.o \ 105*7c478bd9Sstevel@tonic-gate -Z ex_set.o ex_re.o ex_io.o ex_tty.o ex_unix.o ex.o\ 106*7c478bd9Sstevel@tonic-gate -L ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_get.o ex_temp.o\ 107*7c478bd9Sstevel@tonic-gate ex_v.o ex_vadj.o ex_vmain.o ex_vwind.o\ 108*7c478bd9Sstevel@tonic-gate ex_vput.o ex_put.o ex_subr.o ${PRINTF} strings.o \ 109*7c478bd9Sstevel@tonic-gate ex_data.o ex_extern.o ${TERMLIB} -lovc 110*7c478bd9Sstevel@tonic-gate 111*7c478bd9Sstevel@tonic-gateall: a.out exrecover expreserve 112*7c478bd9Sstevel@tonic-gate 113*7c478bd9Sstevel@tonic-gatetags: /tmp 114*7c478bd9Sstevel@tonic-gate ${CTAGS} -w ex.[hc] ex_*.[hc] 115*7c478bd9Sstevel@tonic-gate 116*7c478bd9Sstevel@tonic-gate# ex_vars.h: 117*7c478bd9Sstevel@tonic-gate# csh makeoptions ${CFLAGS} 118*7c478bd9Sstevel@tonic-gate 119*7c478bd9Sstevel@tonic-gatestrings.o: strings 120*7c478bd9Sstevel@tonic-gate ${XSTR} 121*7c478bd9Sstevel@tonic-gate ${CC} -c -S xs.c 122*7c478bd9Sstevel@tonic-gate# ed - <rofix xs.s 123*7c478bd9Sstevel@tonic-gate ${AS} -o strings.o xs.s 124*7c478bd9Sstevel@tonic-gate rm xs.s 125*7c478bd9Sstevel@tonic-gate 126*7c478bd9Sstevel@tonic-gateexrecover: exrecover.o 127*7c478bd9Sstevel@tonic-gate ${CC} ${CFLAGS} exrecover.o ex_extern.o -o exrecover 128*7c478bd9Sstevel@tonic-gate 129*7c478bd9Sstevel@tonic-gateexrecover.o: exrecover.c 130*7c478bd9Sstevel@tonic-gate ${CC} ${CFLAGS} -c -O exrecover.c 131*7c478bd9Sstevel@tonic-gate 132*7c478bd9Sstevel@tonic-gateexpreserve: expreserve.o 133*7c478bd9Sstevel@tonic-gate ${CC} expreserve.o ex_extern.o -o expreserve 134*7c478bd9Sstevel@tonic-gate 135*7c478bd9Sstevel@tonic-gateexpreserve.o: 136*7c478bd9Sstevel@tonic-gate ${CC} ${CFLAGS} -c -O expreserve.c 137*7c478bd9Sstevel@tonic-gate 138*7c478bd9Sstevel@tonic-gateclean: 139*7c478bd9Sstevel@tonic-gate# If we dont have ex we cant make it so dont rm ex_vars.h 140*7c478bd9Sstevel@tonic-gate -rm -f a.out exrecover expreserve strings core errs trace 141*7c478bd9Sstevel@tonic-gate -rm -f *.o x*.[cs] 142*7c478bd9Sstevel@tonic-gate 143*7c478bd9Sstevel@tonic-gate# install a new version for testing in /usr/lbin 144*7c478bd9Sstevel@tonic-gateninstall: a.out 145*7c478bd9Sstevel@tonic-gate -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view ${DESTDIR}${NBINDIR}/vedit 146*7c478bd9Sstevel@tonic-gate cp a.out ${DESTDIR}${NBINDIR}/ex 147*7c478bd9Sstevel@tonic-gate# -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings 148*7c478bd9Sstevel@tonic-gate ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi 149*7c478bd9Sstevel@tonic-gate ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view 150*7c478bd9Sstevel@tonic-gate ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vedit 151*7c478bd9Sstevel@tonic-gate chmod 1755 ${DESTDIR}${NBINDIR}/ex 152*7c478bd9Sstevel@tonic-gate 153*7c478bd9Sstevel@tonic-gate# install in standard place (/usr/bin) 154*7c478bd9Sstevel@tonic-gateinstall: a.out exrecover expreserve 155*7c478bd9Sstevel@tonic-gate -rm -f ${DESTDIR}${BINDIR}/ex 156*7c478bd9Sstevel@tonic-gate -rm -f ${DESTDIR}${BINDIR}/vi 157*7c478bd9Sstevel@tonic-gate -rm -f ${DESTDIR}${BINDIR}/view 158*7c478bd9Sstevel@tonic-gate -rm -f ${DESTDIR}${BINDIR}/vedit 159*7c478bd9Sstevel@tonic-gate -rm -f ${DESTDIR}${BINDIR}/edit 160*7c478bd9Sstevel@tonic-gate -rm -f ${DESTDIR}${BINDIR}/e 161*7c478bd9Sstevel@tonic-gate -rm -f ${DESTDIR}/usr/bin/ex 162*7c478bd9Sstevel@tonic-gate cp a.out ${DESTDIR}${BINDIR}/ex 163*7c478bd9Sstevel@tonic-gate# cp ex${VERSION}strings ${DESTDIR}${LIBDIR}/ex${VERSION}strings 164*7c478bd9Sstevel@tonic-gate ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 165*7c478bd9Sstevel@tonic-gate ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e 166*7c478bd9Sstevel@tonic-gate ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 167*7c478bd9Sstevel@tonic-gate ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view 168*7c478bd9Sstevel@tonic-gate ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vedit 169*7c478bd9Sstevel@tonic-gate ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex 170*7c478bd9Sstevel@tonic-gate chmod 1755 ${DESTDIR}${BINDIR}/ex 171*7c478bd9Sstevel@tonic-gate cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover 172*7c478bd9Sstevel@tonic-gate cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 173*7c478bd9Sstevel@tonic-gate chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve 174*7c478bd9Sstevel@tonic-gate# The following line normally fails. This is OK. 175*7c478bd9Sstevel@tonic-gate mkdir ${DESTDIR}/usr/preserve 176*7c478bd9Sstevel@tonic-gate 177*7c478bd9Sstevel@tonic-gate# move from /usr/lbin to /usr/bin 178*7c478bd9Sstevel@tonic-gatenewucb: a.out 179*7c478bd9Sstevel@tonic-gate -rm -f ${DESTDIR}${BINDIR}/ex 180*7c478bd9Sstevel@tonic-gate -rm -f ${DESTDIR}${BINDIR}/vi 181*7c478bd9Sstevel@tonic-gate -rm -f ${DESTDIR}${BINDIR}/edit 182*7c478bd9Sstevel@tonic-gate -rm -f ${DESTDIR}${BINDIR}/e 183*7c478bd9Sstevel@tonic-gate -rm -f ${DESTDIR}/usr/bin/ex 184*7c478bd9Sstevel@tonic-gate mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${BINDIR}/ex 185*7c478bd9Sstevel@tonic-gate -rm -f ${DESTDIR}${NBINDIR}/vi 186*7c478bd9Sstevel@tonic-gate ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit 187*7c478bd9Sstevel@tonic-gate ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e 188*7c478bd9Sstevel@tonic-gate ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi 189*7c478bd9Sstevel@tonic-gate -ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex 190*7c478bd9Sstevel@tonic-gate chmod 1755 ${DESTDIR}${BINDIR}/ex 191*7c478bd9Sstevel@tonic-gate 192*7c478bd9Sstevel@tonic-gatelint: 193*7c478bd9Sstevel@tonic-gate lint ${CFLAGS} ex.c ex_?*.c 194*7c478bd9Sstevel@tonic-gate lint ${CFLAGS} -u exrecover.c 195*7c478bd9Sstevel@tonic-gate lint ${CFLAGS} expreserve.c 196*7c478bd9Sstevel@tonic-gate 197*7c478bd9Sstevel@tonic-gateprint: 198*7c478bd9Sstevel@tonic-gate @${PR} READ* BUGS 199*7c478bd9Sstevel@tonic-gate @${PR} makefile* 200*7c478bd9Sstevel@tonic-gate @${PR} /etc/terminfo 201*7c478bd9Sstevel@tonic-gate @(size -l a.out ; size *.o) | ${PR} -h sizes 202*7c478bd9Sstevel@tonic-gate @${PR} -h errno.h ${INCLUDE}/errno.h 203*7c478bd9Sstevel@tonic-gate @${PR} -h setjmp.h ${INCLUDE}/setjmp.h 204*7c478bd9Sstevel@tonic-gate @${PR} -h sgtty.h ${INCLUDE}/sgtty.h 205*7c478bd9Sstevel@tonic-gate @${PR} -h signal.h ${INCLUDE}/signal.h 206*7c478bd9Sstevel@tonic-gate @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h 207*7c478bd9Sstevel@tonic-gate @${PR} -h sys/types.h ${INCLUDE}/sys/types.h 208*7c478bd9Sstevel@tonic-gate @ls -ls | ${PR} 209*7c478bd9Sstevel@tonic-gate @${CXREF} *.c | ${PR} -h XREF 210*7c478bd9Sstevel@tonic-gate @${PR} *.h *.c 211