xref: /titanic_44/usr/src/cmd/vi/port/port.mk.370 (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate#ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.5	*/
2*7c478bd9Sstevel@tonic-gate#
3*7c478bd9Sstevel@tonic-gate# CDDL HEADER START
4*7c478bd9Sstevel@tonic-gate#
5*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
6*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
7*7c478bd9Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
8*7c478bd9Sstevel@tonic-gate# with the License.
9*7c478bd9Sstevel@tonic-gate#
10*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
12*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
13*7c478bd9Sstevel@tonic-gate# and limitations under the License.
14*7c478bd9Sstevel@tonic-gate#
15*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
16*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
18*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
19*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
20*7c478bd9Sstevel@tonic-gate#
21*7c478bd9Sstevel@tonic-gate# CDDL HEADER END
22*7c478bd9Sstevel@tonic-gate#
23*7c478bd9Sstevel@tonic-gateVERSION=3.9
24*7c478bd9Sstevel@tonic-gate#
25*7c478bd9Sstevel@tonic-gate# Ex skeletal makefile for USG Unix 4.0 on a 370.
26*7c478bd9Sstevel@tonic-gate#
27*7c478bd9Sstevel@tonic-gate# NB: This makefile doesn't indicate any dependencies on header files.
28*7c478bd9Sstevel@tonic-gate#
29*7c478bd9Sstevel@tonic-gate# Ex is very large - this version will not fit on PDP-11's without overlay
30*7c478bd9Sstevel@tonic-gate# software.  Things that can be turned off to save
31*7c478bd9Sstevel@tonic-gate# space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL
32*7c478bd9Sstevel@tonic-gate# (visual \ nonsense on upper case only terminals), CHDIR (the undocumented
33*7c478bd9Sstevel@tonic-gate# chdir command.)  CRYPT includes the code to edit encrypted files (the -x
34*7c478bd9Sstevel@tonic-gate# option, like ed.)  VMUNIX makes ex considerably larger, raising many limits
35*7c478bd9Sstevel@tonic-gate# and improving speed and simplicity of maintenance.  It is suitable only
36*7c478bd9Sstevel@tonic-gate# for a VAX or other large machine, and then probably only in a paged system.
37*7c478bd9Sstevel@tonic-gate#
38*7c478bd9Sstevel@tonic-gate# Don't define VFORK unless your system has the VFORK system call,
39*7c478bd9Sstevel@tonic-gate# which is like fork but the two processes have only one data space until the
40*7c478bd9Sstevel@tonic-gate# child execs. This speeds up ex by saving the memory copy.
41*7c478bd9Sstevel@tonic-gate#
42*7c478bd9Sstevel@tonic-gate# If your system expands tabs to 4 spaces you should -DTABS=4 below
43*7c478bd9Sstevel@tonic-gate#
44*7c478bd9Sstevel@tonic-gateBINDIR=	/usr/bin
45*7c478bd9Sstevel@tonic-gateNBINDIR=/usr/lbin
46*7c478bd9Sstevel@tonic-gateLIBDIR=	/usr/lib
47*7c478bd9Sstevel@tonic-gateFOLD=	../misc/fold
48*7c478bd9Sstevel@tonic-gateCTAGS=	../misc/ctags
49*7c478bd9Sstevel@tonic-gateXSTR=	../misc/xstr
50*7c478bd9Sstevel@tonic-gateDEBUGFLAGS=	-DTRACE -g
51*7c478bd9Sstevel@tonic-gateNONDEBUGFLAGS=	-O
52*7c478bd9Sstevel@tonic-gateDEB=	${NONDEBUGFLAGS}	# or ${DEBUGFLAGS} to to debug
53*7c478bd9Sstevel@tonic-gateOPTIONS= -DCRYPT -DUSG -DSTDIO -DVMUNIX
54*7c478bd9Sstevel@tonic-gateCFLAGS=	-I${INCLUDE} -DTABS=8 -DSINGLE ${OPTIONS} ${DEB}
55*7c478bd9Sstevel@tonic-gateLDFLAGS=	-n		# or -i or -z
56*7c478bd9Sstevel@tonic-gateTERMLIB=	-lcurses
57*7c478bd9Sstevel@tonic-gateMKSTR=	../misc/mkstr
58*7c478bd9Sstevel@tonic-gateCXREF=	../misc/cxref
59*7c478bd9Sstevel@tonic-gateINCLUDE=include
60*7c478bd9Sstevel@tonic-gatePR=	pr
61*7c478bd9Sstevel@tonic-gateOBJS=	ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
62*7c478bd9Sstevel@tonic-gate	ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \
63*7c478bd9Sstevel@tonic-gate	ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \
64*7c478bd9Sstevel@tonic-gate	ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \
65*7c478bd9Sstevel@tonic-gate	ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
66*7c478bd9Sstevel@tonic-gate	printf.o bcopy.o
67*7c478bd9Sstevel@tonic-gateHDRS=	ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
68*7c478bd9Sstevel@tonic-gateSRC1=	ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
69*7c478bd9Sstevel@tonic-gateSRC2=	ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
70*7c478bd9Sstevel@tonic-gateSRC3=	ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c
71*7c478bd9Sstevel@tonic-gateSRC4=	ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c
72*7c478bd9Sstevel@tonic-gateSRC5=	ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
73*7c478bd9Sstevel@tonic-gateSRC6=	printf.c bcopy.c expreserve.c exrecover.c
74*7c478bd9Sstevel@tonic-gateMISC=	makefile READ_ME
75*7c478bd9Sstevel@tonic-gateVGRIND=	csh /usr/ucb/vgrind
76*7c478bd9Sstevel@tonic-gateVHDR=	"Ex Version ${VERSION}"
77*7c478bd9Sstevel@tonic-gate
78*7c478bd9Sstevel@tonic-gate.c.o:
79*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -c $*.c
80*7c478bd9Sstevel@tonic-gate
81*7c478bd9Sstevel@tonic-gatea.out: ${OBJS}
82*7c478bd9Sstevel@tonic-gate	${CC} ${LDFLAGS} ${OBJS} ${TERMLIB}
83*7c478bd9Sstevel@tonic-gate
84*7c478bd9Sstevel@tonic-gateall::	a.out exrecover expreserve
85*7c478bd9Sstevel@tonic-gateex.o :	ex.c
86*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -b0,2 -c ex.c
87*7c478bd9Sstevel@tonic-gate
88*7c478bd9Sstevel@tonic-gateex_cmds.o :	ex_cmds.c
89*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -b2,3 -c ex_cmds.c
90*7c478bd9Sstevel@tonic-gate
91*7c478bd9Sstevel@tonic-gateex_cmds2.o :	ex_cmds2.c
92*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -b0,2 -c ex_cmds2.c
93*7c478bd9Sstevel@tonic-gate
94*7c478bd9Sstevel@tonic-gateex_cmdsub.o :	ex_cmdsub.c
95*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -b0,2 -c ex_cmdsub.c
96*7c478bd9Sstevel@tonic-gate
97*7c478bd9Sstevel@tonic-gateex_io.o :	ex_io.c
98*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -b0,5 -c ex_io.c
99*7c478bd9Sstevel@tonic-gate
100*7c478bd9Sstevel@tonic-gateex_temp.o :	ex_temp.c
101*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -b0,4 -c ex_temp.c
102*7c478bd9Sstevel@tonic-gate
103*7c478bd9Sstevel@tonic-gateex_vmain.o :	ex_vmain.c
104*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -b1,0 -c ex_vmain.c
105*7c478bd9Sstevel@tonic-gate
106*7c478bd9Sstevel@tonic-gateex_voper.o :	ex_voper.c
107*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -b1,0 -c ex_voper.c
108*7c478bd9Sstevel@tonic-gate
109*7c478bd9Sstevel@tonic-gate
110*7c478bd9Sstevel@tonic-gatetags:	/tmp
111*7c478bd9Sstevel@tonic-gate	${CTAGS} -w ex.[hc] ex_*.[hc]
112*7c478bd9Sstevel@tonic-gate
113*7c478bd9Sstevel@tonic-gate${OBJS}: ex_vars.h
114*7c478bd9Sstevel@tonic-gate
115*7c478bd9Sstevel@tonic-gate# ex_vars.h:
116*7c478bd9Sstevel@tonic-gate# 	csh makeoptions ${CFLAGS}
117*7c478bd9Sstevel@tonic-gate
118*7c478bd9Sstevel@tonic-gatebcopy.o:	bcopy.c
119*7c478bd9Sstevel@tonic-gate	${CC} -c ${CFLAGS} bcopy.c
120*7c478bd9Sstevel@tonic-gate
121*7c478bd9Sstevel@tonic-gateexrecover: exrecover.o
122*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} exrecover.o ex_extern.o -o exrecover
123*7c478bd9Sstevel@tonic-gate
124*7c478bd9Sstevel@tonic-gateexrecover.o: exrecover.c
125*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -c -O exrecover.c
126*7c478bd9Sstevel@tonic-gate
127*7c478bd9Sstevel@tonic-gateexpreserve: expreserve.o
128*7c478bd9Sstevel@tonic-gate	${CC} expreserve.o ex_extern.o -o expreserve
129*7c478bd9Sstevel@tonic-gate
130*7c478bd9Sstevel@tonic-gateexpreserve.o:
131*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -c -O expreserve.c
132*7c478bd9Sstevel@tonic-gate
133*7c478bd9Sstevel@tonic-gateclean:
134*7c478bd9Sstevel@tonic-gate#	If we dont have ex we cant make it so dont rm ex_vars.h
135*7c478bd9Sstevel@tonic-gate	-rm -f a.out exrecover expreserve strings core errs trace
136*7c478bd9Sstevel@tonic-gate	-rm -f *.o x*.[cs]
137*7c478bd9Sstevel@tonic-gate
138*7c478bd9Sstevel@tonic-gate# install a new version for testing in /usr/lbin
139*7c478bd9Sstevel@tonic-gateninstall: a.out
140*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view ${DESTDIR}${NBINDIR}/vedit
141*7c478bd9Sstevel@tonic-gate	cp a.out ${DESTDIR}${NBINDIR}/ex
142*7c478bd9Sstevel@tonic-gate#	-cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings
143*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi
144*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view
145*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vedit
146*7c478bd9Sstevel@tonic-gate	chmod 1755 ${DESTDIR}${NBINDIR}/ex
147*7c478bd9Sstevel@tonic-gate
148*7c478bd9Sstevel@tonic-gate# install in standard place (/usr/bin)
149*7c478bd9Sstevel@tonic-gateinstall: a.out exrecover expreserve
150*7c478bd9Sstevel@tonic-gate	-strip a.out
151*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/ex
152*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/vi
153*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/view
154*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/vedit
155*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/edit
156*7c478bd9Sstevel@tonic-gate	cp a.out ${DESTDIR}${BINDIR}/ex
157*7c478bd9Sstevel@tonic-gate	cp ex${VERSION}strings ${DESTDIR}${LIBDIR}/ex${VERSION}strings
158*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
159*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
160*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view
161*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vedit
162*7c478bd9Sstevel@tonic-gate	chmod 1755 ${DESTDIR}${BINDIR}/ex
163*7c478bd9Sstevel@tonic-gate	cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover
164*7c478bd9Sstevel@tonic-gate	cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
165*7c478bd9Sstevel@tonic-gate	chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
166*7c478bd9Sstevel@tonic-gate# The following line normally fails.  This is OK.
167*7c478bd9Sstevel@tonic-gate	-mkdir ${DESTDIR}/usr/preserve
168*7c478bd9Sstevel@tonic-gate
169*7c478bd9Sstevel@tonic-gate# move from /usr/lbin to /usr/bin
170*7c478bd9Sstevel@tonic-gatenewucb: a.out
171*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/ex
172*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/vi
173*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/edit
174*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/e
175*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}/usr/bin/ex
176*7c478bd9Sstevel@tonic-gate	mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex
177*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${NBINDIR}/vi
178*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
179*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
180*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
181*7c478bd9Sstevel@tonic-gate	-ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
182*7c478bd9Sstevel@tonic-gate	chmod 1755 ${DESTDIR}${BINDIR}/ex
183*7c478bd9Sstevel@tonic-gate
184*7c478bd9Sstevel@tonic-gatelint:
185*7c478bd9Sstevel@tonic-gate	lint ${CFLAGS} ex.c ex_?*.c
186*7c478bd9Sstevel@tonic-gate	lint ${CFLAGS} -u exrecover.c
187*7c478bd9Sstevel@tonic-gate	lint ${CFLAGS} expreserve.c
188*7c478bd9Sstevel@tonic-gate
189*7c478bd9Sstevel@tonic-gateprint:
190*7c478bd9Sstevel@tonic-gate	@${PR} READ* BUGS
191*7c478bd9Sstevel@tonic-gate	@${PR} makefile*
192*7c478bd9Sstevel@tonic-gate	@${PR} /etc/terminfo
193*7c478bd9Sstevel@tonic-gate	@(size -l a.out ; size *.o) | ${PR} -h sizes
194*7c478bd9Sstevel@tonic-gate	@${PR} -h errno.h ${INCLUDE}/errno.h
195*7c478bd9Sstevel@tonic-gate	@${PR} -h setjmp.h ${INCLUDE}/setjmp.h
196*7c478bd9Sstevel@tonic-gate	@${PR} -h sgtty.h ${INCLUDE}/sgtty.h
197*7c478bd9Sstevel@tonic-gate	@${PR} -h signal.h ${INCLUDE}/signal.h
198*7c478bd9Sstevel@tonic-gate	@${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h
199*7c478bd9Sstevel@tonic-gate	@${PR} -h sys/types.h ${INCLUDE}/sys/types.h
200*7c478bd9Sstevel@tonic-gate	@ls -ls | ${PR}
201*7c478bd9Sstevel@tonic-gate	@${CXREF} *.c | ${PR} -h XREF
202*7c478bd9Sstevel@tonic-gate	@${PR} *.h *.c
203*7c478bd9Sstevel@tonic-gatevgrind:
204*7c478bd9Sstevel@tonic-gate	tee index < /dev/null
205*7c478bd9Sstevel@tonic-gate	${VGRIND} -h ${VHDR} ${HDRS}
206*7c478bd9Sstevel@tonic-gate	${VGRIND} -h ${VHDR} ${SRC1}
207*7c478bd9Sstevel@tonic-gate	${VGRIND} -h ${VHDR} ${SRC2}
208*7c478bd9Sstevel@tonic-gate	${VGRIND} -h ${VHDR} ${SRC3}
209*7c478bd9Sstevel@tonic-gate	${VGRIND} -h ${VHDR} ${SRC4}
210*7c478bd9Sstevel@tonic-gate	${VGRIND} -h ${VHDR} ${SRC5}
211*7c478bd9Sstevel@tonic-gate	${VGRIND} -h ${VHDR} ${SRC6}
212*7c478bd9Sstevel@tonic-gate	${VGRIND} -n -h ${VHDR} ${MISC}
213*7c478bd9Sstevel@tonic-gate	${VGRIND} -i -h ${VHDR} index
214