allow setenv with 0 and 1 arugments:
[unix-history] / usr / src / bin / csh / Makefile
CommitLineData
fef62a9f 1#
bf6c5a0b 2# @(#)Makefile 4.8 (Berkeley) %G%
fef62a9f
BJ
3#
4# C Shell with process control; VM/UNIX VAX Makefile
5# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
6#
35371dec
EW
7# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
8
9DEFS= -DTELL -DVFORK -DFILEC
10CFLAGS= $(DEFS) -O
fef62a9f 11XSTR= /usr/ucb/xstr
35371dec 12AS= as
fef62a9f
BJ
13RM= -rm
14CXREF= /usr/ucb/cxref
15VGRIND= csh /usr/ucb/vgrind
16CTAGS= /usr/ucb/ctags
6ca601c1 17LIBES=
bd9be69e 18SCCS= sccs
fef62a9f 19
35371dec
EW
20OBJS= alloc.o doprnt.o printf.o sh.o sh.char.o sh.dir.o sh.dol.o sh.err.o \
21 sh.exec.o sh.exp.o sh.file.o sh.func.o sh.glob.o sh.hist.o sh.init.o \
22 sh.lex.o sh.misc.o sh.parse.o sh.print.o sh.proc.o sh.sem.o sh.set.o \
23 sh.time.o
fef62a9f
BJ
24
25# Special massaging of C files for sharing of strings
26.c.o:
27 ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
28 ${CC} -c ${CFLAGS} x.c
f7f80f24 29 mv -f x.o $*.o
644ec8bb 30 rm -f x.c
fef62a9f 31
35371dec
EW
32# strings.o must be last since it can change when previous files compile
33csh: ${OBJS} strings.o
fef62a9f 34 rm -f csh
35371dec 35 ${CC} ${OBJS} strings.o -o csh ${LIBES}
fef62a9f
BJ
36
37.DEFAULT:
38 ${SCCS} get $<
39
40# need an old doprnt, whose output we can trap
41doprnt.o: doprnt.c
35371dec 42 ${CC} -E doprnt.c | ${AS} -o doprnt.o
fef62a9f
BJ
43
44# strings.o and sh.init.o are specially processed to be shared
45strings.o: strings
46 ${XSTR}
47 ${CC} -c -R xs.c
f7f80f24 48 mv -f xs.o strings.o
644ec8bb 49 rm -f xs.c
fef62a9f
BJ
50
51sh.init.o:
52 ${CC} -E ${CFLAGS} sh.init.c | ${XSTR} -c -
53 ${CC} ${CFLAGS} -c -R x.c
f7f80f24 54 mv -f x.o sh.init.o
644ec8bb 55 rm -f x.c
fef62a9f
BJ
56
57lint:
35371dec 58 lint -z ${DEFS} sh*.c alloc.c
fef62a9f
BJ
59
60print:
61 @pr READ_ME
62 @pr makefile makefile.*
63 @(size -l a.out; size *.o) | pr -h SIZES
64 @${CXREF} sh*.c | pr -h XREF
65 @ls -l | pr
66 @pr sh*.h [a-rt-z]*.h sh*.c alloc.c
67
68vprint:
69 @pr -l84 READ_ME TODO
70 @pr -l84 makefile makefile.*
71 @(size -l a.out; size *.o) | pr -l84 -h SIZES
72 @${CXREF} sh*.c | pr -l84 -h XREF
73 @ls -l | pr -l84
74 @${CXREF} sh*.c | pr -l84 -h XREF
75 @pr -l84 sh*.h [a-rt-z]*.h sh*.c alloc.c
76
77vgrind:
78 @cp /dev/null index
79 @for i in *.h; do vgrind -t -h "C Shell" $$i >/crp/bill/csh/$$i.t; done
80 @for i in *.c; do vgrind -t -h "C Shell" $$i >/crp/bill/csh/$$i.t; done
81 @vgrind -t -x -h Index index >/crp/bill/csh/index.t
82
35371dec 83install: csh
fef62a9f
BJ
84 install -s csh ${DESTDIR}/bin/csh
85
86clean:
2f2a0649 87 ${RM} -f a.out strings x.c xs.c csh errs
35371dec
EW
88 ${RM} -f *.o
89
90tags:
91 ${CTAGS} *.h sh*.c
fef62a9f 92
bd9be69e 93sh.o: sh.h sh.local.h
35371dec 94sh.char.o: sh.char.h
bd9be69e
EW
95sh.dir.o: sh.h sh.local.h sh.dir.h
96sh.dol.o: sh.h sh.local.h sh.char.h
97sh.err.o: sh.h sh.local.h
98sh.exec.o: sh.h sh.local.h
99sh.exp.o: sh.h sh.local.h
100sh.file.o: sh.h sh.local.h
101sh.func.o: sh.h sh.local.h
102sh.glob.o: sh.h sh.local.h sh.char.h
103sh.hist.o: sh.h sh.local.h
35371dec 104sh.init.o: sh.local.h
bd9be69e
EW
105sh.lex.o: sh.h sh.local.h sh.char.h
106sh.misc.o: sh.h sh.local.h
107sh.parse.o: sh.h sh.local.h
108sh.print.o: sh.h sh.local.h
109sh.proc.o: sh.h sh.local.h sh.dir.h sh.proc.h
110sh.sem.o: sh.h sh.local.h sh.proc.h
111sh.set.o: sh.h sh.local.h
112sh.time.o: sh.h sh.local.h