xref: /titanic_50/usr/src/cmd/vi/port/port.mk.370 (revision 62a24de03df1f2399ceda704cb3874dabc98bbbd)
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 USG Unix 4.0 on a 370.
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 the code to edit encrypted files (the -x
34# option, like ed.)  VMUNIX makes ex considerably larger, raising many limits
35# and improving speed and simplicity of maintenance.  It is suitable only
36# for a VAX or other large machine, and then probably only in a paged system.
37#
38# Don't define VFORK unless your system has the VFORK system call,
39# which is like fork but the two processes have only one data space until the
40# child execs. This speeds up ex by saving the memory copy.
41#
42# If your system expands tabs to 4 spaces you should -DTABS=4 below
43#
44BINDIR=	/usr/bin
45NBINDIR=/usr/lbin
46LIBDIR=	/usr/lib
47FOLD=	../misc/fold
48CTAGS=	../misc/ctags
49XSTR=	../misc/xstr
50DEBUGFLAGS=	-DTRACE -g
51NONDEBUGFLAGS=	-O
52DEB=	${NONDEBUGFLAGS}	# or ${DEBUGFLAGS} to to debug
53OPTIONS= -DCRYPT -DUSG -DSTDIO -DVMUNIX
54CFLAGS=	-I${INCLUDE} -DTABS=8 -DSINGLE ${OPTIONS} ${DEB}
55LDFLAGS=	-n		# or -i or -z
56TERMLIB=	-lcurses
57MKSTR=	../misc/mkstr
58CXREF=	../misc/cxref
59INCLUDE=include
60PR=	pr
61OBJS=	ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
62	ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \
63	ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \
64	ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \
65	ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
66	printf.o bcopy.o
67HDRS=	ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
68SRC1=	ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
69SRC2=	ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
70SRC3=	ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c
71SRC4=	ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c
72SRC5=	ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
73SRC6=	printf.c bcopy.c expreserve.c exrecover.c
74MISC=	makefile READ_ME
75VGRIND=	csh /usr/ucb/vgrind
76VHDR=	"Ex Version ${VERSION}"
77
78.c.o:
79	${CC} ${CFLAGS} -c $*.c
80
81a.out: ${OBJS}
82	${CC} ${LDFLAGS} ${OBJS} ${TERMLIB}
83
84all::	a.out exrecover expreserve
85ex.o :	ex.c
86	${CC} ${CFLAGS} -b0,2 -c ex.c
87
88ex_cmds.o :	ex_cmds.c
89	${CC} ${CFLAGS} -b2,3 -c ex_cmds.c
90
91ex_cmds2.o :	ex_cmds2.c
92	${CC} ${CFLAGS} -b0,2 -c ex_cmds2.c
93
94ex_cmdsub.o :	ex_cmdsub.c
95	${CC} ${CFLAGS} -b0,2 -c ex_cmdsub.c
96
97ex_io.o :	ex_io.c
98	${CC} ${CFLAGS} -b0,5 -c ex_io.c
99
100ex_temp.o :	ex_temp.c
101	${CC} ${CFLAGS} -b0,4 -c ex_temp.c
102
103ex_vmain.o :	ex_vmain.c
104	${CC} ${CFLAGS} -b1,0 -c ex_vmain.c
105
106ex_voper.o :	ex_voper.c
107	${CC} ${CFLAGS} -b1,0 -c ex_voper.c
108
109
110tags:	/tmp
111	${CTAGS} -w ex.[hc] ex_*.[hc]
112
113${OBJS}: ex_vars.h
114
115# ex_vars.h:
116# 	csh makeoptions ${CFLAGS}
117
118bcopy.o:	bcopy.c
119	${CC} -c ${CFLAGS} bcopy.c
120
121exrecover: exrecover.o
122	${CC} ${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} 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/lbin
139ninstall: a.out
140	-rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view ${DESTDIR}${NBINDIR}/vedit
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	ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vedit
146	chmod 1755 ${DESTDIR}${NBINDIR}/ex
147
148# install in standard place (/usr/bin)
149install: a.out exrecover expreserve
150	-strip a.out
151	-rm -f ${DESTDIR}${BINDIR}/ex
152	-rm -f ${DESTDIR}${BINDIR}/vi
153	-rm -f ${DESTDIR}${BINDIR}/view
154	-rm -f ${DESTDIR}${BINDIR}/vedit
155	-rm -f ${DESTDIR}${BINDIR}/edit
156	cp a.out ${DESTDIR}${BINDIR}/ex
157	cp ex${VERSION}strings ${DESTDIR}${LIBDIR}/ex${VERSION}strings
158	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
159	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
160	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view
161	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vedit
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/lbin to /usr/bin
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/terminfo
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
203vgrind:
204	tee index < /dev/null
205	${VGRIND} -h ${VHDR} ${HDRS}
206	${VGRIND} -h ${VHDR} ${SRC1}
207	${VGRIND} -h ${VHDR} ${SRC2}
208	${VGRIND} -h ${VHDR} ${SRC3}
209	${VGRIND} -h ${VHDR} ${SRC4}
210	${VGRIND} -h ${VHDR} ${SRC5}
211	${VGRIND} -h ${VHDR} ${SRC6}
212	${VGRIND} -n -h ${VHDR} ${MISC}
213	${VGRIND} -i -h ${VHDR} index
214