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