1*464SmarkVERSION=3.1
2*464Smark#
3*464Smark# Ex skeletal makefile for Version 7
4*464Smark#
5*464Smark# NB: This makefile doesn't indicate any dependencies on header files.
6*464Smark#
7*464Smark# Compiles in the LISPCODE code within the editor;
8*464Smark# take this out of CFLAGS to make some
9*464Smark# breathing room in the text space if necessary.  If you take out -DLISPCODE
10*464Smark# you should move ex_vars.nolisp to ex_vars.h
11*464Smark#
12*464Smark# If your system expands tabs to 4 spaces you should -DTABS=4 below
13*464Smark#
14*464Smark# Ex wants stdio only to get the doprnt.o routine; if other stdio stuff
15*464Smark# gets dragged in that is a mistake.
16*464Smark#
17*464Smark.c.o:
18*464Smark	${MKSTR} - ex${VERSION}strings x $*.c
19*464Smark	${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c -
20*464Smark	rm -f x$*.c
21*464Smark	${CC} ${CFLAGS} -O -c x.c
22*464Smark	mv x.o $*.o
23*464SmarkBINDIR=	/usr/bin
24*464SmarkLIBDIR=	/usr/lib
25*464SmarkFOLD=	/usr/bin/fold
26*464SmarkCTAGS=	/usr/ucb/ctags
27*464SmarkAS=	-as
28*464SmarkXSTR=	/usr/ucb/xstr
29*464SmarkCFLAGS=	-DTABS=8 -DLISPCODE
30*464SmarkMKSTR=	/usr/ucb/mkstr
31*464SmarkCXREF=	/usr/ucb/cxref
32*464SmarkINCLUDE=/usr/include
33*464SmarkPR=	pr
34*464SmarkOBJS=	ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_data.o ex_get.o \
35*464Smark	ex_io.o ex_put.o ex_re.o ex_set.o ex_subr.o ex_temp.o ex_tty.o \
36*464Smark	ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voperate.o \
37*464Smark	ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
38*464Smark	printf.o strings.o
39*464Smark
40*464Smarkall: a.out expreserve exrecover
41*464Smark
42*464Smarka.out: ${OBJS} tags
43*464Smark	${CC} -i ${OBJS} -ltermlib
44*464Smark
45*464Smarktags:
46*464Smark	../bin/csh ${CTAGS} ex.c ex_*.c
47*464Smark
48*464Smarkstrings.o: strings
49*464Smark	${XSTR}
50*464Smark	${CC} -c xs.c
51*464Smark	mv xs.o strings.o
52*464Smark
53*464Smarkexrecover: exrecover.o
54*464Smark	${CC} -o exrecover exrecover.o
55*464Smark
56*464Smarkexrecover.o:
57*464Smark	${CC} ${CFLAGS} -c -O exrecover.c
58*464Smark
59*464Smarkexpreserve: expreserve.o popen.c
60*464Smark	${CC} -o expreserve expreserve.o
61*464Smark
62*464Smarkexpreserve.o:
63*464Smark	${CC} ${CFLAGS} -c expreserve.c
64*464Smark
65*464Smarkclean:
66*464Smark	-rm a.out exrecover expreserve ex${VERSION}strings strings errs core trace
67*464Smark	-rm *.o x*.[cs]
68*464Smark
69*464Smarkinstall: a.out installutil
70*464Smark	-chmod 755 ${BINDIR}/ex
71*464Smark	-${BINDIR}/ex </dev/null
72*464Smark	-rm -f ${BINDIR}/ex ${BINDIR}/edit /${BINDIR}/vi
73*464Smark	cp a.out ${BINDIR}/ex
74*464Smark	ln ${BINDIR}/ex ${BINDIR}/edit
75*464Smark	ln ${BINDIR}/ex ${BINDIR}/vi
76*464Smark	cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings
77*464Smark	chmod 1755 ${BINDIR}/ex
78*464Smark
79*464Smarkinstallutil: exrecover expreserve
80*464Smark	cp exrecover ${LIBDIR}/ex${VERSION}recover
81*464Smark	cp expreserve ${LIBDIR}/ex${VERSION}preserve
82*464Smark
83*464Smarklint:
84*464Smark	lint ex.c ex_?*.c
85*464Smark	lint -u exrecover.c
86*464Smark	lint expreserve.c
87*464Smark
88*464Smarkprint:
89*464Smark	@-rm x.c xs.c >/dev/null
90*464Smark	@${PR} READ* BUGS
91*464Smark	@${PR} make*
92*464Smark	@(size -l a.out ; size *.o) | ${PR} -h sizes
93*464Smark	@${PR} termcap
94*464Smark	@${PR} -h errno.h ${INCLUDE}/errno.h
95*464Smark	@${PR} -h pwd.h ${INCLUDE}/pwd.h
96*464Smark	@${PR} -h setjmp.h ${INCLUDE}/setjmp.h
97*464Smark	@${PR} -h sgtty.h ${INCLUDE}/sgtty.h
98*464Smark	@${PR} -h signal.h ${INCLUDE}/signal.h
99*464Smark	@${PR} -h sys/dir.h ${INCLUDE}/sys/dir.h
100*464Smark	@${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h
101*464Smark	@${PR} -h sys/types.h ${INCLUDE}/sys/types.h
102*464Smark	@ls -ls | ${PR}
103*464Smark	@${CXREF} *.c | ${PR} -h XREF
104*464Smark	@${PR} *.h *.c
105