update for pcc dir move; add rel.c reference; use symbolic link to comm1.c
[unix-history] / usr / src / old / pcc / lint / Makefile
CommitLineData
20e298ce 1#
ccff5ef5 2# @(#)Makefile 1.14 (Berkeley) %G%
20e298ce 3#
1dd488cb 4M=/usr/src/lib/mip
ccff5ef5
SL
5#ifdef vax
6#P=/usr/src/lib/pcc.vax
7#else
8P=/usr/src/lib/pcc.tahoe
9#endif
7184b3eb 10CFLAGS=-O
8188b6d0
DS
11LINTLIBS=llib-port.ln llib-lc.ln llib-lcurses.ln llib-ldbm.ln llib-lm.ln \
12 llib-lmp.ln llib-lplot.ln llib-ltermcap.ln
23d7f962
DS
13SRCS= $M/cgram.y $M/common.c $M/optim.c $M/pftn.c $M/scan.c $M/trees.c \
14 $M/xdefs.c lint.c hash.c $M/pass1.h $M/manifest.h macdefs.h \
15 lpass2.c
b022d271
SL
16
17all: lpass1 lpass2 ${LINTLIBS}
18
7184b3eb 19lpass1: cgram.o rodata.o comm1.o optim.o pftn.o scan.o trees.o xdefs.o \
ccff5ef5 20 lint.o hash.o rel.o
23d7f962 21 ${CC} ${CFLAGS} cgram.o rodata.o comm1.o optim.o pftn.o scan.o \
ccff5ef5 22 trees.o xdefs.o lint.o hash.o rel.o -o lpass1
b022d271 23
7184b3eb
RC
24cgram.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h cgram.c
25 $(CC) -c $(CFLAGS) -I$M -I. cgram.c
b022d271 26
7184b3eb
RC
27rodata.o: rodata.c
28 $(CC) -c $(CFLAGS) -R rodata.c
b022d271 29
7184b3eb 30comm1.o: $M/manifest.h $M/pass1.h pcclocal.h $M/common.c macdefs.h
ccff5ef5 31 ln -s $M/common.c comm1.c
7184b3eb
RC
32 $(CC) -c $(CFLAGS) -I$M -I. -DPASS1COMMON comm1.c
33 rm -f comm1.c
b022d271 34
7184b3eb
RC
35optim.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/optim.c
36 $(CC) -c $(CFLAGS) -I$M -I. $M/optim.c
37
38pftn.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/pftn.c
39 $(CC) -c $(CFLAGS) -I$M -I. $M/pftn.c
b022d271 40
7184b3eb
RC
41scan.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/scan.c
42 $(CC) -c $(CFLAGS) -I$M -I. $M/scan.c
b022d271 43
7184b3eb
RC
44trees.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/trees.c
45 $(CC) -c $(CFLAGS) -I$M -I. $M/trees.c
b022d271 46
7184b3eb
RC
47xdefs.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h $M/xdefs.c
48 $(CC) -c $(CFLAGS) -I$M -I. $M/xdefs.c
b022d271 49
ccff5ef5
SL
50rel.o: $P/rel.c
51 ${CC} -c ${CFLAGS} $P/rel.c
52
7184b3eb
RC
53rodata.c cgram.c: $M/cgram.y pcctokens
54 cat pcctokens $M/cgram.y > gram.in
55 $(YACC) gram.in
56 rm -f rodata.c
57 sh ./:yyfix yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef
20e298ce 58 mv y.tab.c cgram.c
b022d271 59
7184b3eb
RC
60GREP= egrep
61
62pcclocal.h: $P/localdefs.h /usr/include/pcc.h
63 rm -f pcclocal.h
64 cat /usr/include/pcc.h $P/localdefs.h | $(GREP) '^#[ ]*(define[ ][ ]*PCC(F|T|TM|OM)?_|ifdef|ifndef|endif)' | sed -e 's/PCC[A-Z]*_//' > pcclocal.h
65
66pcctokens: $P/localdefs.h /usr/include/pcc.h
67 rm -f pcctokens
68 cat /usr/include/pcc.h $P/localdefs.h | $(GREP) '^#[ ]*define[ ][ ]*PCC_' | sed -e 's/^#[ ]*define[ ][ ]*PCC_/%term /' > pcctokens
69
70lint.o: $M/manifest.h macdefs.h $M/pass1.h lmanifest.h
71 ${CC} -c ${CFLAGS} -I$M -I. lint.c
b022d271 72
20e298ce
RH
73llib-port.ln: llib-port lpass1
74 -(/lib/cpp -C -Dlint llib-port | ./lpass1 -puv > llib-port.ln )
b022d271 75
8188b6d0 76llib-ldbm.ln: llib-ldbm lpass1
21bee4e0 77 -(/lib/cpp -C -Dlint llib-ldbm | ./lpass1 -uv > llib-ldbm.ln )
8188b6d0 78
b022d271 79llib-lm.ln: llib-lm lpass1
21bee4e0 80 -(/lib/cpp -C -Dlint llib-lm | ./lpass1 -uv > llib-lm.ln )
b022d271
SL
81
82llib-lmp.ln: llib-lmp lpass1
21bee4e0 83 -(/lib/cpp -C -Dlint llib-lmp | ./lpass1 -uv > llib-lmp.ln )
b022d271 84
8188b6d0 85llib-lplot.ln: llib-lplot lpass1
21bee4e0 86 -(/lib/cpp -C -Dlint llib-lplot | ./lpass1 -uv > llib-lplot.ln )
8188b6d0
DS
87
88llib-ltermcap.ln: llib-ltermcap lpass1
21bee4e0 89 -(/lib/cpp -C -Dlint llib-ltermcap | ./lpass1 -uv > llib-ltermcap.ln )
8188b6d0 90
20e298ce
RH
91llib-lc.ln: llib-lc lpass1
92 -(/lib/cpp -C -Dlint llib-lc | ./lpass1 -v > llib-lc.ln )
b022d271 93
63ea8a04
BJ
94llib-lcurses.ln: llib-lcurses lpass1
95 -(/lib/cpp -C -Dlint llib-lcurses | ./lpass1 -v > llib-lcurses.ln )
96
06337354 97lpass2: lpass2.o hash.o
23d7f962 98 ${CC} ${CFLAGS} lpass2.o hash.o -o lpass2
b022d271 99
7184b3eb 100lpass2.o: $M/manifest.h lmanifest.h pcclocal.h macdefs.h
b022d271
SL
101 ${CC} ${CFLAGS} -c -I$M -I. lpass2.c
102
20e298ce 103lintall:
b022d271
SL
104 lint -hpv -I. -I$M $M/cgram.c $M/xdefs.c $M/scan.c \
105 $M/pftn.c $M/trees.c $M/optim.c lint.c
106
107install: all SHELL
108 install -s lpass1 ${DESTDIR}/usr/lib/lint/lint1
109 install -s lpass2 ${DESTDIR}/usr/lib/lint/lint2
6258b052 110 for i in llib-*; do install -c -m 644 $$i ${DESTDIR}/usr/lib/lint; done
8188b6d0 111 -rm -f ${DESTDIR}/usr/lib/lint/llib-ltermlib*
23d7f962
DS
112 ln -s llib-ltermcap ${DESTDIR}/usr/lib/lint/llib-ltermlib
113 ln -s llib-ltermcap.ln ${DESTDIR}/usr/lib/lint/llib-ltermlib.ln
7bc3dcd4 114 install -c SHELL ${DESTDIR}/usr/bin/lint
1dd488cb 115
b022d271 116shrink:
3a3d1a9a 117 rm -f *.o errs rodata.c pcctokens pcclocal.h
1dd488cb 118
b022d271 119clean: shrink
23d7f962
DS
120 rm -f lpass1 lpass2 cgram.c gram.in tags ${LINTLIBS}
121
122tags: ${SRCS}
123 ctags -w ${SRCS}