1 #ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.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
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 BBN's C/70.
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 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.
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.
42 # If your system expands tabs to 4 spaces you should -DTABS=4 below
50 DEBUGFLAGS= -DTRACE -g
52 DEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug
54 CFLAGS= -DTABS=8 -DSINGLE -I${INCLUDE} ${OPTIONS} ${DEB}
55 LDFLAGS= -n # or -i or -z
61 OBJS= 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
67 ASFIX= 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
69 HDRS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
70 SRC1= ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
71 SRC2= ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
72 SRC3= ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c
73 SRC4= ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c
74 SRC5= ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
75 SRC6= printf.c bcopy.c expreserve.c exrecover.c
76 MISC= makefile READ_ME rofix
77 VGRIND= csh /usr/ucb/vgrind
78 VHDR= "Ex Version ${VERSION}"
82 # ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
84 ${MKSTR} - ex${VERSION}strings x $*.c
85 ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c -
88 ${CC} ${CFLAGS} -c x.c
92 ${CC} ${LDFLAGS} -o a.out ${OBJS} ${TERMLIB}
94 all: a.out exrecover expreserve tags
97 ${CTAGS} -w ex.[hc] ex_*.[hc]
102 # csh makeoptions ${CFLAGS}
105 ${CC} -c ${CFLAGS} bcopy.c
107 # The following can be deleted when the C70 compiler is
108 # fixed to do pointer subtraction correctly.
110 ${ASFIX}: ex_vars.h ex_vis.h
111 ${MKSTR} - ex${VERSION}strings x $*.c
112 ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c -
114 ${CC} ${CFLAGS} -c -S x.c
125 ${AS} -o strings.o xs.s
128 exrecover: exrecover.o
129 ${CC} ${CFLAGS} exrecover.o ex_extern.o -o exrecover
131 exrecover.o: exrecover.c
132 ${CC} ${CFLAGS} -c -O exrecover.c
134 expreserve: expreserve.o
135 ${CC} expreserve.o -o expreserve
138 ${CC} ${CFLAGS} -c -O expreserve.c
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
145 # install a new version for testing in /usr/lbin
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
155 # install in standard place (/usr/bin)
156 install: a.out exrecover expreserve
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
180 # move from /usr/lbin to /usr/bin
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
196 lint ${CFLAGS} ex.c ex_?*.c
197 lint ${CFLAGS} -u exrecover.c
198 lint ${CFLAGS} expreserve.c
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
212 @${CXREF} *.c | ${PR} -h XREF
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