1 #ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.5 */
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
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.
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]
25 # Ex skeletal makefile for version 7, USGS Overlay 11/70 system
27 # NB: This makefile doesn't indicate any dependencies on header files.
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 code to handle the -x option to allow
34 # encrypted files. Defining CRYPT drags in most of stdio (from the call
35 # to getpass) and makes vi about 4k text and 4k data bigger).
36 # VMUNIX makes ex considerably larger, raising many limits
37 # and improving speed and simplicity of maintenance. It is suitable only
38 # for a VAX or other large machine, and then probably only in a paged system.
40 # Don't define VFORK unless your system has the VFORK system call,
41 # which is like fork but the two processes have only one data space until the
42 # child execs. This speeds up ex by saving the memory copy.
44 # If your system expands tabs to 4 spaces you should -DTABS=4 below
57 DEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug
58 CFLAGS= -DTABS=8 -DSINGLE -DUCBV7 ${DEB}
62 # PRINTF= printf.o; PRINTFS=printf.c
63 PRINTF= ovprintf.o ovdoprnt.o
64 PRINTFS=ovprintf.c ovdoprnt.s
66 # FMT= -n # 11/23, 34, 40
70 OBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
71 ex_data.o ex_get.o ex_io.o ex_put.o ex_re.o \
72 ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \
73 ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \
74 ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
75 ${PRINTF} bcopy.o ex_extern.o strings.o
76 SRCS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h\
77 ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c \
78 ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c \
79 ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c \
80 ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c \
81 ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c \
85 ${MKSTR} - ex${VERSION}strings x $*.c
86 ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c -
88 ${CC} ${CFLAGS} -c x.c
91 # 11/23, 34, 40 and other non split I/D machines
92 # each of the 5 overlays must stay less than 16K.
94 # ${LD} -X /lib/crt0.o ${FMT}\
95 # -Z ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_re.o \
96 # -Z ex_vadj.o ex_vmain.o ex_voper.o ex_vwind.o ex_vops3.o\
97 # -Z ex_v.o ex_vget.o ex_vops.o ex_vops2.o ex_vput.o\
98 # -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 # -L ex_put.o ex_subr.o ${PRINTF} strings.o \
100 # ex_data.o ex_extern.o ${TERMLIB} -lovc
103 ${LD} -X /lib/crt0.o ${FMT}\
104 -Z ex_voper.o ex_vget.o ex_vops.o ex_vops2.o ex_vops3.o \
105 -Z ex_set.o ex_re.o ex_io.o ex_tty.o ex_unix.o ex.o\
106 -L ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_get.o ex_temp.o\
107 ex_v.o ex_vadj.o ex_vmain.o ex_vwind.o\
108 ex_vput.o ex_put.o ex_subr.o ${PRINTF} strings.o \
109 ex_data.o ex_extern.o ${TERMLIB} -lovc
111 all: a.out exrecover expreserve
114 ${CTAGS} -w ex.[hc] ex_*.[hc]
117 # csh makeoptions ${CFLAGS}
123 ${AS} -o strings.o xs.s
126 exrecover: exrecover.o
127 ${CC} ${CFLAGS} exrecover.o ex_extern.o -o exrecover
129 exrecover.o: exrecover.c
130 ${CC} ${CFLAGS} -c -O exrecover.c
132 expreserve: expreserve.o
133 ${CC} expreserve.o ex_extern.o -o expreserve
136 ${CC} ${CFLAGS} -c -O expreserve.c
139 # If we dont have ex we cant make it so dont rm ex_vars.h
140 -rm -f a.out exrecover expreserve strings core errs trace
143 # install a new version for testing in /usr/lbin
145 -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view ${DESTDIR}${NBINDIR}/vedit
146 cp a.out ${DESTDIR}${NBINDIR}/ex
147 # -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings
148 ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi
149 ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view
150 ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vedit
151 chmod 1755 ${DESTDIR}${NBINDIR}/ex
153 # install in standard place (/usr/bin)
154 install: a.out exrecover expreserve
155 -rm -f ${DESTDIR}${BINDIR}/ex
156 -rm -f ${DESTDIR}${BINDIR}/vi
157 -rm -f ${DESTDIR}${BINDIR}/view
158 -rm -f ${DESTDIR}${BINDIR}/vedit
159 -rm -f ${DESTDIR}${BINDIR}/edit
160 -rm -f ${DESTDIR}${BINDIR}/e
161 -rm -f ${DESTDIR}/usr/bin/ex
162 cp a.out ${DESTDIR}${BINDIR}/ex
163 # cp ex${VERSION}strings ${DESTDIR}${LIBDIR}/ex${VERSION}strings
164 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
165 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
166 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
167 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view
168 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vedit
169 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
170 chmod 1755 ${DESTDIR}${BINDIR}/ex
171 cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover
172 cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
173 chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
174 # The following line normally fails. This is OK.
175 mkdir ${DESTDIR}/usr/preserve
177 # move from /usr/lbin to /usr/bin
179 -rm -f ${DESTDIR}${BINDIR}/ex
180 -rm -f ${DESTDIR}${BINDIR}/vi
181 -rm -f ${DESTDIR}${BINDIR}/edit
182 -rm -f ${DESTDIR}${BINDIR}/e
183 -rm -f ${DESTDIR}/usr/bin/ex
184 mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${BINDIR}/ex
185 -rm -f ${DESTDIR}${NBINDIR}/vi
186 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
187 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
188 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
189 -ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
190 chmod 1755 ${DESTDIR}${BINDIR}/ex
193 lint ${CFLAGS} ex.c ex_?*.c
194 lint ${CFLAGS} -u exrecover.c
195 lint ${CFLAGS} expreserve.c
201 @(size -l a.out ; size *.o) | ${PR} -h sizes
202 @${PR} -h errno.h ${INCLUDE}/errno.h
203 @${PR} -h setjmp.h ${INCLUDE}/setjmp.h
204 @${PR} -h sgtty.h ${INCLUDE}/sgtty.h
205 @${PR} -h signal.h ${INCLUDE}/signal.h
206 @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h
207 @${PR} -h sys/types.h ${INCLUDE}/sys/types.h
209 @${CXREF} *.c | ${PR} -h XREF