Commit | Line | Data |
---|---|---|
d266c416 | 1 | VERSION=3.4 |
fe10330d | 2 | # |
44232d5b | 3 | # Ex skeletal makefile for version 7 |
fe10330d MH |
4 | # |
5 | # NB: This makefile doesn't indicate any dependencies on header files. | |
6 | # | |
44232d5b MH |
7 | # Ex is very large - it may not fit on PDP-11's depending on the operating |
8 | # system and the cflags you turn on. Things that can be turned off to save | |
9 | # space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL | |
10 | # (visual \ nonsense on upper case only terminals), CHDIR (the undocumented | |
11 | # chdir command.) | |
12 | # | |
13 | # Don't define VFORK unless your system has the VFORK system call, | |
14 | # which is like fork but the two processes have only one data space until the | |
15 | # child execs. This speeds up ex by saving the memory copy. | |
16 | # -DVMUNIX makes an ex which can edit very large files (eg the w2a dictionary) | |
17 | # this allows 200000 lines and about 16M byte temp files. | |
fe10330d MH |
18 | # |
19 | # If your system expands tabs to 4 spaces you should -DTABS=4 below | |
20 | # | |
44232d5b MH |
21 | # Ex is likely to overflow the symbol table in your C compiler. |
22 | # It can use -t0 which is (purportedly) a C compiler with a larger | |
23 | # symbol table. The -t1 flag to the C compiler is for a C compiler | |
24 | # which puts switch code in I space, increasing the text space size | |
25 | # to the benefit of per-user data space. If you don't have this it | |
26 | # doesn't matter much. Another method, which works on v7 pdp-11's, | |
27 | # is to use pcc for ex_io.c instead of cc. | |
fe10330d | 28 | # |
44232d5b MH |
29 | BINDIR= /usr/ucb |
30 | NBINDIR=/usr/new | |
fe10330d | 31 | LIBDIR= /usr/lib |
44232d5b MH |
32 | FOLD= ${BINDIR}/fold |
33 | CTAGS= ${BINDIR}/ctags | |
34 | XSTR= ${BINDIR}/xstr | |
35 | DEBUGFLAGS= -DTRACE | |
36 | NONDEBUGFLAGS= -O | |
37 | CFLAGS= -DTABS=8 -DLISPCODE -DCHDIR -DUCVISUAL -DMACROS -DVFORK -DVMUNIX ${NONDEBUGFLAGS} | |
38 | TERMLIB= -ltermlib | |
39 | MKSTR= ${BINDIR}/mkstr | |
40 | CXREF= ${BINDIR}/cxref | |
fe10330d MH |
41 | INCLUDE=/usr/include |
42 | PR= pr | |
43 | OBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_data.o ex_get.o \ | |
d266c416 | 44 | ex_io.o ex_put.o ex_re.o ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \ |
fe10330d MH |
45 | ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voperate.o \ |
46 | ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \ | |
47 | printf.o strings.o | |
48 | ||
44232d5b MH |
49 | all: a.out exrecover expreserve tags |
50 | ||
51 | .c.o: | |
52 | # ${MKSTR} - ex${VERSION}strings x $*.c | |
53 | ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - | |
54 | # rm -f x$*.c | |
55 | ${CC} ${CFLAGS} -c x.c | |
56 | mv x.o $*.o | |
fe10330d | 57 | |
44232d5b MH |
58 | a.out: ${OBJS} |
59 | cc -i ${OBJS} ${TERMLIB} | |
fe10330d MH |
60 | |
61 | tags: | |
44232d5b MH |
62 | ${CTAGS} -w *.h *.c |
63 | ||
64 | ${OBJS}: ex_vars.h | |
65 | ||
66 | ex_vars.h: | |
67 | csh makeoptions ${CFLAGS} | |
fe10330d MH |
68 | |
69 | strings.o: strings | |
70 | ${XSTR} | |
44232d5b MH |
71 | ${CC} -c -S xs.c |
72 | ed - <:rofix xs.s | |
73 | as -o strings.o xs.s | |
74 | rm xs.s | |
fe10330d MH |
75 | |
76 | exrecover: exrecover.o | |
44232d5b | 77 | ${CC} ${CFLAGS} exrecover.o -o exrecover |
fe10330d | 78 | |
44232d5b | 79 | exrecover.o: exrecover.c |
fe10330d MH |
80 | ${CC} ${CFLAGS} -c -O exrecover.c |
81 | ||
44232d5b MH |
82 | expreserve: expreserve.o |
83 | ${CC} expreserve.o -o expreserve | |
fe10330d MH |
84 | |
85 | expreserve.o: | |
44232d5b | 86 | ${CC} ${CFLAGS} -c -O expreserve.c |
fe10330d MH |
87 | |
88 | clean: | |
44232d5b MH |
89 | # If we dont have ex we cant make it so dont rm ex_vars.h |
90 | -rm -f a.out exrecover expreserve ex${VERSION}strings strings core trace tags | |
91 | -rm -f *.o x*.[cs] | |
fe10330d | 92 | |
44232d5b | 93 | ninstall: a.out |
d266c416 | 94 | -rm -f ${NBINDIR}/ex ${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view |
44232d5b MH |
95 | cp a.out ${NBINDIR}/ex |
96 | # -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings | |
97 | ln ${NBINDIR}/ex ${NBINDIR}/vi | |
d266c416 | 98 | ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view |
44232d5b | 99 | chmod 1755 ${NBINDIR}/ex |
fe10330d | 100 | |
44232d5b MH |
101 | install: a.out exrecover expreserve |
102 | -rm -f ${DESTDIR}${BINDIR}/ex | |
103 | -rm -f ${DESTDIR}${BINDIR}/vi | |
d266c416 | 104 | -rm -f ${DESTDIR}${BINDIR}/view |
44232d5b MH |
105 | -rm -f ${DESTDIR}${BINDIR}/edit |
106 | -rm -f ${DESTDIR}${BINDIR}/e | |
107 | -rm -f ${DESTDIR}/usr/bin/ex | |
108 | cp a.out ${DESTDIR}${BINDIR}/ex | |
109 | # cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings | |
110 | ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit | |
111 | ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e | |
112 | ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi | |
d266c416 | 113 | ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/view |
44232d5b MH |
114 | ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex |
115 | chmod 1755 ${DESTDIR}${BINDIR}/ex | |
116 | cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover | |
117 | cp expreserve ${DESTDIR}/${LIBDIR}/ex${VERSION}preserve | |
118 | chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve | |
119 | mkdir ${DESTDIR}/usr/preserve | |
fe10330d MH |
120 | |
121 | lint: | |
122 | lint ex.c ex_?*.c | |
123 | lint -u exrecover.c | |
124 | lint expreserve.c | |
125 | ||
126 | print: | |
fe10330d | 127 | @${PR} READ* BUGS |
44232d5b MH |
128 | @${PR} makefile* |
129 | @${PR} /etc/termcap | |
fe10330d | 130 | @(size -l a.out ; size *.o) | ${PR} -h sizes |
fe10330d | 131 | @${PR} -h errno.h ${INCLUDE}/errno.h |
fe10330d MH |
132 | @${PR} -h setjmp.h ${INCLUDE}/setjmp.h |
133 | @${PR} -h sgtty.h ${INCLUDE}/sgtty.h | |
134 | @${PR} -h signal.h ${INCLUDE}/signal.h | |
fe10330d MH |
135 | @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h |
136 | @${PR} -h sys/types.h ${INCLUDE}/sys/types.h | |
137 | @ls -ls | ${PR} | |
138 | @${CXREF} *.c | ${PR} -h XREF | |
139 | @${PR} *.h *.c |