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