| 1 | # |
| 2 | # @(#)Makefile 1.9 (Berkeley) %G% |
| 3 | # |
| 4 | M=/usr/src/lib/mip |
| 5 | P=/usr/src/lib/pcc |
| 6 | CFLAGS=-O |
| 7 | LINTLIBS=llib-port.ln llib-lc.ln llib-lm.ln llib-lmp.ln llib-lcurses.ln |
| 8 | |
| 9 | all: lpass1 lpass2 ${LINTLIBS} |
| 10 | |
| 11 | lpass1: cgram.o rodata.o comm1.o optim.o pftn.o scan.o trees.o xdefs.o \ |
| 12 | lint.o hash.o |
| 13 | ${CC} cgram.o rodata.o comm1.o optim.o pftn.o scan.o trees.o xdefs.o \ |
| 14 | lint.o hash.o -o lpass1 |
| 15 | |
| 16 | cgram.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h cgram.c |
| 17 | $(CC) -c $(CFLAGS) -I$M -I. cgram.c |
| 18 | |
| 19 | rodata.o: rodata.c |
| 20 | $(CC) -c $(CFLAGS) -R rodata.c |
| 21 | |
| 22 | comm1.o: $M/manifest.h $M/pass1.h pcclocal.h $M/common.c macdefs.h |
| 23 | ln $M/common.c comm1.c |
| 24 | $(CC) -c $(CFLAGS) -I$M -I. -DPASS1COMMON comm1.c |
| 25 | rm -f comm1.c |
| 26 | |
| 27 | optim.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/optim.c |
| 28 | $(CC) -c $(CFLAGS) -I$M -I. $M/optim.c |
| 29 | |
| 30 | pftn.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/pftn.c |
| 31 | $(CC) -c $(CFLAGS) -I$M -I. $M/pftn.c |
| 32 | |
| 33 | scan.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/scan.c |
| 34 | $(CC) -c $(CFLAGS) -I$M -I. $M/scan.c |
| 35 | |
| 36 | trees.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/trees.c |
| 37 | $(CC) -c $(CFLAGS) -I$M -I. $M/trees.c |
| 38 | |
| 39 | xdefs.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h $M/xdefs.c |
| 40 | $(CC) -c $(CFLAGS) -I$M -I. $M/xdefs.c |
| 41 | |
| 42 | rodata.c cgram.c: $M/cgram.y pcctokens |
| 43 | cat pcctokens $M/cgram.y > gram.in |
| 44 | $(YACC) gram.in |
| 45 | rm -f rodata.c |
| 46 | sh ./:yyfix yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef |
| 47 | mv y.tab.c cgram.c |
| 48 | |
| 49 | GREP= egrep |
| 50 | |
| 51 | pcclocal.h: $P/localdefs.h /usr/include/pcc.h |
| 52 | rm -f pcclocal.h |
| 53 | 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 |
| 54 | |
| 55 | pcctokens: $P/localdefs.h /usr/include/pcc.h |
| 56 | rm -f pcctokens |
| 57 | cat /usr/include/pcc.h $P/localdefs.h | $(GREP) '^#[ ]*define[ ][ ]*PCC_' | sed -e 's/^#[ ]*define[ ][ ]*PCC_/%term /' > pcctokens |
| 58 | |
| 59 | lint.o: $M/manifest.h macdefs.h $M/pass1.h lmanifest.h |
| 60 | ${CC} -c ${CFLAGS} -I$M -I. lint.c |
| 61 | |
| 62 | llib-port.ln: llib-port lpass1 |
| 63 | -(/lib/cpp -C -Dlint llib-port | ./lpass1 -puv > llib-port.ln ) |
| 64 | |
| 65 | llib-lm.ln: llib-lm lpass1 |
| 66 | -(/lib/cpp -C -Dlint llib-lm | ./lpass1 -puv > llib-lm.ln ) |
| 67 | |
| 68 | llib-lmp.ln: llib-lmp lpass1 |
| 69 | -(/lib/cpp -C -Dlint llib-lmp | ./lpass1 -puv > llib-lmp.ln ) |
| 70 | |
| 71 | llib-lc.ln: llib-lc lpass1 |
| 72 | -(/lib/cpp -C -Dlint llib-lc | ./lpass1 -v > llib-lc.ln ) |
| 73 | |
| 74 | llib-lcurses.ln: llib-lcurses lpass1 |
| 75 | -(/lib/cpp -C -Dlint llib-lcurses | ./lpass1 -v > llib-lcurses.ln ) |
| 76 | |
| 77 | lpass2: lpass2.o hash.o |
| 78 | ${CC} lpass2.o hash.o -o lpass2 |
| 79 | |
| 80 | lpass2.o: $M/manifest.h lmanifest.h pcclocal.h macdefs.h |
| 81 | ${CC} ${CFLAGS} -c -I$M -I. lpass2.c |
| 82 | |
| 83 | lintall: |
| 84 | lint -hpv -I. -I$M $M/cgram.c $M/xdefs.c $M/scan.c \ |
| 85 | $M/pftn.c $M/trees.c $M/optim.c lint.c |
| 86 | |
| 87 | install: all SHELL |
| 88 | install -s lpass1 ${DESTDIR}/usr/lib/lint/lint1 |
| 89 | install -s lpass2 ${DESTDIR}/usr/lib/lint/lint2 |
| 90 | for i in llib-*; do install -c -m 644 $$i ${DESTDIR}/usr/lib/lint; done |
| 91 | install -c SHELL ${DESTDIR}/usr/bin/lint |
| 92 | |
| 93 | shrink: |
| 94 | rm -f *.o errs |
| 95 | |
| 96 | clean: shrink |
| 97 | rm -f lpass1 lpass2 cgram.c gram.in ${LINTLIBS} |