BSD 4_3_Reno release
[unix-history] / usr / src / usr.bin / ex / OTHER / makefile.370
CommitLineData
edf71f48
DF
1#
2# Copyright (c) 1980 Regents of the University of California.
3# All rights reserved. The Berkeley software License Agreement
4# specifies the terms and conditions for redistribution.
5#
95f51977 6# @(#)makefile.370 1.2 (Berkeley) 5/31/85
edf71f48 7#
0d55e09d
MH
8VERSION=3.7
9#
10# Ex skeletal makefile for USG Unix 4.0 on a 370.
11#
12# NB: This makefile doesn't indicate any dependencies on header files.
13#
14# Ex is very large - this version will not fit on PDP-11's without overlay
15# software. Things that can be turned off to save
16# space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL
17# (visual \ nonsense on upper case only terminals), CHDIR (the undocumented
18# chdir command.) CRYPT includes the code to edit encrypted files (the -x
19# option, like ed.) VMUNIX makes ex considerably larger, raising many limits
20# and improving speed and simplicity of maintenance. It is suitable only
21# for a VAX or other large machine, and then probably only in a paged system.
22#
23# Don't define VFORK unless your system has the VFORK system call,
24# which is like fork but the two processes have only one data space until the
25# child execs. This speeds up ex by saving the memory copy.
26#
27# If your system expands tabs to 4 spaces you should -DTABS=4 below
28#
29BINDIR= /usr/lbin
30NBINDIR=/usr/ucb/new
31LIBDIR= /usr/lib
32FOLD= ${BINDIR}/fold
33CTAGS= ctags
34XSTR= bin/xstr
35DEBUGFLAGS= -DTRACE -g
36NONDEBUGFLAGS= -O
37DEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug
38OPTIONS= -DCRYPT -DLISPCODE -DCHDIR -DUCVISUAL -DUSG3TTY -DSTDIO -DVMUNIX
39CFLAGS= -I${INCLUDE} -DTABS=8 ${OPTIONS} ${DEB}
40LDFLAGS= -n # or -i or -z
41TERMLIB= termlib/termcap.a
42MKSTR= bin/mkstr
43CXREF= cxref
44INCLUDE=include
45PR= pr
46OBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
47 ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \
48 ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \
49 ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \
50 ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
51 printf.o bcopy.o
52HDRS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
53SRC1= ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
54SRC2= ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
55SRC3= ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c
56SRC4= ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c
57SRC5= ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
58SRC6= printf.c bcopy.c expreserve.c exrecover.c
59MISC= makefile READ_ME
60VGRIND= csh /usr/ucb/vgrind
61VHDR= "Ex Version ${VERSION}"
62
63.c.o:
64 ${CC} ${CFLAGS} -c $*.c
65
66a.out: ${OBJS}
67 ${CC} ${LDFLAGS} ${OBJS} ${TERMLIB}
68
69all:: a.out exrecover expreserve
70ex.o : ex.c
71 ${CC} ${CFLAGS} -b0,2 -c ex.c
72
73ex_cmds.o : ex_cmds.c
74 ${CC} ${CFLAGS} -b2,3 -c ex_cmds.c
75
76ex_cmds2.o : ex_cmds2.c
77 ${CC} ${CFLAGS} -b0,2 -c ex_cmds2.c
78
79ex_cmdsub.o : ex_cmdsub.c
80 ${CC} ${CFLAGS} -b0,2 -c ex_cmdsub.c
81
82ex_io.o : ex_io.c
83 ${CC} ${CFLAGS} -b0,5 -c ex_io.c
84
85ex_temp.o : ex_temp.c
86 ${CC} ${CFLAGS} -b0,4 -c ex_temp.c
87
88ex_vmain.o : ex_vmain.c
89 ${CC} ${CFLAGS} -b1,0 -c ex_vmain.c
90
91ex_voper.o : ex_voper.c
92 ${CC} ${CFLAGS} -b1,0 -c ex_voper.c
93
94
95tags: /tmp
96 ${CTAGS} -w ex.[hc] ex_*.[hc]
97
98${OBJS}: ex_vars.h
99
100# ex_vars.h:
101# csh makeoptions ${CFLAGS}
102
103bcopy.o: bcopy.c
104 ${CC} -c ${CFLAGS} bcopy.c
105
106exrecover: exrecover.o
107 ${CC} ${CFLAGS} exrecover.o ex_extern.o -o exrecover
108
109exrecover.o: exrecover.c
110 ${CC} ${CFLAGS} -c -O exrecover.c
111
112expreserve: expreserve.o
113 ${CC} expreserve.o ex_extern.o -o expreserve
114
115expreserve.o:
116 ${CC} ${CFLAGS} -c -O expreserve.c
117
118clean:
119# If we dont have ex we cant make it so dont rm ex_vars.h
120 -rm -f a.out exrecover expreserve strings core errs trace
121 -rm -f *.o x*.[cs]
122
123# install a new version for testing in /usr/new
124ninstall: a.out
125 -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view
126 cp a.out ${DESTDIR}${NBINDIR}/ex
127# -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings
128 ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi
129 ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view
130 chmod 1755 ${DESTDIR}${NBINDIR}/ex
131
132# install in standard place (/usr/ucb)
133install: a.out exrecover expreserve
134 -strip a.out
135 -rm -f ${DESTDIR}${BINDIR}/ex
136 -rm -f ${DESTDIR}${BINDIR}/vi
137 -rm -f ${DESTDIR}${BINDIR}/view
138 -rm -f ${DESTDIR}${BINDIR}/edit
139 cp a.out ${DESTDIR}${BINDIR}/ex
140 cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings
141 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
142 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
143 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view
144 chmod 1755 ${DESTDIR}${BINDIR}/ex
145 cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover
146 cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
147 chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
148# The following line normally fails. This is OK.
149 -mkdir ${DESTDIR}/usr/preserve
150
151# move from /usr/new to /usr/ucb
152newucb: a.out
153 -rm -f ${DESTDIR}${BINDIR}/ex
154 -rm -f ${DESTDIR}${BINDIR}/vi
155 -rm -f ${DESTDIR}${BINDIR}/edit
156 -rm -f ${DESTDIR}${BINDIR}/e
157 -rm -f ${DESTDIR}/usr/bin/ex
158 mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex
159 -rm -f ${DESTDIR}${NBINDIR}/vi
160 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
161 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
162 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
163 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
164 chmod 1755 ${DESTDIR}${BINDIR}/ex
165
166lint:
167 lint ${CFLAGS} ex.c ex_?*.c
168 lint ${CFLAGS} -u exrecover.c
169 lint ${CFLAGS} expreserve.c
170
171print:
172 @${PR} READ* BUGS
173 @${PR} makefile*
174 @${PR} /etc/termcap
175 @(size -l a.out ; size *.o) | ${PR} -h sizes
176 @${PR} -h errno.h ${INCLUDE}/errno.h
177 @${PR} -h setjmp.h ${INCLUDE}/setjmp.h
178 @${PR} -h sgtty.h ${INCLUDE}/sgtty.h
179 @${PR} -h signal.h ${INCLUDE}/signal.h
180 @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h
181 @${PR} -h sys/types.h ${INCLUDE}/sys/types.h
182 @ls -ls | ${PR}
183 @${CXREF} *.c | ${PR} -h XREF
184 @${PR} *.h *.c
185vgrind:
186 tee index < /dev/null
187 ${VGRIND} -h ${VHDR} ${HDRS}
188 ${VGRIND} -h ${VHDR} ${SRC1}
189 ${VGRIND} -h ${VHDR} ${SRC2}
190 ${VGRIND} -h ${VHDR} ${SRC3}
191 ${VGRIND} -h ${VHDR} ${SRC4}
192 ${VGRIND} -h ${VHDR} ${SRC5}
193 ${VGRIND} -h ${VHDR} ${SRC6}
194 ${VGRIND} -n -h ${VHDR} ${MISC}
195 ${VGRIND} -i -h ${VHDR} index