xref: /csrg-svn/usr.bin/ex/OTHER/makefile.u3 (revision 4301)
1*4301SmarkVERSION=3.7
2*4301Smark#
3*4301Smark# Ex skeletal makefile for USG Unix 4.0 on a VAX.
4*4301Smark#
5*4301Smark# NB: This makefile doesn't indicate any dependencies on header files.
6*4301Smark#
7*4301Smark# Ex is very large - this version will not fit on PDP-11's without overlay
8*4301Smark# software.  Things that can be turned off to save
9*4301Smark# space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL
10*4301Smark# (visual \ nonsense on upper case only terminals), CHDIR (the undocumented
11*4301Smark# chdir command.)  CRYPT includes the code to edit encrypted files (the -x
12*4301Smark# option, like ed.)  VMUNIX makes ex considerably larger, raising many limits
13*4301Smark# and improving speed and simplicity of maintenance.  It is suitable only
14*4301Smark# for a VAX or other large machine, and then probably only in a paged system.
15*4301Smark#
16*4301Smark# Don't define VFORK unless your system has the VFORK system call,
17*4301Smark# which is like fork but the two processes have only one data space until the
18*4301Smark# child execs. This speeds up ex by saving the memory copy.
19*4301Smark#
20*4301Smark# If your system expands tabs to 4 spaces you should -DTABS=4 below
21*4301Smark#
22*4301SmarkBINDIR=	/usr/bin
23*4301SmarkNBINDIR=/usr/ucb/new
24*4301SmarkLIBDIR=	/usr/lib
25*4301SmarkFOLD=	${BINDIR}/fold
26*4301SmarkCTAGS=	ctags
27*4301SmarkXSTR=	/usr/ucb/bin/xstr
28*4301SmarkDEBUGFLAGS=	-DTRACE -g
29*4301SmarkNONDEBUGFLAGS=	-O
30*4301SmarkDEB=	${NONDEBUGFLAGS}	# or ${DEBUGFLAGS} to to debug
31*4301SmarkOPTIONS= -DCRYPT -DLISPCODE -DCHDIR -DUCVISUAL -DUSG3TTY -DSTDIO
32*4301SmarkCFLAGS=	-I/usr/ucb/include -DTABS=8 ${OPTIONS} ${DEB}
33*4301SmarkLDFLAGS=	-n		# or -i or -z
34*4301SmarkTERMLIB=	-ltermcap
35*4301SmarkMKSTR=	/usr/ucb/bin/mkstr
36*4301SmarkCXREF=	cxref
37*4301SmarkINCLUDE=/usr/include
38*4301SmarkPR=	pr
39*4301SmarkOBJS=	ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
40*4301Smark	ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \
41*4301Smark	ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \
42*4301Smark	ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \
43*4301Smark	ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
44*4301Smark	printf.o bcopy.o strings.o
45*4301SmarkHDRS=	ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
46*4301SmarkSRC1=	ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
47*4301SmarkSRC2=	ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
48*4301SmarkSRC3=	ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c
49*4301SmarkSRC4=	ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c
50*4301SmarkSRC5=	ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
51*4301SmarkSRC6=	printf.c bcopy.c expreserve.c exrecover.c
52*4301SmarkMISC=	makefile READ_ME rofix
53*4301SmarkVGRIND=	csh /usr/ucb/vgrind
54*4301SmarkVHDR=	"Ex Version ${VERSION}"
55*4301Smark
56*4301Smark.c.o:
57*4301Smark# ifdef VMUNIX
58*4301Smark#	${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
59*4301Smark# else
60*4301Smark	${MKSTR} - ex${VERSION}strings x $*.c
61*4301Smark	${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c -
62*4301Smark	rm -f x$*.c
63*4301Smark# endif
64*4301Smark	${CC} ${CFLAGS} -c x.c
65*4301Smark	mv x.o $*.o
66*4301Smark
67*4301Smarka.out: ${OBJS}
68*4301Smark	${CC} ${LDFLAGS} ${OBJS} ${TERMLIB}
69*4301Smark
70*4301Smarkall::	a.out exrecover expreserve
71*4301Smark
72*4301Smarktags:	/tmp
73*4301Smark	${CTAGS} -w ex.[hc] ex_*.[hc]
74*4301Smark
75*4301Smark${OBJS}: ex_vars.h
76*4301Smark
77*4301Smark# ex_vars.h:
78*4301Smark# 	csh makeoptions ${CFLAGS}
79*4301Smark
80*4301Smarkbcopy.o:	bcopy.c
81*4301Smark	${CC} -c ${CFLAGS} bcopy.c
82*4301Smark
83*4301Smark# xstr: hands off!
84*4301Smarkstrings.o: strings
85*4301Smark	${XSTR}
86*4301Smark	${CC} -c -S xs.c
87*4301Smark	ed - <rofix xs.s
88*4301Smark	${AS} -o strings.o xs.s
89*4301Smark	rm xs.s
90*4301Smark
91*4301Smarkexrecover: exrecover.o
92*4301Smark	${CC} ${CFLAGS} exrecover.o ex_extern.o -o exrecover
93*4301Smark
94*4301Smarkexrecover.o: exrecover.c
95*4301Smark	${CC} ${CFLAGS} -c -O exrecover.c
96*4301Smark
97*4301Smarkexpreserve: expreserve.o
98*4301Smark	${CC} expreserve.o ex_extern.o -o expreserve
99*4301Smark
100*4301Smarkexpreserve.o:
101*4301Smark	${CC} ${CFLAGS} -c -O expreserve.c
102*4301Smark
103*4301Smarkclean:
104*4301Smark#	If we dont have ex we cant make it so dont rm ex_vars.h
105*4301Smark	-rm -f a.out exrecover expreserve strings core errs trace
106*4301Smark	-rm -f *.o x*.[cs]
107*4301Smark
108*4301Smark# install a new version for testing in /usr/new
109*4301Smarkninstall: a.out
110*4301Smark	-rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view
111*4301Smark	cp a.out ${DESTDIR}${NBINDIR}/ex
112*4301Smark#	-cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings
113*4301Smark	ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi
114*4301Smark	ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view
115*4301Smark	chmod 1755 ${DESTDIR}${NBINDIR}/ex
116*4301Smark
117*4301Smark# install in standard place (/usr/ucb)
118*4301Smarkinstall: a.out exrecover expreserve
119*4301Smark	-strip a.out
120*4301Smark	-rm -f ${DESTDIR}${BINDIR}/ex
121*4301Smark	-rm -f ${DESTDIR}${BINDIR}/vi
122*4301Smark	-rm -f ${DESTDIR}${BINDIR}/view
123*4301Smark	-rm -f ${DESTDIR}${BINDIR}/edit
124*4301Smark	cp a.out ${DESTDIR}${BINDIR}/ex
125*4301Smark	cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings
126*4301Smark	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
127*4301Smark	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
128*4301Smark	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view
129*4301Smark	chmod 1755 ${DESTDIR}${BINDIR}/ex
130*4301Smark	cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover
131*4301Smark	cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
132*4301Smark	chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
133*4301Smark# The following line normally fails.  This is OK.
134*4301Smark	-mkdir ${DESTDIR}/usr/preserve
135*4301Smark
136*4301Smark# move from /usr/new to /usr/ucb
137*4301Smarknewucb: a.out
138*4301Smark	-rm -f ${DESTDIR}${BINDIR}/ex
139*4301Smark	-rm -f ${DESTDIR}${BINDIR}/vi
140*4301Smark	-rm -f ${DESTDIR}${BINDIR}/edit
141*4301Smark	-rm -f ${DESTDIR}${BINDIR}/e
142*4301Smark	-rm -f ${DESTDIR}/usr/bin/ex
143*4301Smark	mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex
144*4301Smark	-rm -f ${DESTDIR}${NBINDIR}/vi
145*4301Smark	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
146*4301Smark	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
147*4301Smark	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
148*4301Smark	ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
149*4301Smark	chmod 1755 ${DESTDIR}${BINDIR}/ex
150*4301Smark
151*4301Smarklint:
152*4301Smark	lint ${CFLAGS} ex.c ex_?*.c
153*4301Smark	lint ${CFLAGS} -u exrecover.c
154*4301Smark	lint ${CFLAGS} expreserve.c
155*4301Smark
156*4301Smarkprint:
157*4301Smark	@${PR} READ* BUGS
158*4301Smark	@${PR} makefile*
159*4301Smark	@${PR} /etc/termcap
160*4301Smark	@(size -l a.out ; size *.o) | ${PR} -h sizes
161*4301Smark	@${PR} -h errno.h ${INCLUDE}/errno.h
162*4301Smark	@${PR} -h setjmp.h ${INCLUDE}/setjmp.h
163*4301Smark	@${PR} -h sgtty.h ${INCLUDE}/sgtty.h
164*4301Smark	@${PR} -h signal.h ${INCLUDE}/signal.h
165*4301Smark	@${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h
166*4301Smark	@${PR} -h sys/types.h ${INCLUDE}/sys/types.h
167*4301Smark	@ls -ls | ${PR}
168*4301Smark	@${CXREF} *.c | ${PR} -h XREF
169*4301Smark	@${PR} *.h *.c
170*4301Smarkvgrind:
171*4301Smark	tee index < /dev/null
172*4301Smark	${VGRIND} -h ${VHDR} ${HDRS}
173*4301Smark	${VGRIND} -h ${VHDR} ${SRC1}
174*4301Smark	${VGRIND} -h ${VHDR} ${SRC2}
175*4301Smark	${VGRIND} -h ${VHDR} ${SRC3}
176*4301Smark	${VGRIND} -h ${VHDR} ${SRC4}
177*4301Smark	${VGRIND} -h ${VHDR} ${SRC5}
178*4301Smark	${VGRIND} -h ${VHDR} ${SRC6}
179*4301Smark	${VGRIND} -n -h ${VHDR} ${MISC}
180*4301Smark	${VGRIND} -i -h ${VHDR} index
181