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