xref: /original-bsd/usr.bin/ex/Makefile (revision 552e81d8)
1VERSION=3.5
2#
3# Ex skeletal makefile for VAX VM/Unix version 7
4#
5# NB: This makefile doesn't indicate any dependencies on header files.
6#
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
9# space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL
10# (visual \ nonsense on upper case only terminals), CHDIR (the undocumented
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
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.
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.
19#
20# If your system expands tabs to 4 spaces you should -DTABS=4 below
21#
22BINDIR=	/usr/ucb
23NBINDIR=/usr/new
24LIBDIR=	/usr/lib
25FOLD=	${BINDIR}/fold
26CTAGS=	${BINDIR}/ctags
27XSTR=	${BINDIR}/xstr
28DEBUGFLAGS=	-DTRACE -g
29NONDEBUGFLAGS=	-O
30DEB=	${NONDEBUGFLAGS}	# or ${DEBUGFLAGS} to to debug
31CFLAGS=	-DTABS=8 -DCRYPT -DLISPCODE -DCHDIR -DUCVISUAL -DVFORK -DVMUNIX ${DEB}
32LDFLAGS=	-z		# or -i or -n
33TERMLIB=	-ltermlib
34MKSTR=	${BINDIR}/mkstr
35CXREF=	${BINDIR}/cxref
36INCLUDE=/usr/include
37PR=	pr
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 \
41	ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voperate.o \
42	ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
43	printf.o bcopy.o strings.o
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
48SRC4=	ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voperate.c
49SRC5=	ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
50SRC6=	printf.c bcopy.c expreserve.c exrecover.c
51MISC=	makefile READ_ME :rofix
52VGRIND=	csh /usr/ucb/vgrind
53VHDR=	"Ex Version ${VERSION}"
54
55.c.o:
56#	${MKSTR} - ex${VERSION}strings x $*.c
57	${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
58#	rm -f x$*.c
59	${CC} ${CFLAGS} -c x.c
60	mv x.o $*.o
61
62a.out: ${OBJS}
63	${CC} ${LDFLAGS} ${OBJS} ${TERMLIB}
64
65all:	a.out exrecover expreserve tags
66
67tags:	/tmp
68	${CTAGS} -w ex.[hc] ex_*.[hc]
69
70${OBJS}: ex_vars.h
71
72# ex_vars.h:
73# 	csh makeoptions ${CFLAGS}
74
75bcopy.o:	bcopy.c
76	${CC} -c ${CFLAGS} bcopy.c
77
78# xstr: hands off!
79strings.o: strings
80	${XSTR}
81	${CC} -c -S xs.c
82	ed - <:rofix xs.s
83	${AS} -o strings.o xs.s
84	rm xs.s
85
86exrecover: exrecover.o
87	${CC} ${CFLAGS} exrecover.o -o exrecover
88
89exrecover.o: exrecover.c
90	${CC} ${CFLAGS} -c -O exrecover.c
91
92expreserve: expreserve.o
93	${CC} expreserve.o -o expreserve
94
95expreserve.o:
96	${CC} ${CFLAGS} -c -O expreserve.c
97
98clean:
99#	If we dont have ex we cant make it so dont rm ex_vars.h
100	-rm -f a.out exrecover expreserve strings core errs trace
101	-rm -f *.o x*.[cs]
102
103# install a new version for testing in /usr/new
104ninstall: a.out
105	-rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view
106	cp a.out ${DESTDIR}${NBINDIR}/ex
107#	-cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings
108	ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi
109	ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view
110	chmod 1755 ${DESTDIR}${NBINDIR}/ex
111
112# install in standard place (/usr/ucb)
113install: a.out exrecover expreserve
114	-rm -f ${DESTDIR}${BINDIR}/ex
115	-rm -f ${DESTDIR}${BINDIR}/vi
116	-rm -f ${DESTDIR}${BINDIR}/view
117	-rm -f ${DESTDIR}${BINDIR}/edit
118	-rm -f ${DESTDIR}${BINDIR}/e
119	-rm -f ${DESTDIR}/usr/bin/ex
120	cp a.out ${DESTDIR}${BINDIR}/ex
121#	cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings
122	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
123	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
124	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
125	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view
126	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
127	chmod 1755 ${DESTDIR}${BINDIR}/ex
128	cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover
129	cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
130	chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
131# The following line normally fails.  This is OK.
132	mkdir ${DESTDIR}/usr/preserve
133
134# move from /usr/new to /usr/ucb
135newucb: a.out
136	-rm -f ${DESTDIR}${BINDIR}/ex
137	-rm -f ${DESTDIR}${BINDIR}/vi
138	-rm -f ${DESTDIR}${BINDIR}/edit
139	-rm -f ${DESTDIR}${BINDIR}/e
140	-rm -f ${DESTDIR}/usr/bin/ex
141	mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex
142	-rm -f ${DESTDIR}${NBINDIR}/vi
143	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
144	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
145	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
146	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
147	chmod 1755 ${DESTDIR}${BINDIR}/ex
148
149lint:
150	lint ${CFLAGS} ex.c ex_?*.c
151	lint ${CFLAGS} -u exrecover.c
152	lint ${CFLAGS} expreserve.c
153
154print:
155	@${PR} READ* BUGS
156	@${PR} makefile*
157	@${PR} /etc/termcap
158	@(size -l a.out ; size *.o) | ${PR} -h sizes
159	@${PR} -h errno.h ${INCLUDE}/errno.h
160	@${PR} -h setjmp.h ${INCLUDE}/setjmp.h
161	@${PR} -h sgtty.h ${INCLUDE}/sgtty.h
162	@${PR} -h signal.h ${INCLUDE}/signal.h
163	@${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h
164	@${PR} -h sys/types.h ${INCLUDE}/sys/types.h
165	@ls -ls | ${PR}
166	@${CXREF} *.c | ${PR} -h XREF
167	@${PR} *.h *.c
168vgrind:
169	tee index < /dev/null
170	${VGRIND} -h ${VHDR} ${HDRS}
171	${VGRIND} -h ${VHDR} ${SRC1}
172	${VGRIND} -h ${VHDR} ${SRC2}
173	${VGRIND} -h ${VHDR} ${SRC3}
174	${VGRIND} -h ${VHDR} ${SRC4}
175	${VGRIND} -h ${VHDR} ${SRC5}
176	${VGRIND} -h ${VHDR} ${SRC6}
177	${VGRIND} -n -h ${VHDR} ${MISC}
178	${VGRIND} -i -h ${VHDR} index
179
180ex.c: SCCS/s.ex.c ${HDRS}; rm -f ex.c; sccs get ex.c
181ex.h: SCCS/s.ex.h; rm -f ex.h; sccs get ex.h
182ex_addr.c: SCCS/s.ex_addr.c; rm -f ex_addr.c; sccs get ex_addr.c
183ex_argv.h: SCCS/s.ex_argv.h; rm -f ex_argv.h; sccs get ex_argv.h
184ex_cmds.c: SCCS/s.ex_cmds.c; rm -f ex_cmds.c; sccs get ex_cmds.c
185ex_cmds2.c: SCCS/s.ex_cmds2.c; rm -f ex_cmds2.c; sccs get ex_cmds2.c
186ex_cmdsub.c: SCCS/s.ex_cmdsub.c; rm -f ex_cmdsub.c; sccs get ex_cmdsub.c
187ex_data.c: SCCS/s.ex_data.c; rm -f ex_data.c; sccs get ex_data.c
188ex_get.c: SCCS/s.ex_get.c; rm -f ex_get.c; sccs get ex_get.c
189ex_io.c: SCCS/s.ex_io.c; rm -f ex_io.c; sccs get ex_io.c
190ex_put.c: SCCS/s.ex_put.c; rm -f ex_put.c; sccs get ex_put.c
191ex_re.c: SCCS/s.ex_re.c; rm -f ex_re.c; sccs get ex_re.c
192ex_re.h: SCCS/s.ex_re.h; rm -f ex_re.h; sccs get ex_re.h
193ex_set.c: SCCS/s.ex_set.c; rm -f ex_set.c; sccs get ex_set.c
194ex_subr.c: SCCS/s.ex_subr.c; rm -f ex_subr.c; sccs get ex_subr.c
195ex_temp.c: SCCS/s.ex_temp.c; rm -f ex_temp.c; sccs get ex_temp.c
196ex_temp.h: SCCS/s.ex_temp.h; rm -f ex_temp.h; sccs get ex_temp.h
197ex_tty.c: SCCS/s.ex_tty.c; rm -f ex_tty.c; sccs get ex_tty.c
198ex_tty.h: SCCS/s.ex_tty.h; rm -f ex_tty.h; sccs get ex_tty.h
199ex_tune.h: SCCS/s.ex_tune.h; rm -f ex_tune.h; sccs get ex_tune.h
200ex_unix.c: SCCS/s.ex_unix.c; rm -f ex_unix.c; sccs get ex_unix.c
201ex_v.c: SCCS/s.ex_v.c; rm -f ex_v.c; sccs get ex_v.c
202ex_vadj.c: SCCS/s.ex_vadj.c; rm -f ex_vadj.c; sccs get ex_vadj.c
203ex_vars.h: SCCS/s.ex_vars.h; rm -f ex_vars.h; sccs get ex_vars.h
204ex_vget.c: SCCS/s.ex_vget.c; rm -f ex_vget.c; sccs get ex_vget.c
205ex_vis.h: SCCS/s.ex_vis.h; rm -f ex_vis.h; sccs get ex_vis.h
206ex_vmain.c: SCCS/s.ex_vmain.c; rm -f ex_vmain.c; sccs get ex_vmain.c
207ex_voperate.c: SCCS/s.ex_voperate.c; rm -f ex_voperate.c; sccs get ex_voperate.c
208ex_vops.c: SCCS/s.ex_vops.c; rm -f ex_vops.c; sccs get ex_vops.c
209ex_vops2.c: SCCS/s.ex_vops2.c; rm -f ex_vops2.c; sccs get ex_vops2.c
210ex_vops3.c: SCCS/s.ex_vops3.c; rm -f ex_vops3.c; sccs get ex_vops3.c
211ex_vput.c: SCCS/s.ex_vput.c; rm -f ex_vput.c; sccs get ex_vput.c
212ex_vwind.c: SCCS/s.ex_vwind.c; rm -f ex_vwind.c; sccs get ex_vwind.c
213expreserve.c: SCCS/s.expreserve.c; rm -f expreserve.c; sccs get expreserve.c
214exrecover.c: SCCS/s.exrecover.c; rm -f exrecover.c; sccs get exrecover.c
215makeoptions: SCCS/s.makeoptions; rm -f makeoptions; sccs get makeoptions
216bcopy.c: SCCS/s.bcopy.c; rm -f bcopy.c; sccs get bcopy.c
217printf.c: SCCS/s.printf.c; rm -f printf.c; sccs get printf.c
218