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