old SIGTSTP bugaboo
[unix-history] / usr / src / usr.bin / ex / Makefile
CommitLineData
869f8915 1# Makefile 7.7 83/07/09
299f2784 2VERSION=3.7
fe10330d 3#
104844c7 4# Ex skeletal makefile for VAX VM/Unix 4.2BSD
fe10330d
MH
5#
6# NB: This makefile doesn't indicate any dependencies on header files.
7#
7c4625ef
MH
8# Ex is very large - this version will not fit on PDP-11's without overlay
9# software. Things that can be turned off to save
44232d5b
MH
10# space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL
11# (visual \ nonsense on upper case only terminals), CHDIR (the undocumented
b41bbcb5
MH
12# chdir command.) CRYPT includes the code to edit encrypted files (the -x
13# option, like ed.) VMUNIX makes ex considerably larger, raising many limits
7c4625ef
MH
14# and improving speed and simplicity of maintenance. It is suitable only
15# for a VAX or other large machine, and then probably only in a paged system.
44232d5b
MH
16#
17# Don't define VFORK unless your system has the VFORK system call,
18# which is like fork but the two processes have only one data space until the
19# child execs. This speeds up ex by saving the memory copy.
fe10330d
MH
20#
21# If your system expands tabs to 4 spaces you should -DTABS=4 below
22#
44232d5b
MH
23BINDIR= /usr/ucb
24NBINDIR=/usr/new
fe10330d 25LIBDIR= /usr/lib
44232d5b
MH
26FOLD= ${BINDIR}/fold
27CTAGS= ${BINDIR}/ctags
28XSTR= ${BINDIR}/xstr
f0f2d980 29DEBUGFLAGS= -DTRACE -g
7cc1f963 30NONDEBUGFLAGS= -O
7c4625ef 31DEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug
6fd7f32b
MH
32OPTIONS= -DCRYPT -DLISPCODE -DCHDIR -DUCVISUAL -DVFORK -DVMUNIX -DSTDIO
33CFLAGS= -DTABS=8 ${OPTIONS} ${DEB}
7c4625ef 34LDFLAGS= -z # or -i or -n
04379bab 35TERMLIB= -ltermcap
44232d5b
MH
36MKSTR= ${BINDIR}/mkstr
37CXREF= ${BINDIR}/cxref
fe10330d
MH
38INCLUDE=/usr/include
39PR= pr
7c4625ef 40OBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
299f2784 41 ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \
7c4625ef 42 ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \
04379bab 43 ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \
fe10330d 44 ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
7cc1f963 45 printf.o bcopy.o strings.o
7c4625ef
MH
46HDRS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
47SRC1= ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
48SRC2= ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
49SRC3= ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c
04379bab 50SRC4= ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c
7c4625ef 51SRC5= ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
7cc1f963 52SRC6= printf.c bcopy.c expreserve.c exrecover.c
299f2784 53MISC= makefile READ_ME rofix
7c4625ef
MH
54VGRIND= csh /usr/ucb/vgrind
55VHDR= "Ex Version ${VERSION}"
44232d5b
MH
56
57.c.o:
04379bab 58# ifdef VMUNIX
44232d5b 59 ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
04379bab
MH
60# else
61# ${MKSTR} - ex${VERSION}strings x $*.c
62# ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c -
44232d5b 63# rm -f x$*.c
04379bab 64# endif
44232d5b
MH
65 ${CC} ${CFLAGS} -c x.c
66 mv x.o $*.o
fe10330d 67
869f8915 68all: a.out exrecover expreserve
104844c7 69
44232d5b 70a.out: ${OBJS}
8bcf1431 71 ${CC} ${LDFLAGS} ${OBJS} ${TERMLIB}
fe10330d 72
7c4625ef
MH
73tags: /tmp
74 ${CTAGS} -w ex.[hc] ex_*.[hc]
44232d5b 75
08da79f7 76${OBJS}: ${HDRS}
44232d5b 77
c641812b
MH
78# ex_vars.h:
79# csh makeoptions ${CFLAGS}
fe10330d 80
7c4625ef 81bcopy.o: bcopy.c
8bcf1431 82 ${CC} -c ${CFLAGS} bcopy.c
7c4625ef
MH
83
84# xstr: hands off!
fe10330d
MH
85strings.o: strings
86 ${XSTR}
44232d5b 87 ${CC} -c -S xs.c
299f2784 88 ed - <rofix xs.s
8bcf1431 89 ${AS} -o strings.o xs.s
44232d5b 90 rm xs.s
fe10330d
MH
91
92exrecover: exrecover.o
93e88407 93 ${CC} ${CFLAGS} exrecover.o ex_extern.o -o exrecover
fe10330d 94
44232d5b 95exrecover.o: exrecover.c
fe10330d
MH
96 ${CC} ${CFLAGS} -c -O exrecover.c
97
44232d5b 98expreserve: expreserve.o
cb3ac212 99 ${CC} expreserve.o -o expreserve
fe10330d
MH
100
101expreserve.o:
44232d5b 102 ${CC} ${CFLAGS} -c -O expreserve.c
fe10330d 103
8bcf1431 104clean:
08da79f7 105# If we dont have ex we cant make it so don't rm ex_vars.h
7c4625ef 106 -rm -f a.out exrecover expreserve strings core errs trace
44232d5b 107 -rm -f *.o x*.[cs]
fe10330d 108
7c4625ef 109# install a new version for testing in /usr/new
44232d5b 110ninstall: a.out
7c4625ef
MH
111 -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view
112 cp a.out ${DESTDIR}${NBINDIR}/ex
44232d5b 113# -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings
7c4625ef 114 ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi
d266c416 115 ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view
7c4625ef 116 chmod 1755 ${DESTDIR}${NBINDIR}/ex
fe10330d 117
7c4625ef 118# install in standard place (/usr/ucb)
44232d5b 119install: a.out exrecover expreserve
104844c7
SL
120 -rm -f ${DESTDIR}/${BINDIR}/ex
121 -rm -f ${DESTDIR}/${BINDIR}/vi
122 -rm -f ${DESTDIR}/${BINDIR}/view
123 -rm -f ${DESTDIR}/${BINDIR}/edit
124 -rm -f ${DESTDIR}/${BINDIR}/e
44232d5b 125 -rm -f ${DESTDIR}/usr/bin/ex
104844c7 126 install -s -m 1755 a.out ${DESTDIR}/${BINDIR}/ex
44232d5b 127# cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings
104844c7
SL
128 ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/edit
129 ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/e
130 ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/vi
131 ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/view
132 ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/usr/bin/ex
133 chmod 1755 ${DESTDIR}/${BINDIR}/ex
134 install -m 4755 exrecover ${DESTDIR}/${LIBDIR}/ex${VERSION}recover
135 install -m 4755 expreserve ${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
104844c7
SL
141 -rm -f ${DESTDIR}/${BINDIR}/ex
142 -rm -f ${DESTDIR}/${BINDIR}/vi
143 -rm -f ${DESTDIR}/${BINDIR}/edit
144 -rm -f ${DESTDIR}/${BINDIR}/e
7c4625ef 145 -rm -f ${DESTDIR}/usr/bin/ex
104844c7
SL
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
7c4625ef 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