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