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