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