Commit | Line | Data |
---|---|---|
eef6687d DF |
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 | # | |
5a6c967e | 6 | # @(#)Makefile 7.14 (Berkeley) %G% |
edf71f48 DF |
7 | # |
8 | # | |
9 | # Copyright (c) 1980 Regents of the University of California. | |
10 | # All rights reserved. The Berkeley software License Agreement | |
11 | # specifies the terms and conditions for redistribution. | |
12 | # | |
5a6c967e | 13 | # @(#)Makefile 7.14 (Berkeley) %G% |
edf71f48 DF |
14 | # |
15 | # | |
16 | # Copyright (c) 1980 Regents of the University of California. | |
17 | # All rights reserved. The Berkeley software License Agreement | |
18 | # specifies the terms and conditions for redistribution. | |
19 | # | |
5a6c967e | 20 | # @(#)Makefile 7.14 (Berkeley) %G% |
eef6687d | 21 | # |
299f2784 | 22 | VERSION=3.7 |
fe10330d | 23 | # |
104844c7 | 24 | # Ex skeletal makefile for VAX VM/Unix 4.2BSD |
fe10330d MH |
25 | # |
26 | # NB: This makefile doesn't indicate any dependencies on header files. | |
27 | # | |
7c4625ef MH |
28 | # Ex is very large - this version will not fit on PDP-11's without overlay |
29 | # software. Things that can be turned off to save | |
44232d5b MH |
30 | # space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL |
31 | # (visual \ nonsense on upper case only terminals), CHDIR (the undocumented | |
14edf824 | 32 | # chdir command.) VMUNIX makes ex considerably larger, raising many limits |
7c4625ef MH |
33 | # and improving speed and simplicity of maintenance. It is suitable only |
34 | # for a VAX or other large machine, and then probably only in a paged system. | |
44232d5b MH |
35 | # |
36 | # Don't define VFORK unless your system has the VFORK system call, | |
37 | # which is like fork but the two processes have only one data space until the | |
38 | # child execs. This speeds up ex by saving the memory copy. | |
fe10330d MH |
39 | # |
40 | # If your system expands tabs to 4 spaces you should -DTABS=4 below | |
41 | # | |
44232d5b MH |
42 | BINDIR= /usr/ucb |
43 | NBINDIR=/usr/new | |
fe10330d | 44 | LIBDIR= /usr/lib |
44232d5b MH |
45 | FOLD= ${BINDIR}/fold |
46 | CTAGS= ${BINDIR}/ctags | |
47 | XSTR= ${BINDIR}/xstr | |
f0f2d980 | 48 | DEBUGFLAGS= -DTRACE -g |
7cc1f963 | 49 | NONDEBUGFLAGS= -O |
7c4625ef | 50 | DEB= ${NONDEBUGFLAGS} # or ${DEBUGFLAGS} to to debug |
14edf824 | 51 | OPTIONS= -DLISPCODE -DCHDIR -DUCVISUAL -DVFORK -DVMUNIX -DFASTTAG |
6fd7f32b | 52 | CFLAGS= -DTABS=8 ${OPTIONS} ${DEB} |
7c4625ef | 53 | LDFLAGS= -z # or -i or -n |
04379bab | 54 | TERMLIB= -ltermcap |
44232d5b MH |
55 | MKSTR= ${BINDIR}/mkstr |
56 | CXREF= ${BINDIR}/cxref | |
fe10330d MH |
57 | INCLUDE=/usr/include |
58 | PR= pr | |
7c4625ef | 59 | OBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \ |
299f2784 | 60 | ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \ |
3e460cf5 | 61 | ex_set.o ex_subr.o ex_tagio.o ex_temp.o ex_tty.o ex_unix.o \ |
04379bab | 62 | ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \ |
fe10330d | 63 | ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \ |
7cc1f963 | 64 | printf.o bcopy.o strings.o |
7c4625ef MH |
65 | HDRS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h |
66 | SRC1= ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c | |
67 | SRC2= ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c | |
3e460cf5 | 68 | SRC3= ex_set.c ex_subr.c ex_tagio.c ex_temp.c ex_tty.c ex_unix.c |
04379bab | 69 | SRC4= ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c |
7c4625ef | 70 | SRC5= ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c |
7cc1f963 | 71 | SRC6= printf.c bcopy.c expreserve.c exrecover.c |
299f2784 | 72 | MISC= makefile READ_ME rofix |
7c4625ef MH |
73 | VGRIND= csh /usr/ucb/vgrind |
74 | VHDR= "Ex Version ${VERSION}" | |
44232d5b MH |
75 | |
76 | .c.o: | |
04379bab | 77 | # ifdef VMUNIX |
44232d5b | 78 | ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - |
04379bab MH |
79 | # else |
80 | # ${MKSTR} - ex${VERSION}strings x $*.c | |
81 | # ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c - | |
44232d5b | 82 | # rm -f x$*.c |
04379bab | 83 | # endif |
44232d5b MH |
84 | ${CC} ${CFLAGS} -c x.c |
85 | mv x.o $*.o | |
fe10330d | 86 | |
869f8915 | 87 | all: a.out exrecover expreserve |
104844c7 | 88 | |
44232d5b | 89 | a.out: ${OBJS} |
dd870a94 SL |
90 | @echo loading a.out |
91 | @${CC} ${LDFLAGS} ${OBJS} ${TERMLIB} | |
fe10330d | 92 | |
7c4625ef MH |
93 | tags: /tmp |
94 | ${CTAGS} -w ex.[hc] ex_*.[hc] | |
44232d5b | 95 | |
08da79f7 | 96 | ${OBJS}: ${HDRS} |
44232d5b | 97 | |
5a6c967e | 98 | ex_vars.h: ex_data.c |
320413ac | 99 | csh makeoptions ${CFLAGS} |
fe10330d | 100 | |
7c4625ef | 101 | bcopy.o: bcopy.c |
8bcf1431 | 102 | ${CC} -c ${CFLAGS} bcopy.c |
7c4625ef MH |
103 | |
104 | # xstr: hands off! | |
fe10330d MH |
105 | strings.o: strings |
106 | ${XSTR} | |
44232d5b | 107 | ${CC} -c -S xs.c |
299f2784 | 108 | ed - <rofix xs.s |
8bcf1431 | 109 | ${AS} -o strings.o xs.s |
44232d5b | 110 | rm xs.s |
fe10330d MH |
111 | |
112 | exrecover: exrecover.o | |
93e88407 | 113 | ${CC} ${CFLAGS} exrecover.o ex_extern.o -o exrecover |
fe10330d | 114 | |
44232d5b | 115 | exrecover.o: exrecover.c |
fe10330d MH |
116 | ${CC} ${CFLAGS} -c -O exrecover.c |
117 | ||
44232d5b | 118 | expreserve: expreserve.o |
cb3ac212 | 119 | ${CC} expreserve.o -o expreserve |
fe10330d MH |
120 | |
121 | expreserve.o: | |
44232d5b | 122 | ${CC} ${CFLAGS} -c -O expreserve.c |
fe10330d | 123 | |
8bcf1431 | 124 | clean: |
08da79f7 | 125 | # If we dont have ex we cant make it so don't rm ex_vars.h |
7c4625ef | 126 | -rm -f a.out exrecover expreserve strings core errs trace |
44232d5b | 127 | -rm -f *.o x*.[cs] |
fe10330d | 128 | |
7c4625ef | 129 | # install a new version for testing in /usr/new |
44232d5b | 130 | ninstall: a.out |
7c4625ef MH |
131 | -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view |
132 | cp a.out ${DESTDIR}${NBINDIR}/ex | |
44232d5b | 133 | # -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings |
7c4625ef | 134 | ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi |
d266c416 | 135 | ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view |
7c4625ef | 136 | chmod 1755 ${DESTDIR}${NBINDIR}/ex |
fe10330d | 137 | |
7c4625ef | 138 | # install in standard place (/usr/ucb) |
44232d5b | 139 | install: a.out exrecover expreserve |
104844c7 SL |
140 | -rm -f ${DESTDIR}/${BINDIR}/ex |
141 | -rm -f ${DESTDIR}/${BINDIR}/vi | |
142 | -rm -f ${DESTDIR}/${BINDIR}/view | |
143 | -rm -f ${DESTDIR}/${BINDIR}/edit | |
144 | -rm -f ${DESTDIR}/${BINDIR}/e | |
44232d5b | 145 | -rm -f ${DESTDIR}/usr/bin/ex |
104844c7 | 146 | install -s -m 1755 a.out ${DESTDIR}/${BINDIR}/ex |
44232d5b | 147 | # cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings |
104844c7 SL |
148 | ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/edit |
149 | ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/e | |
150 | ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/vi | |
151 | ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/view | |
152 | ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/usr/bin/ex | |
153 | chmod 1755 ${DESTDIR}/${BINDIR}/ex | |
9317c4ff KM |
154 | install -s -o root -m 4755 exrecover ${DESTDIR}/${LIBDIR}/ex${VERSION}recover |
155 | install -s -o root -m 4755 expreserve ${DESTDIR}/${LIBDIR}/ex${VERSION}preserve | |
7c4625ef | 156 | # The following line normally fails. This is OK. |
04379bab | 157 | -mkdir ${DESTDIR}/usr/preserve |
fe10330d | 158 | |
7c4625ef MH |
159 | # move from /usr/new to /usr/ucb |
160 | newucb: a.out | |
104844c7 SL |
161 | -rm -f ${DESTDIR}/${BINDIR}/ex |
162 | -rm -f ${DESTDIR}/${BINDIR}/vi | |
163 | -rm -f ${DESTDIR}/${BINDIR}/edit | |
164 | -rm -f ${DESTDIR}/${BINDIR}/e | |
7c4625ef | 165 | -rm -f ${DESTDIR}/usr/bin/ex |
104844c7 SL |
166 | mv ${DESTDIR}/${NBINDIR}/ex ${DESTDIR}/${NBINDIR}/ex |
167 | -rm -f ${DESTDIR}/${NBINDIR}/vi | |
168 | ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/edit | |
169 | ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/e | |
170 | ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/vi | |
171 | ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/usr/bin/ex | |
172 | chmod 1755 ${DESTDIR}/${BINDIR}/ex | |
7c4625ef | 173 | |
fe10330d | 174 | lint: |
7c4625ef MH |
175 | lint ${CFLAGS} ex.c ex_?*.c |
176 | lint ${CFLAGS} -u exrecover.c | |
177 | lint ${CFLAGS} expreserve.c | |
fe10330d MH |
178 | |
179 | print: | |
fe10330d | 180 | @${PR} READ* BUGS |
44232d5b MH |
181 | @${PR} makefile* |
182 | @${PR} /etc/termcap | |
fe10330d | 183 | @(size -l a.out ; size *.o) | ${PR} -h sizes |
fe10330d | 184 | @${PR} -h errno.h ${INCLUDE}/errno.h |
fe10330d MH |
185 | @${PR} -h setjmp.h ${INCLUDE}/setjmp.h |
186 | @${PR} -h sgtty.h ${INCLUDE}/sgtty.h | |
187 | @${PR} -h signal.h ${INCLUDE}/signal.h | |
fe10330d MH |
188 | @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h |
189 | @${PR} -h sys/types.h ${INCLUDE}/sys/types.h | |
190 | @ls -ls | ${PR} | |
191 | @${CXREF} *.c | ${PR} -h XREF | |
192 | @${PR} *.h *.c | |
7c4625ef MH |
193 | vgrind: |
194 | tee index < /dev/null | |
5838215a MH |
195 | ${VGRIND} -h ${VHDR} ${HDRS} |
196 | ${VGRIND} -h ${VHDR} ${SRC1} | |
197 | ${VGRIND} -h ${VHDR} ${SRC2} | |
7c4625ef MH |
198 | ${VGRIND} -h ${VHDR} ${SRC3} |
199 | ${VGRIND} -h ${VHDR} ${SRC4} | |
200 | ${VGRIND} -h ${VHDR} ${SRC5} | |
201 | ${VGRIND} -h ${VHDR} ${SRC6} | |
5838215a | 202 | ${VGRIND} -n -h ${VHDR} ${MISC} |
7c4625ef | 203 | ${VGRIND} -i -h ${VHDR} index |