ignore flags -R, -p*, -g*
[unix-history] / usr / src / old / pcc / lint / Makefile
CommitLineData
20e298ce 1#
3d79aa76 2# @(#)Makefile 1.21 (Berkeley) %G%
20e298ce 3#
3d79aa76
KB
4M=../../lib/mip
5P=../../lib/pcc
7184b3eb 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 15lpass1: cgram.o rodata.o comm1.o optim.o pftn.o scan.o trees.o xdefs.o \
ccff5ef5 16 lint.o hash.o rel.o
23d7f962 17 ${CC} ${CFLAGS} cgram.o rodata.o comm1.o optim.o pftn.o scan.o \
ccff5ef5 18 trees.o xdefs.o lint.o hash.o rel.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 26comm1.o: $M/manifest.h $M/pass1.h pcclocal.h $M/common.c macdefs.h
ccff5ef5 27 ln -s $M/common.c comm1.c
7184b3eb
RC
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 87llib-lcurses.ln: llib-lcurses lpass1
1672917d 88 -(/lib/cpp -C -Dlint -D__void__=__curses__ llib-lcurses | ./lpass1 -v > llib-lcurses.ln )
63ea8a04 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 94 ${CC} ${CFLAGS} -c -I$M -I. lpass2.c
4825013c
KB
95
96hash.o: hash.c
97 ${CC} ${CFLAGS} -c -I$M -I. hash.c
98
20e298ce 99lintall:
b022d271
SL
100 lint -hpv -I. -I$M $M/cgram.c $M/xdefs.c $M/scan.c \
101 $M/pftn.c $M/trees.c $M/optim.c lint.c
102
103install: all SHELL
dc18ff53
KB
104 install -s -o bin -g bin -m 755 lpass1 ${DESTDIR}/usr/lib/lint/lint1
105 install -s -o bin -g bin -m 755 lpass2 ${DESTDIR}/usr/lib/lint/lint2
106 for i in llib-*; do install -c -o bin -g bin -m 644 $$i ${DESTDIR}/usr/lib/lint; done
8188b6d0 107 -rm -f ${DESTDIR}/usr/lib/lint/llib-ltermlib*
23d7f962
DS
108 ln -s llib-ltermcap ${DESTDIR}/usr/lib/lint/llib-ltermlib
109 ln -s llib-ltermcap.ln ${DESTDIR}/usr/lib/lint/llib-ltermlib.ln
dc18ff53 110 install -c -o bin -g bin -m 755 SHELL ${DESTDIR}/usr/bin/lint
1dd488cb 111
b022d271 112shrink:
3a3d1a9a 113 rm -f *.o errs rodata.c pcctokens pcclocal.h
1dd488cb 114
b022d271 115clean: shrink
23d7f962
DS
116 rm -f lpass1 lpass2 cgram.c gram.in tags ${LINTLIBS}
117
118tags: ${SRCS}
119 ctags -w ${SRCS}
9496d389
KB
120
121depend: