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