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