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