file reorg, pathnames.h, paths.h
[unix-history] / usr / src / old / pcc / lint / Makefile
CommitLineData
20e298ce 1#
dc0e9d50 2# @(#)Makefile 1.24 (Berkeley) %G%
20e298ce 3#
dc0e9d50
KB
4M=../../libexec/mip
5P=../../libexec/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
f087b968 12MAN= lint.0
b022d271 13
f087b968 14all: lpass1 lpass2 ${LINTLIBS}
b022d271 15
7184b3eb 16lpass1: cgram.o rodata.o comm1.o optim.o pftn.o scan.o trees.o xdefs.o \
ccff5ef5 17 lint.o hash.o rel.o
23d7f962 18 ${CC} ${CFLAGS} cgram.o rodata.o comm1.o optim.o pftn.o scan.o \
ccff5ef5 19 trees.o xdefs.o lint.o hash.o rel.o -o lpass1
b022d271 20
7184b3eb
RC
21cgram.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h cgram.c
22 $(CC) -c $(CFLAGS) -I$M -I. cgram.c
b022d271 23
7184b3eb
RC
24rodata.o: rodata.c
25 $(CC) -c $(CFLAGS) -R rodata.c
b022d271 26
7184b3eb 27comm1.o: $M/manifest.h $M/pass1.h pcclocal.h $M/common.c macdefs.h
ccff5ef5 28 ln -s $M/common.c comm1.c
7184b3eb
RC
29 $(CC) -c $(CFLAGS) -I$M -I. -DPASS1COMMON comm1.c
30 rm -f comm1.c
b022d271 31
7184b3eb
RC
32optim.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/optim.c
33 $(CC) -c $(CFLAGS) -I$M -I. $M/optim.c
34
35pftn.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/pftn.c
36 $(CC) -c $(CFLAGS) -I$M -I. $M/pftn.c
b022d271 37
7184b3eb
RC
38scan.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/scan.c
39 $(CC) -c $(CFLAGS) -I$M -I. $M/scan.c
b022d271 40
7184b3eb
RC
41trees.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/trees.c
42 $(CC) -c $(CFLAGS) -I$M -I. $M/trees.c
b022d271 43
7184b3eb
RC
44xdefs.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h $M/xdefs.c
45 $(CC) -c $(CFLAGS) -I$M -I. $M/xdefs.c
b022d271 46
7184b3eb
RC
47rodata.c cgram.c: $M/cgram.y pcctokens
48 cat pcctokens $M/cgram.y > gram.in
49 $(YACC) gram.in
50 rm -f rodata.c
51 sh ./:yyfix yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef
20e298ce 52 mv y.tab.c cgram.c
b022d271 53
7184b3eb
RC
54GREP= egrep
55
56pcclocal.h: $P/localdefs.h /usr/include/pcc.h
57 rm -f pcclocal.h
58 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
59
60pcctokens: $P/localdefs.h /usr/include/pcc.h
61 rm -f pcctokens
62 cat /usr/include/pcc.h $P/localdefs.h | $(GREP) '^#[ ]*define[ ][ ]*PCC_' | sed -e 's/^#[ ]*define[ ][ ]*PCC_/%term /' > pcctokens
63
64lint.o: $M/manifest.h macdefs.h $M/pass1.h lmanifest.h
65 ${CC} -c ${CFLAGS} -I$M -I. lint.c
b022d271 66
20e298ce
RH
67llib-port.ln: llib-port lpass1
68 -(/lib/cpp -C -Dlint llib-port | ./lpass1 -puv > llib-port.ln )
b022d271 69
8188b6d0 70llib-ldbm.ln: llib-ldbm lpass1
21bee4e0 71 -(/lib/cpp -C -Dlint llib-ldbm | ./lpass1 -uv > llib-ldbm.ln )
8188b6d0 72
b022d271 73llib-lm.ln: llib-lm lpass1
21bee4e0 74 -(/lib/cpp -C -Dlint llib-lm | ./lpass1 -uv > llib-lm.ln )
b022d271
SL
75
76llib-lmp.ln: llib-lmp lpass1
21bee4e0 77 -(/lib/cpp -C -Dlint llib-lmp | ./lpass1 -uv > llib-lmp.ln )
b022d271 78
8188b6d0 79llib-lplot.ln: llib-lplot lpass1
21bee4e0 80 -(/lib/cpp -C -Dlint llib-lplot | ./lpass1 -uv > llib-lplot.ln )
8188b6d0
DS
81
82llib-ltermcap.ln: llib-ltermcap lpass1
21bee4e0 83 -(/lib/cpp -C -Dlint llib-ltermcap | ./lpass1 -uv > llib-ltermcap.ln )
8188b6d0 84
20e298ce
RH
85llib-lc.ln: llib-lc lpass1
86 -(/lib/cpp -C -Dlint llib-lc | ./lpass1 -v > llib-lc.ln )
b022d271 87
63ea8a04 88llib-lcurses.ln: llib-lcurses lpass1
1672917d 89 -(/lib/cpp -C -Dlint -D__void__=__curses__ llib-lcurses | ./lpass1 -v > llib-lcurses.ln )
63ea8a04 90
06337354 91lpass2: lpass2.o hash.o
23d7f962 92 ${CC} ${CFLAGS} lpass2.o hash.o -o lpass2
b022d271 93
7184b3eb 94lpass2.o: $M/manifest.h lmanifest.h pcclocal.h macdefs.h
b022d271 95 ${CC} ${CFLAGS} -c -I$M -I. lpass2.c
4825013c
KB
96
97hash.o: hash.c
98 ${CC} ${CFLAGS} -c -I$M -I. hash.c
99
20e298ce 100lintall:
b022d271
SL
101 lint -hpv -I. -I$M $M/cgram.c $M/xdefs.c $M/scan.c \
102 $M/pftn.c $M/trees.c $M/optim.c lint.c
103
f087b968 104install: all SHELL ${MAN}
dc0e9d50
KB
105 install -s -o bin -g bin -m 755 lpass1 lpass2 /usr/libexec
106 install -c -o bin -g bin -m 444 llib-* /usr/libdata/lint
107 rm -f /usr/libdata/llib-ltermlib*
108 ln -s llib-ltermcap /usr/libdata/llib-ltermlib
109 ln -s llib-ltermcap.ln /usr/libdata/llib-ltermlib.ln
dc18ff53 110 install -c -o bin -g bin -m 755 SHELL ${DESTDIR}/usr/bin/lint
f087b968 111 install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1
1dd488cb 112
b022d271 113shrink:
3a3d1a9a 114 rm -f *.o errs rodata.c pcctokens pcclocal.h
1dd488cb 115
b022d271 116clean: shrink
23d7f962
DS
117 rm -f lpass1 lpass2 cgram.c gram.in tags ${LINTLIBS}
118
f087b968
KB
119cleandir: clean
120 rm -f ${MAN} tags .depend
121
122tags: ${SRCS}
23d7f962 123 ctags -w ${SRCS}
9496d389 124
f087b968 125depend lint: