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