release 3.2, Jan 4, 1980
[unix-history] / usr / src / usr.bin / ex / Makefile
CommitLineData
44232d5b 1VERSION=3.2
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
29BINDIR= /usr/ucb
30NBINDIR=/usr/new
fe10330d 31LIBDIR= /usr/lib
44232d5b
MH
32FOLD= ${BINDIR}/fold
33CTAGS= ${BINDIR}/ctags
34XSTR= ${BINDIR}/xstr
35DEBUGFLAGS= -DTRACE
36NONDEBUGFLAGS= -O
37CFLAGS= -DTABS=8 -DLISPCODE -DCHDIR -DUCVISUAL -DMACROS -DVFORK -DVMUNIX ${NONDEBUGFLAGS}
38TERMLIB= -ltermlib
39MKSTR= ${BINDIR}/mkstr
40CXREF= ${BINDIR}/cxref
fe10330d
MH
41INCLUDE=/usr/include
42PR= pr
43OBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_data.o ex_get.o \
44 ex_io.o ex_put.o ex_re.o ex_set.o ex_subr.o ex_temp.o ex_tty.o \
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
49all: 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
58a.out: ${OBJS}
59 cc -i ${OBJS} ${TERMLIB}
fe10330d
MH
60
61tags:
44232d5b
MH
62 ${CTAGS} -w *.h *.c
63
64${OBJS}: ex_vars.h
65
66ex_vars.h:
67 csh makeoptions ${CFLAGS}
fe10330d
MH
68
69strings.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
76exrecover: exrecover.o
44232d5b 77 ${CC} ${CFLAGS} exrecover.o -o exrecover
fe10330d 78
44232d5b 79exrecover.o: exrecover.c
fe10330d
MH
80 ${CC} ${CFLAGS} -c -O exrecover.c
81
44232d5b
MH
82expreserve: expreserve.o
83 ${CC} expreserve.o -o expreserve
fe10330d
MH
84
85expreserve.o:
44232d5b 86 ${CC} ${CFLAGS} -c -O expreserve.c
fe10330d
MH
87
88clean:
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
MH
93ninstall: a.out
94 -rm -f ${NBINDIR}/ex ${NBINDIR}/vi
95 cp a.out ${NBINDIR}/ex
96# -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings
97 ln ${NBINDIR}/ex ${NBINDIR}/vi
98 chmod 1755 ${NBINDIR}/ex
fe10330d 99
44232d5b
MH
100install: a.out exrecover expreserve
101 -rm -f ${DESTDIR}${BINDIR}/ex
102 -rm -f ${DESTDIR}${BINDIR}/vi
103 -rm -f ${DESTDIR}${BINDIR}/edit
104 -rm -f ${DESTDIR}${BINDIR}/e
105 -rm -f ${DESTDIR}/usr/bin/ex
106 cp a.out ${DESTDIR}${BINDIR}/ex
107# cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings
108 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
109 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
110 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
111 ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
112 chmod 1755 ${DESTDIR}${BINDIR}/ex
113 cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover
114 cp expreserve ${DESTDIR}/${LIBDIR}/ex${VERSION}preserve
115 chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
116 mkdir ${DESTDIR}/usr/preserve
fe10330d
MH
117
118lint:
119 lint ex.c ex_?*.c
120 lint -u exrecover.c
121 lint expreserve.c
122
123print:
fe10330d 124 @${PR} READ* BUGS
44232d5b
MH
125 @${PR} makefile*
126 @${PR} /etc/termcap
fe10330d 127 @(size -l a.out ; size *.o) | ${PR} -h sizes
fe10330d 128 @${PR} -h errno.h ${INCLUDE}/errno.h
fe10330d
MH
129 @${PR} -h setjmp.h ${INCLUDE}/setjmp.h
130 @${PR} -h sgtty.h ${INCLUDE}/sgtty.h
131 @${PR} -h signal.h ${INCLUDE}/signal.h
fe10330d
MH
132 @${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h
133 @${PR} -h sys/types.h ${INCLUDE}/sys/types.h
134 @ls -ls | ${PR}
135 @${CXREF} *.c | ${PR} -h XREF
136 @${PR} *.h *.c