| 1 | # |
| 2 | # @(#)Makefile 1.23 (Berkeley) %G% |
| 3 | # |
| 4 | M=../../lib/mip |
| 5 | P=../../lib/pcc |
| 6 | CFLAGS=-O |
| 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 |
| 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 |
| 12 | MAN= lint.0 |
| 13 | |
| 14 | all: lpass1 lpass2 ${LINTLIBS} |
| 15 | |
| 16 | lpass1: cgram.o rodata.o comm1.o optim.o pftn.o scan.o trees.o xdefs.o \ |
| 17 | lint.o hash.o rel.o |
| 18 | ${CC} ${CFLAGS} cgram.o rodata.o comm1.o optim.o pftn.o scan.o \ |
| 19 | trees.o xdefs.o lint.o hash.o rel.o -o lpass1 |
| 20 | |
| 21 | cgram.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h cgram.c |
| 22 | $(CC) -c $(CFLAGS) -I$M -I. cgram.c |
| 23 | |
| 24 | rodata.o: rodata.c |
| 25 | $(CC) -c $(CFLAGS) -R rodata.c |
| 26 | |
| 27 | comm1.o: $M/manifest.h $M/pass1.h pcclocal.h $M/common.c macdefs.h |
| 28 | ln -s $M/common.c comm1.c |
| 29 | $(CC) -c $(CFLAGS) -I$M -I. -DPASS1COMMON comm1.c |
| 30 | rm -f comm1.c |
| 31 | |
| 32 | optim.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 | |
| 35 | pftn.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/pftn.c |
| 36 | $(CC) -c $(CFLAGS) -I$M -I. $M/pftn.c |
| 37 | |
| 38 | scan.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/scan.c |
| 39 | $(CC) -c $(CFLAGS) -I$M -I. $M/scan.c |
| 40 | |
| 41 | trees.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/trees.c |
| 42 | $(CC) -c $(CFLAGS) -I$M -I. $M/trees.c |
| 43 | |
| 44 | xdefs.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h $M/xdefs.c |
| 45 | $(CC) -c $(CFLAGS) -I$M -I. $M/xdefs.c |
| 46 | |
| 47 | rodata.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 |
| 52 | mv y.tab.c cgram.c |
| 53 | |
| 54 | GREP= egrep |
| 55 | |
| 56 | pcclocal.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 | |
| 60 | pcctokens: $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 | |
| 64 | lint.o: $M/manifest.h macdefs.h $M/pass1.h lmanifest.h |
| 65 | ${CC} -c ${CFLAGS} -I$M -I. lint.c |
| 66 | |
| 67 | llib-port.ln: llib-port lpass1 |
| 68 | -(/lib/cpp -C -Dlint llib-port | ./lpass1 -puv > llib-port.ln ) |
| 69 | |
| 70 | llib-ldbm.ln: llib-ldbm lpass1 |
| 71 | -(/lib/cpp -C -Dlint llib-ldbm | ./lpass1 -uv > llib-ldbm.ln ) |
| 72 | |
| 73 | llib-lm.ln: llib-lm lpass1 |
| 74 | -(/lib/cpp -C -Dlint llib-lm | ./lpass1 -uv > llib-lm.ln ) |
| 75 | |
| 76 | llib-lmp.ln: llib-lmp lpass1 |
| 77 | -(/lib/cpp -C -Dlint llib-lmp | ./lpass1 -uv > llib-lmp.ln ) |
| 78 | |
| 79 | llib-lplot.ln: llib-lplot lpass1 |
| 80 | -(/lib/cpp -C -Dlint llib-lplot | ./lpass1 -uv > llib-lplot.ln ) |
| 81 | |
| 82 | llib-ltermcap.ln: llib-ltermcap lpass1 |
| 83 | -(/lib/cpp -C -Dlint llib-ltermcap | ./lpass1 -uv > llib-ltermcap.ln ) |
| 84 | |
| 85 | llib-lc.ln: llib-lc lpass1 |
| 86 | -(/lib/cpp -C -Dlint llib-lc | ./lpass1 -v > llib-lc.ln ) |
| 87 | |
| 88 | llib-lcurses.ln: llib-lcurses lpass1 |
| 89 | -(/lib/cpp -C -Dlint -D__void__=__curses__ llib-lcurses | ./lpass1 -v > llib-lcurses.ln ) |
| 90 | |
| 91 | lpass2: lpass2.o hash.o |
| 92 | ${CC} ${CFLAGS} lpass2.o hash.o -o lpass2 |
| 93 | |
| 94 | lpass2.o: $M/manifest.h lmanifest.h pcclocal.h macdefs.h |
| 95 | ${CC} ${CFLAGS} -c -I$M -I. lpass2.c |
| 96 | |
| 97 | hash.o: hash.c |
| 98 | ${CC} ${CFLAGS} -c -I$M -I. hash.c |
| 99 | |
| 100 | lintall: |
| 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 | |
| 104 | install: all SHELL ${MAN} |
| 105 | install -s -o bin -g bin -m 755 lpass1 ${DESTDIR}/usr/lib/lint/lint1 |
| 106 | install -s -o bin -g bin -m 755 lpass2 ${DESTDIR}/usr/lib/lint/lint2 |
| 107 | install -c -o bin -g bin -m 444 llib-* ${DESTDIR}/usr/lib/lint |
| 108 | -rm -f ${DESTDIR}/usr/lib/lint/llib-ltermlib* |
| 109 | ln -s llib-ltermcap ${DESTDIR}/usr/lib/lint/llib-ltermlib |
| 110 | ln -s llib-ltermcap.ln ${DESTDIR}/usr/lib/lint/llib-ltermlib.ln |
| 111 | install -c -o bin -g bin -m 755 SHELL ${DESTDIR}/usr/bin/lint |
| 112 | install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1 |
| 113 | |
| 114 | shrink: |
| 115 | rm -f *.o errs rodata.c pcctokens pcclocal.h |
| 116 | |
| 117 | clean: shrink |
| 118 | rm -f lpass1 lpass2 cgram.c gram.in tags ${LINTLIBS} |
| 119 | |
| 120 | cleandir: clean |
| 121 | rm -f ${MAN} tags .depend |
| 122 | |
| 123 | tags: ${SRCS} |
| 124 | ctags -w ${SRCS} |
| 125 | |
| 126 | depend lint: |