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