xref: /titanic_50/usr/src/cmd/vi/port/port.mk.c70 (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate#ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.4	*/
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 BBN's C/70.
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
54*7c478bd9Sstevel@tonic-gateCFLAGS=	-DTABS=8 -DSINGLE -I${INCLUDE} ${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=/usr/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 strings.o
67*7c478bd9Sstevel@tonic-gateASFIX= ex_cmdsub.o ex_io.o ex_subr.o ex_temp.o ex_vmain.o ex_voper.o \
68*7c478bd9Sstevel@tonic-gate	ex_vops.o ex_vops3.o ex_vwind.o
69*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
70*7c478bd9Sstevel@tonic-gateSRC1=	ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
71*7c478bd9Sstevel@tonic-gateSRC2=	ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
72*7c478bd9Sstevel@tonic-gateSRC3=	ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c
73*7c478bd9Sstevel@tonic-gateSRC4=	ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c
74*7c478bd9Sstevel@tonic-gateSRC5=	ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
75*7c478bd9Sstevel@tonic-gateSRC6=	printf.c bcopy.c expreserve.c exrecover.c
76*7c478bd9Sstevel@tonic-gateMISC=	makefile READ_ME rofix
77*7c478bd9Sstevel@tonic-gateVGRIND=	csh /usr/ucb/vgrind
78*7c478bd9Sstevel@tonic-gateVHDR=	"Ex Version ${VERSION}"
79*7c478bd9Sstevel@tonic-gate
80*7c478bd9Sstevel@tonic-gate.c.o:
81*7c478bd9Sstevel@tonic-gate# ifdef VMUNIX
82*7c478bd9Sstevel@tonic-gate#	${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
83*7c478bd9Sstevel@tonic-gate# else
84*7c478bd9Sstevel@tonic-gate	${MKSTR} - ex${VERSION}strings x $*.c
85*7c478bd9Sstevel@tonic-gate	${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c -
86*7c478bd9Sstevel@tonic-gate	rm -f x$*.c
87*7c478bd9Sstevel@tonic-gate# endif
88*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -c x.c
89*7c478bd9Sstevel@tonic-gate	mv x.o $*.o
90*7c478bd9Sstevel@tonic-gate
91*7c478bd9Sstevel@tonic-gatea.out: ${OBJS}
92*7c478bd9Sstevel@tonic-gate	${CC} ${LDFLAGS} -o a.out ${OBJS} ${TERMLIB}
93*7c478bd9Sstevel@tonic-gate
94*7c478bd9Sstevel@tonic-gateall:	a.out exrecover expreserve tags
95*7c478bd9Sstevel@tonic-gate
96*7c478bd9Sstevel@tonic-gatetags:	/tmp
97*7c478bd9Sstevel@tonic-gate	${CTAGS} -w ex.[hc] ex_*.[hc]
98*7c478bd9Sstevel@tonic-gate
99*7c478bd9Sstevel@tonic-gate${OBJS}: ex_vars.h
100*7c478bd9Sstevel@tonic-gate
101*7c478bd9Sstevel@tonic-gate# ex_vars.h:
102*7c478bd9Sstevel@tonic-gate# 	csh makeoptions ${CFLAGS}
103*7c478bd9Sstevel@tonic-gate
104*7c478bd9Sstevel@tonic-gatebcopy.o:	bcopy.c
105*7c478bd9Sstevel@tonic-gate	${CC} -c ${CFLAGS} bcopy.c
106*7c478bd9Sstevel@tonic-gate
107*7c478bd9Sstevel@tonic-gate# The following can be deleted when the C70 compiler is
108*7c478bd9Sstevel@tonic-gate# fixed to do pointer subtraction correctly.
109*7c478bd9Sstevel@tonic-gate
110*7c478bd9Sstevel@tonic-gate${ASFIX}: ex_vars.h ex_vis.h
111*7c478bd9Sstevel@tonic-gate 	${MKSTR} - ex${VERSION}strings x $*.c
112*7c478bd9Sstevel@tonic-gate 	${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c -
113*7c478bd9Sstevel@tonic-gate 	rm -f x$*.c
114*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -c -S x.c
115*7c478bd9Sstevel@tonic-gate	ed - <asfix.c70 x.s
116*7c478bd9Sstevel@tonic-gate	${CC} -c x.s
117*7c478bd9Sstevel@tonic-gate	mv x.o $*.o
118*7c478bd9Sstevel@tonic-gate	rm x.s
119*7c478bd9Sstevel@tonic-gate
120*7c478bd9Sstevel@tonic-gate# xstr: hands off!
121*7c478bd9Sstevel@tonic-gatestrings.o: strings
122*7c478bd9Sstevel@tonic-gate	${XSTR}
123*7c478bd9Sstevel@tonic-gate	${CC} -c -S xs.c
124*7c478bd9Sstevel@tonic-gate	ed - <rofix xs.s
125*7c478bd9Sstevel@tonic-gate	${AS} -o strings.o xs.s
126*7c478bd9Sstevel@tonic-gate	rm xs.s
127*7c478bd9Sstevel@tonic-gate
128*7c478bd9Sstevel@tonic-gateexrecover: exrecover.o
129*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} exrecover.o ex_extern.o -o exrecover
130*7c478bd9Sstevel@tonic-gate
131*7c478bd9Sstevel@tonic-gateexrecover.o: exrecover.c
132*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -c -O exrecover.c
133*7c478bd9Sstevel@tonic-gate
134*7c478bd9Sstevel@tonic-gateexpreserve: expreserve.o
135*7c478bd9Sstevel@tonic-gate	${CC} expreserve.o -o expreserve
136*7c478bd9Sstevel@tonic-gate
137*7c478bd9Sstevel@tonic-gateexpreserve.o:
138*7c478bd9Sstevel@tonic-gate	${CC} ${CFLAGS} -c -O expreserve.c
139*7c478bd9Sstevel@tonic-gate
140*7c478bd9Sstevel@tonic-gateclean:
141*7c478bd9Sstevel@tonic-gate#	If we dont have ex we cant make it so dont rm ex_vars.h
142*7c478bd9Sstevel@tonic-gate	-rm -f a.out exrecover expreserve strings core errs trace
143*7c478bd9Sstevel@tonic-gate	-rm -f *.o x*.[cs]
144*7c478bd9Sstevel@tonic-gate
145*7c478bd9Sstevel@tonic-gate# install a new version for testing in /usr/lbin
146*7c478bd9Sstevel@tonic-gateninstall: a.out
147*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view ${DESTDIR}${NBINDIR}/vedit
148*7c478bd9Sstevel@tonic-gate	cp a.out ${DESTDIR}${NBINDIR}/ex
149*7c478bd9Sstevel@tonic-gate#	-cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings
150*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi
151*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view
152*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vedit
153*7c478bd9Sstevel@tonic-gate	chmod 1755 ${DESTDIR}${NBINDIR}/ex
154*7c478bd9Sstevel@tonic-gate
155*7c478bd9Sstevel@tonic-gate# install in standard place (/usr/bin)
156*7c478bd9Sstevel@tonic-gateinstall: a.out exrecover expreserve
157*7c478bd9Sstevel@tonic-gate	strip a.out
158*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/ex
159*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/vi
160*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/view
161*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/vedit
162*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/edit
163*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/e
164*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}/usr/bin/ex
165*7c478bd9Sstevel@tonic-gate	cp a.out ${DESTDIR}${BINDIR}/ex
166*7c478bd9Sstevel@tonic-gate#	cp ex${VERSION}strings ${DESTDIR}${LIBDIR}/ex${VERSION}strings
167*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
168*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
169*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
170*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view
171*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vedit
172*7c478bd9Sstevel@tonic-gate	-ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
173*7c478bd9Sstevel@tonic-gate	chmod 1755 ${DESTDIR}${BINDIR}/ex
174*7c478bd9Sstevel@tonic-gate	cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover
175*7c478bd9Sstevel@tonic-gate	cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
176*7c478bd9Sstevel@tonic-gate	chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
177*7c478bd9Sstevel@tonic-gate# The following line normally fails.  This is OK.
178*7c478bd9Sstevel@tonic-gate	-mkdir ${DESTDIR}/usr/preserve
179*7c478bd9Sstevel@tonic-gate
180*7c478bd9Sstevel@tonic-gate# move from /usr/lbin to /usr/bin
181*7c478bd9Sstevel@tonic-gatenewucb: a.out
182*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/ex
183*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/vi
184*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/edit
185*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${BINDIR}/e
186*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}/usr/bin/ex
187*7c478bd9Sstevel@tonic-gate	mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${BINDIR}/ex
188*7c478bd9Sstevel@tonic-gate	-rm -f ${DESTDIR}${NBINDIR}/vi
189*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
190*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
191*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
192*7c478bd9Sstevel@tonic-gate	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
193*7c478bd9Sstevel@tonic-gate	chmod 1755 ${DESTDIR}${BINDIR}/ex
194*7c478bd9Sstevel@tonic-gate
195*7c478bd9Sstevel@tonic-gatelint:
196*7c478bd9Sstevel@tonic-gate	lint ${CFLAGS} ex.c ex_?*.c
197*7c478bd9Sstevel@tonic-gate	lint ${CFLAGS} -u exrecover.c
198*7c478bd9Sstevel@tonic-gate	lint ${CFLAGS} expreserve.c
199*7c478bd9Sstevel@tonic-gate
200*7c478bd9Sstevel@tonic-gateprint:
201*7c478bd9Sstevel@tonic-gate	@${PR} READ* BUGS
202*7c478bd9Sstevel@tonic-gate	@${PR} makefile*
203*7c478bd9Sstevel@tonic-gate	@${PR} /etc/terminfo
204*7c478bd9Sstevel@tonic-gate	@(size -l a.out ; size *.o) | ${PR} -h sizes
205*7c478bd9Sstevel@tonic-gate	@${PR} -h errno.h ${INCLUDE}/errno.h
206*7c478bd9Sstevel@tonic-gate	@${PR} -h setjmp.h ${INCLUDE}/setjmp.h
207*7c478bd9Sstevel@tonic-gate	@${PR} -h sgtty.h ${INCLUDE}/sgtty.h
208*7c478bd9Sstevel@tonic-gate	@${PR} -h signal.h ${INCLUDE}/signal.h
209*7c478bd9Sstevel@tonic-gate	@${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h
210*7c478bd9Sstevel@tonic-gate	@${PR} -h sys/types.h ${INCLUDE}/sys/types.h
211*7c478bd9Sstevel@tonic-gate	@ls -ls | ${PR}
212*7c478bd9Sstevel@tonic-gate	@${CXREF} *.c | ${PR} -h XREF
213*7c478bd9Sstevel@tonic-gate	@${PR} *.h *.c
214*7c478bd9Sstevel@tonic-gatevgrind:
215*7c478bd9Sstevel@tonic-gate	tee index < /dev/null
216*7c478bd9Sstevel@tonic-gate	${VGRIND} -h ${VHDR} ${HDRS}
217*7c478bd9Sstevel@tonic-gate	${VGRIND} -h ${VHDR} ${SRC1}
218*7c478bd9Sstevel@tonic-gate	${VGRIND} -h ${VHDR} ${SRC2}
219*7c478bd9Sstevel@tonic-gate	${VGRIND} -h ${VHDR} ${SRC3}
220*7c478bd9Sstevel@tonic-gate	${VGRIND} -h ${VHDR} ${SRC4}
221*7c478bd9Sstevel@tonic-gate	${VGRIND} -h ${VHDR} ${SRC5}
222*7c478bd9Sstevel@tonic-gate	${VGRIND} -h ${VHDR} ${SRC6}
223*7c478bd9Sstevel@tonic-gate	${VGRIND} -n -h ${VHDR} ${MISC}
224*7c478bd9Sstevel@tonic-gate	${VGRIND} -i -h ${VHDR} index
225