xref: /original-bsd/usr.bin/ex/OTHER/makefile.70 (revision 0fc6f013)
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.70	7.3 (Berkeley) 05/31/85
7#
8VERSION=3.7
9#
10# Ex skeletal makefile for version 7, USGS Overlay 11/70 system
11#
12# NB: This makefile doesn't indicate any dependencies on header files.
13#
14# Ex is very large - this version will not fit on PDP-11's without overlay
15# software.  Things that can be turned off to save
16# space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL
17# (visual \ nonsense on upper case only terminals), CHDIR (the undocumented
18# chdir command.)  CRYPT includes code to handle the -x option to allow
19# encrypted files.  Defining CRYPT drags in most of stdio (from the call
20# to getpass) and makes vi about 4k text and 4k data bigger).
21# VMUNIX makes ex considerably larger, raising many limits
22# and improving speed and simplicity of maintenance.  It is suitable only
23# for a VAX or other large machine, and then probably only in a paged system.
24#
25# Don't define VFORK unless your system has the VFORK system call,
26# which is like fork but the two processes have only one data space until the
27# child execs. This speeds up ex by saving the memory copy.
28#
29# If your system expands tabs to 4 spaces you should -DTABS=4 below
30#
31# If your system has no floating point unit, you should use FP= -f
32# and change the the appropriate invocation of ${LD}.
33#
34BINDIR=	/usr/ucb/bin
35NBINDIR=/usr/new/bin
36LIBDIR=	/usr/ucb/lib
37FOLD=	${BINDIR}/fold
38CTAGS=	${BINDIR}/ctags
39XSTR=	${BINDIR}/xstr
40CC=	cc -V
41AS=	ovas
42LD=	ovld
43DEBUGFLAGS=	-DTRACE
44NONDEBUGFLAGS=	-O
45DEB=	${NONDEBUGFLAGS}	# or ${DEBUGFLAGS} to to debug
46CFLAGS=	-DTABS=8 -DLISPCODE -DCHDIR -DUCVISUAL ${DEB}
47FP=
48TERMLIB=	-lovtermlib
49MKSTR=	${BINDIR}/mkstr
50CXREF=	${BINDIR}/cxref
51# PRINTF=	printf.o; PRINTFS=printf.c
52PRINTF=	ovprintf.o ovdoprnt.o
53PRINTFS=ovprintf.c ovdoprnt.s
54FMT=	-i	# 11/45, 70
55# FMT=	-n	# 11/23, 34, 40
56INCLUDE=/usr/include
57PR=	pr
58GET=	sccs get
59OBJS=	ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
60	ex_data.o ex_get.o ex_io.o ex_put.o ex_re.o \
61	ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \
62	ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \
63	ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
64	${PRINTF} bcopy.o ex_extern.o strings.o
65SRCS=	ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h\
66	ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c \
67	ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c \
68	ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c \
69	ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c \
70	ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c \
71	${PRINTFS} bcopy.c
72
73.c.o:
74	${MKSTR} - ex${VERSION}strings x $*.c
75	${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c -
76	rm -f x$*.c
77	${CC} ${CFLAGS} -c x.c
78	mv x.o $*.o
79
80# 11/23, 34, 40 and other non split I/D machines
81# each of the 6 overlays must stay less than 16K.
82# a.out: ${OBJS}
83# if no floating point unit
84#	${LD} -X /lib/fcrt0.o ${FMT} \
85# end no floating point unit
86	${LD} -X /lib/crt0.o ${FMT} \
87	    -Z ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_re.o \
88	    -Z ex_vadj.o ex_vmain.o ex_voper.o ex_vwind.o ex_vops3.o\
89	    -Z ex_v.o ex_vget.o ex_vops.o ex_vops2.o ex_vput.o\
90	    -Z ex_get.o ex_io.o ex_temp.o ex_tty.o ex_unix.o ex_addr.o ex.o ex_set.o \
91	    -Z ex_put.o ex_subr.o ${TERMLIB} \
92	    -L ex_data.o ex_extern.o ${PRINTF} strings.o -lovc
93
94a.out: ${OBJS}
95# if no floating point unit
96#	${LD} -X /lib/fcrt0.o -i \
97# end no floating point unit
98	${LD} -X /lib/crt0.o ${FMT}\
99	    -Z ex_voper.o ex_vget.o ex_vops.o ex_vops2.o ex_vops3.o \
100	    -Z ex_set.o ex_re.o ex_io.o ex_tty.o ex_unix.o ex.o ex_v.o \
101	    -L ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_get.o ex_temp.o\
102	       ex_vadj.o ex_vmain.o ex_vwind.o\
103	       ex_vput.o ex_put.o ex_subr.o ${PRINTF} strings.o \
104	       ex_data.o ex_extern.o ${TERMLIB} -lovc
105
106all:	a.out exrecover expreserve
107
108tags:	/tmp
109	${CTAGS} -w ex.[hc] ex_*.[hc]
110
111# ex_vars.h:
112# 	csh makeoptions ${CFLAGS}
113
114strings.o: strings
115	${XSTR}
116	${CC} -c -S xs.c
117#	ed - <rofix xs.s
118	${AS} -o strings.o xs.s
119	rm xs.s
120
121exrecover: exrecover.o
122	${CC} ${FP} ${CFLAGS} exrecover.o ex_extern.o -o exrecover
123
124exrecover.o: exrecover.c
125	${CC} ${CFLAGS} -c -O exrecover.c
126
127expreserve: expreserve.o
128	${CC} ${FP} expreserve.o ex_extern.o -o expreserve
129
130expreserve.o:
131	${CC} ${CFLAGS} -c -O expreserve.c
132
133clean:
134#	If we dont have ex we cant make it so dont rm ex_vars.h
135	-rm -f a.out exrecover expreserve strings core errs trace
136	-rm -f *.o x*.[cs]
137
138# install a new version for testing in /usr/new
139ninstall: a.out
140	-rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view
141	cp a.out ${DESTDIR}${NBINDIR}/ex
142#	-cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings
143	ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi
144	ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view
145	chmod 1755 ${DESTDIR}${NBINDIR}/ex
146
147# install in standard place (/usr/ucb)
148install: a.out exrecover expreserve
149	-rm -f ${DESTDIR}${BINDIR}/ex
150	-rm -f ${DESTDIR}${BINDIR}/vi
151	-rm -f ${DESTDIR}${BINDIR}/view
152	-rm -f ${DESTDIR}${BINDIR}/edit
153	-rm -f ${DESTDIR}${BINDIR}/e
154	-rm -f ${DESTDIR}/usr/bin/ex
155	cp a.out ${DESTDIR}${BINDIR}/ex
156#	cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings
157	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
158	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
159	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
160	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view
161	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
162	chmod 1755 ${DESTDIR}${BINDIR}/ex
163	cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover
164	cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
165	chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
166# The following line normally fails.  This is OK.
167	mkdir ${DESTDIR}/usr/preserve
168
169# move from /usr/new to /usr/ucb
170newucb: a.out
171	-rm -f ${DESTDIR}${BINDIR}/ex
172	-rm -f ${DESTDIR}${BINDIR}/vi
173	-rm -f ${DESTDIR}${BINDIR}/edit
174	-rm -f ${DESTDIR}${BINDIR}/e
175	-rm -f ${DESTDIR}/usr/bin/ex
176	mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex
177	-rm -f ${DESTDIR}${NBINDIR}/vi
178	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
179	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
180	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
181	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
182	chmod 1755 ${DESTDIR}${BINDIR}/ex
183
184lint:
185	lint ${CFLAGS} ex.c ex_?*.c
186	lint ${CFLAGS} -u exrecover.c
187	lint ${CFLAGS} expreserve.c
188
189print:
190	@${PR} READ* BUGS
191	@${PR} makefile*
192	@${PR} /etc/termcap
193	@(size -l a.out ; size *.o) | ${PR} -h sizes
194	@${PR} -h errno.h ${INCLUDE}/errno.h
195	@${PR} -h setjmp.h ${INCLUDE}/setjmp.h
196	@${PR} -h sgtty.h ${INCLUDE}/sgtty.h
197	@${PR} -h signal.h ${INCLUDE}/signal.h
198	@${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h
199	@${PR} -h sys/types.h ${INCLUDE}/sys/types.h
200	@ls -ls | ${PR}
201	@${CXREF} *.c | ${PR} -h XREF
202	@${PR} *.h *.c
203