=/^G show total bytes now; document may not always work
[unix-history] / usr / src / usr.bin / ex / Makefile
CommitLineData
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#
816f581d 6# @(#)Makefile 7.23 (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#
816f581d 13# @(#)Makefile 7.23 (Berkeley) %G%
edf71f48
DF
14#
15#
816f581d
KB
16# Copyright (c) 1987 The Regents of the University of California.
17# All rights reserved.
edf71f48 18#
816f581d
KB
19# Redistribution and use in source and binary forms are permitted
20# provided that the above copyright notice and this paragraph are
21# duplicated in all such forms and that any documentation,
22# advertising materials, and other materials related to such
23# distribution and use acknowledge that the software was developed
24# by the University of California, Berkeley. The name of the
25# University may not be used to endorse or promote products derived
26# from this software without specific prior written permission.
27# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
28# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
29# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30#
31# @(#)Makefile 7.23 (Berkeley) %G%
eef6687d 32#
299f2784 33VERSION=3.7
fe10330d 34#
104844c7 35# Ex skeletal makefile for VAX VM/Unix 4.2BSD
fe10330d 36#
7c4625ef
MH
37# Ex is very large - this version will not fit on PDP-11's without overlay
38# software. Things that can be turned off to save
44232d5b
MH
39# space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL
40# (visual \ nonsense on upper case only terminals), CHDIR (the undocumented
14edf824 41# chdir command.) VMUNIX makes ex considerably larger, raising many limits
7c4625ef
MH
42# and improving speed and simplicity of maintenance. It is suitable only
43# for a VAX or other large machine, and then probably only in a paged system.
44232d5b
MH
44#
45# Don't define VFORK unless your system has the VFORK system call,
46# which is like fork but the two processes have only one data space until the
47# child execs. This speeds up ex by saving the memory copy.
fe10330d
MH
48#
49# If your system expands tabs to 4 spaces you should -DTABS=4 below
50#
51a16129
KB
51BINDIR= /usr/ucb
52NBINDIR= /usr/new
53LIBDIR= /usr/lib
7bcb0072 54OPTIONS= -DLISPCODE -DCHDIR -DUCVISUAL -DVFORK -DVMUNIX \
74a6e030 55 -DFASTTAG -DUNIX_SBRK
51a16129
KB
56CFLAGS= -DTABS=8 -O ${OPTIONS}
57LDFLAGS= -z # or -i or -n
58LIBC= /lib/libc.a
59
60OBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_data.o ex_extern.o \
61 ex_get.o ex_io.o ex_put.o ex_re.o ex_set.o ex_subr.o ex_tagio.o \
62 ex_temp.o ex_tty.o ex_unix.o ex_v.o ex_vadj.o ex_vget.o ex_vmain.o \
63 ex_voper.o ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
09d16450 64 printf.o strings.o
7c4625ef 65HDRS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
51a16129
KB
66SRCS= ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c ex_data.c ex_get.c \
67 ex_io.c ex_put.c ex_re.c ex_set.c ex_subr.c ex_tagio.c ex_temp.c \
68 ex_tty.c ex_unix.c ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c \
09d16450 69 ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c printf.c
816f581d 70MAN= ex.0 vi.0
44232d5b
MH
71
72.c.o:
04379bab 73# ifdef VMUNIX
51a16129 74 ${CC} -E ${CFLAGS} $*.c | xstr -c -
04379bab 75# else
51a16129
KB
76# mkstr - ex${VERSION}strings x $*.c
77# ${CC} -E ${CFLAGS} x$*.c | xstr -c -
44232d5b 78# rm -f x$*.c
04379bab 79# endif
44232d5b
MH
80 ${CC} ${CFLAGS} -c x.c
81 mv x.o $*.o
fe10330d 82
816f581d 83all: ex exrecover expreserve
44232d5b 84
51a16129
KB
85ex: ${OBJS} ${LIBC}
86 ${CC} ${LDFLAGS} ${OBJS} -ltermcap
44232d5b 87
51a16129 88ex_vars.h: ex_data.c
320413ac 89 csh makeoptions ${CFLAGS}
fe10330d 90
7c4625ef 91# xstr: hands off!
fe10330d 92strings.o: strings
51a16129 93 xstr
44232d5b 94 ${CC} -c -S xs.c
299f2784 95 ed - <rofix xs.s
8bcf1431 96 ${AS} -o strings.o xs.s
44232d5b 97 rm xs.s
fe10330d 98
51a16129
KB
99exrecover: exrecover.o ex_extern.o
100 ${CC} ${CFLAGS} exrecover.o ex_extern.o -o $@
fe10330d 101
9d3b8d0a
MK
102exrecover.o: exrecover.c
103 ${CC} ${CFLAGS} -c -O exrecover.c
104
51a16129
KB
105expreserve: expreserve.c
106 ${CC} ${CFLAGS} expreserve.c -o $@
fe10330d 107
9d3b8d0a
MK
108expreserve.o: expreserve.c
109 ${CC} ${CFLAGS} -c -O expreserve.c
110
8bcf1431 111clean:
08da79f7 112# If we dont have ex we cant make it so don't rm ex_vars.h
51a16129
KB
113 rm -f a.out exrecover expreserve strings core errs trace
114 rm -f *.o x*.[cs]
fe10330d 115
816f581d
KB
116cleandir: clean
117 rm -f ${MAN} tags .depend
118
119depend: ${SRCS}
51a16129 120 mkdep ${CFLAGS} ${SRCS}
fe10330d 121
7c4625ef 122# install in standard place (/usr/ucb)
816f581d 123install: ${MAN}
51a16129
KB
124 rm -f ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/vi \
125 ${DESTDIR}/${BINDIR}/view ${DESTDIR}/${BINDIR}/edit \
126 ${DESTDIR}/${BINDIR}/e ${DESTDIR}/usr/bin/ex
127 install -s -o bin -g bin -m 1755 a.out ${DESTDIR}/${BINDIR}/ex
128 install -s -o root -m 4755 exrecover ${DESTDIR}/${LIBDIR}/ex${VERSION}recover
129 install -s -o root -m 4755 expreserve ${DESTDIR}/${LIBDIR}/ex${VERSION}preserve
44232d5b 130# cp ex${VERSION}strings ${DESTDIR}/${LIBDIR}/ex${VERSION}strings
104844c7
SL
131 ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/edit
132 ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/e
133 ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/vi
134 ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/view
135 ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/usr/bin/ex
c0118b03 136 -[ -d ${DESTDIR}/usr/preserve ] || mkdir ${DESTDIR}/usr/preserve
816f581d 137 install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1
fe10330d 138
816f581d 139lint: ${SRCS}
51a16129
KB
140 lint ${CFLAGS} ${SRCS}
141 lint ${CFLAGS} exrecover.c ex_extern.c
7c4625ef 142 lint ${CFLAGS} expreserve.c
fe10330d 143
816f581d 144tags: ${SRCS}
51a16129
KB
145 ctags ${SRCS}
146 ctags -a exrecover.c
147 ctags -a expreserve.c
148 sort -o tags tags