avoid uneeded y.tab.c recompilation
[unix-history] / usr / src / old / pcc / lint / Makefile
CommitLineData
20e298ce 1#
7184b3eb 2# @(#)Makefile 1.9 (Berkeley) %G%
20e298ce 3#
1dd488cb 4M=/usr/src/lib/mip
7184b3eb
RC
5P=/usr/src/lib/pcc
6CFLAGS=-O
63ea8a04 7LINTLIBS=llib-port.ln llib-lc.ln llib-lm.ln llib-lmp.ln llib-lcurses.ln
b022d271
SL
8
9all: lpass1 lpass2 ${LINTLIBS}
10
7184b3eb
RC
11lpass1: cgram.o rodata.o comm1.o optim.o pftn.o scan.o trees.o xdefs.o \
12 lint.o hash.o
13 ${CC} cgram.o rodata.o comm1.o optim.o pftn.o scan.o trees.o xdefs.o \
b022d271
SL
14 lint.o hash.o -o lpass1
15
7184b3eb
RC
16cgram.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h cgram.c
17 $(CC) -c $(CFLAGS) -I$M -I. cgram.c
b022d271 18
7184b3eb
RC
19rodata.o: rodata.c
20 $(CC) -c $(CFLAGS) -R rodata.c
b022d271 21
7184b3eb
RC
22comm1.o: $M/manifest.h $M/pass1.h pcclocal.h $M/common.c macdefs.h
23 ln $M/common.c comm1.c
24 $(CC) -c $(CFLAGS) -I$M -I. -DPASS1COMMON comm1.c
25 rm -f comm1.c
b022d271 26
7184b3eb
RC
27optim.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/optim.c
28 $(CC) -c $(CFLAGS) -I$M -I. $M/optim.c
29
30pftn.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/pftn.c
31 $(CC) -c $(CFLAGS) -I$M -I. $M/pftn.c
b022d271 32
7184b3eb
RC
33scan.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/scan.c
34 $(CC) -c $(CFLAGS) -I$M -I. $M/scan.c
b022d271 35
7184b3eb
RC
36trees.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/trees.c
37 $(CC) -c $(CFLAGS) -I$M -I. $M/trees.c
b022d271 38
7184b3eb
RC
39xdefs.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h $M/xdefs.c
40 $(CC) -c $(CFLAGS) -I$M -I. $M/xdefs.c
b022d271 41
7184b3eb
RC
42rodata.c cgram.c: $M/cgram.y pcctokens
43 cat pcctokens $M/cgram.y > gram.in
44 $(YACC) gram.in
45 rm -f rodata.c
46 sh ./:yyfix yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef
20e298ce 47 mv y.tab.c cgram.c
b022d271 48
7184b3eb
RC
49GREP= egrep
50
51pcclocal.h: $P/localdefs.h /usr/include/pcc.h
52 rm -f pcclocal.h
53 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
54
55pcctokens: $P/localdefs.h /usr/include/pcc.h
56 rm -f pcctokens
57 cat /usr/include/pcc.h $P/localdefs.h | $(GREP) '^#[ ]*define[ ][ ]*PCC_' | sed -e 's/^#[ ]*define[ ][ ]*PCC_/%term /' > pcctokens
58
59lint.o: $M/manifest.h macdefs.h $M/pass1.h lmanifest.h
60 ${CC} -c ${CFLAGS} -I$M -I. lint.c
b022d271 61
20e298ce
RH
62llib-port.ln: llib-port lpass1
63 -(/lib/cpp -C -Dlint llib-port | ./lpass1 -puv > llib-port.ln )
b022d271
SL
64
65llib-lm.ln: llib-lm lpass1
66 -(/lib/cpp -C -Dlint llib-lm | ./lpass1 -puv > llib-lm.ln )
67
68llib-lmp.ln: llib-lmp lpass1
69 -(/lib/cpp -C -Dlint llib-lmp | ./lpass1 -puv > llib-lmp.ln )
70
20e298ce
RH
71llib-lc.ln: llib-lc lpass1
72 -(/lib/cpp -C -Dlint llib-lc | ./lpass1 -v > llib-lc.ln )
b022d271 73
63ea8a04
BJ
74llib-lcurses.ln: llib-lcurses lpass1
75 -(/lib/cpp -C -Dlint llib-lcurses | ./lpass1 -v > llib-lcurses.ln )
76
06337354 77lpass2: lpass2.o hash.o
b022d271
SL
78 ${CC} lpass2.o hash.o -o lpass2
79
7184b3eb 80lpass2.o: $M/manifest.h lmanifest.h pcclocal.h macdefs.h
b022d271
SL
81 ${CC} ${CFLAGS} -c -I$M -I. lpass2.c
82
20e298ce 83lintall:
b022d271
SL
84 lint -hpv -I. -I$M $M/cgram.c $M/xdefs.c $M/scan.c \
85 $M/pftn.c $M/trees.c $M/optim.c lint.c
86
87install: all SHELL
88 install -s lpass1 ${DESTDIR}/usr/lib/lint/lint1
89 install -s lpass2 ${DESTDIR}/usr/lib/lint/lint2
6258b052 90 for i in llib-*; do install -c -m 644 $$i ${DESTDIR}/usr/lib/lint; done
7bc3dcd4 91 install -c SHELL ${DESTDIR}/usr/bin/lint
1dd488cb 92
b022d271 93shrink:
7184b3eb 94 rm -f *.o errs
1dd488cb 95
b022d271 96clean: shrink
7184b3eb 97 rm -f lpass1 lpass2 cgram.c gram.in ${LINTLIBS}