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