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