Subversion Repositories planix.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
105 7u83 1
#
2
# Copyright (c) 1980 Regents of the University of California.
3
# All rights reserved.  The Berkeley software License Agreement
4
# specifies the terms and conditions for redistribution.
5
#
6
#	@(#)Makefile	7.13.1.3 (2.11BSD GTE) 1996/10/23
7
#
8
VERSION=3.7
9
#
10
# NB: This makefile doesn't indicate any dependencies on header files.
11
#
12
# Ex is very large - this version will not fit on PDP-11's without overlay
13
# software.  Things that can be turned off to save
14
# space include LISPCODE (-l flag, showmatch and lisp options), CHDIR (the 
15
# undocumented chdir command.)  VMUNIX makes ex considerably larger, raising 
16
# many limits and improving speed and simplicity of maintenance.  It is 
17
# suitable only for a VAX or other large machine, and then probably only in 
18
# a paged system.
19
#
20
# Don't define VFORK unless your system has the VFORK system call,
21
# which is like fork but the two processes have only one data space until the
22
# child execs. This speeds up ex by saving the memory copy.
23
#
24
# If your system expands tabs to 4 spaces you should -DTABS=4 below
25
#
26
BINDIR=	/usr/ucb
27
SBINDIR= /usr/sbin
28
MISCDIR= /usr/share/misc
29
FOLD=	${BINDIR}/fold
30
CTAGS=	${BINDIR}/ctags
31
XSTR=	${BINDIR}/xstr
32
DEBUGFLAGS=	-DTRACE -g
33
NONDEBUGFLAGS=	-O
34
DEB=	${NONDEBUGFLAGS}	# or ${DEBUGFLAGS} to to debug
35
#OPTIONS= -DLISPCODE -DCHDIR -DVFORK -DVMUNIX -DFASTTAG
36
OPTIONS= -DLISPCODE -DCHDIR -DVFORK -DFASTTAG
37
CFLAGS=	-DTABS=8 ${OPTIONS} ${DEB}
38
LDFLAGS= -X
39
SEPFLAG= -i
40
TERMLIB=	-ltermcap
41
MKSTR=	${BINDIR}/mkstr
42
CXREF=	${BINDIR}/cxref
43
INCLUDE=/usr/include
44
PR=	pr
45
OBJS=	ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
46
	ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \
47
	ex_set.o ex_subr.o ex_tagio.o ex_temp.o ex_tty.o ex_unix.o \
48
	ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \
49
	ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
50
	printf.o strings.o
51
HDRS=	ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
52
SRC1=	ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
53
SRC2=	ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
54
SRC3=	ex_set.c ex_subr.c ex_tagio.c ex_temp.c ex_tty.c ex_unix.c
55
SRC4=	ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c
56
SRC5=	ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
57
SRC6=	printf.c expreserve.c exrecover.c
58
MISC=	makefile READ_ME
59
VGRIND=	csh /usr/ucb/vgrind
60
VHDR=	"Ex Version ${VERSION}"
61
 
62
.c.o:
63
# ifdef VMUNIX
64
#	${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
65
# else
66
	${MKSTR} - exstrings x $*.c
67
	${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c -
68
	rm -f x$*.c
69
# endif
70
	${CC} ${CFLAGS} -c x.c 
71
	mv x.o $*.o
72
 
73
all:	a.out exrecover expreserve
74
 
75
# 11/23, 34, 40 and other non split I/D machines
76
# each of the 6 overlays must stay less than 16K.
77
 
78
a.out: ${OBJS}
79
	-if [ X${SEPFLAG} = X-i ]; then \
80
		ld ${LDFLAGS} /lib/crt0.o ${SEPFLAG} \
81
		    -Z ex_voper.o ex_vget.o ex_vops.o ex_vops2.o ex_vops3.o \
82
		    -Z ex_set.o ex_re.o ex_io.o ex_tty.o ex_unix.o ex.o ex_v.o \
83
		    -Y ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_tagio.o \
84
		       ex_get.o ex_temp.o ex_vadj.o ex_vmain.o ex_vwind.o\
85
		       ex_vput.o ex_put.o ex_subr.o printf.o strings.o \
86
		       ex_data.o ex_extern.o ${TERMLIB} -lc; \
87
	else \
88
		ld ${LDFLAGS} /lib/crt0.o ${SEPFLAG} \
89
		    -Z ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_tagio.o ex_re.o \
90
		    -Z ex_vadj.o ex_vmain.o ex_voper.o ex_vwind.o ex_vops3.o\
91
		    -Z ex_v.o ex_vget.o ex_vops.o ex_vops2.o ex_vput.o\
92
		    -Z ex_get.o ex_io.o ex_temp.o ex_tty.o ex_unix.o \
93
			ex_addr.o ex.o ex_set.o \
94
		    -Z ex_put.o ex_subr.o ${TERMLIB} \
95
		    -Y ex_data.o ex_extern.o printf.o strings.o -lc; \
96
	fi
97
 
98
tags:	/tmp
99
	${CTAGS} -w ex.[hc] ex_*.[hc]
100
 
101
${OBJS}: ${HDRS}
102
 
103
ex_vars.h:
104
	csh makeoptions ${CFLAGS}
105
 
106
# xstr: hands off!
107
strings.o: strings
108
	${XSTR}
109
	${CC} -c -o strings.o xs.c
110
 
111
exrecover: exrecover.o ex_extern.o
112
	${CC} ${SEPFLAG} ${CFLAGS} exrecover.o ex_extern.o -o exrecover
113
 
114
exrecover.o: exrecover.c
115
	${CC} ${CFLAGS} -c -O exrecover.c
116
 
117
expreserve: expreserve.o
118
	${CC} ${SEPFLAG} expreserve.o -o expreserve
119
 
120
expreserve.o:
121
	${CC} ${CFLAGS} -c -O expreserve.c
122
 
123
clean:
124
#	If we dont have ex we cant make it so don't rm ex_vars.h
125
	-rm -f a.out exrecover expreserve exstrings strings
126
	-rm -f *.o x*.[cs] core errs trace
127
 
128
# install in standard place (/usr/ucb)
129
install: a.out exrecover expreserve
130
	-rm -f ${DESTDIR}/${BINDIR}/ex
131
	-rm -f ${DESTDIR}/${BINDIR}/vi
132
	-rm -f ${DESTDIR}/${BINDIR}/view
133
	-rm -f ${DESTDIR}/usr/bin/ex
134
	install -s -m 1755 a.out ${DESTDIR}/${BINDIR}/ex
135
	install -c -m 444  exstrings ${DESTDIR}/${MISCDIR}/exstrings
136
	ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/vi
137
	ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/view
138
	ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/usr/bin/ex
139
	chmod 1755 ${DESTDIR}/${BINDIR}/ex
140
	install -s -o root -m 4755 exrecover ${DESTDIR}/${SBINDIR}/exrecover
141
	install -s -o root -m 4755 expreserve ${DESTDIR}/${SBINDIR}/expreserve
142
# The following line normally fails.  This is OK.
143
	-mkdir ${DESTDIR}/usr/preserve
144
 
145
lint:
146
	lint ${CFLAGS} ex.c ex_?*.c
147
	lint ${CFLAGS} -u exrecover.c
148
	lint ${CFLAGS} expreserve.c
149
 
150
print:
151
	@${PR} READ* BUGS
152
	@${PR} makefile*
153
	@${PR} /etc/termcap
154
	@(size -l a.out ; size *.o) | ${PR} -h sizes
155
	@${PR} -h errno.h ${INCLUDE}/errno.h
156
	@${PR} -h setjmp.h ${INCLUDE}/setjmp.h
157
	@${PR} -h sgtty.h ${INCLUDE}/sgtty.h
158
	@${PR} -h signal.h ${INCLUDE}/signal.h
159
	@${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h
160
	@${PR} -h sys/types.h ${INCLUDE}/sys/types.h
161
	@ls -ls | ${PR}
162
	@${CXREF} *.c | ${PR} -h XREF
163
	@${PR} *.h *.c
164
 
165
vgrind:
166
	tee index < /dev/null
167
	${VGRIND} -h ${VHDR} ${HDRS}
168
	${VGRIND} -h ${VHDR} ${SRC1}
169
	${VGRIND} -h ${VHDR} ${SRC2}
170
	${VGRIND} -h ${VHDR} ${SRC3}
171
	${VGRIND} -h ${VHDR} ${SRC4}
172
	${VGRIND} -h ${VHDR} ${SRC5}
173
	${VGRIND} -h ${VHDR} ${SRC6}
174
	${VGRIND} -n -h ${VHDR} ${MISC}
175
	${VGRIND} -i -h ${VHDR} index