1# 2# @(#)Makefile 1.9 (Berkeley) 04/08/85 3# 4M=/usr/src/lib/mip 5P=/usr/src/lib/pcc 6CFLAGS=-O 7LINTLIBS=llib-port.ln llib-lc.ln llib-lm.ln llib-lmp.ln llib-lcurses.ln 8 9all: lpass1 lpass2 ${LINTLIBS} 10 11lpass1: 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 16cgram.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h cgram.c 17 $(CC) -c $(CFLAGS) -I$M -I. cgram.c 18 19rodata.o: rodata.c 20 $(CC) -c $(CFLAGS) -R rodata.c 21 22comm1.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 27optim.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 30pftn.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 33scan.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 36trees.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 39xdefs.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 42rodata.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 49GREP= egrep 50 51pcclocal.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 55pcctokens: $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 59lint.o: $M/manifest.h macdefs.h $M/pass1.h lmanifest.h 60 ${CC} -c ${CFLAGS} -I$M -I. lint.c 61 62llib-port.ln: llib-port lpass1 63 -(/lib/cpp -C -Dlint llib-port | ./lpass1 -puv > llib-port.ln ) 64 65llib-lm.ln: llib-lm lpass1 66 -(/lib/cpp -C -Dlint llib-lm | ./lpass1 -puv > llib-lm.ln ) 67 68llib-lmp.ln: llib-lmp lpass1 69 -(/lib/cpp -C -Dlint llib-lmp | ./lpass1 -puv > llib-lmp.ln ) 70 71llib-lc.ln: llib-lc lpass1 72 -(/lib/cpp -C -Dlint llib-lc | ./lpass1 -v > llib-lc.ln ) 73 74llib-lcurses.ln: llib-lcurses lpass1 75 -(/lib/cpp -C -Dlint llib-lcurses | ./lpass1 -v > llib-lcurses.ln ) 76 77lpass2: lpass2.o hash.o 78 ${CC} lpass2.o hash.o -o lpass2 79 80lpass2.o: $M/manifest.h lmanifest.h pcclocal.h macdefs.h 81 ${CC} ${CFLAGS} -c -I$M -I. lpass2.c 82 83lintall: 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 87install: 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 93shrink: 94 rm -f *.o errs 95 96clean: shrink 97 rm -f lpass1 lpass2 cgram.c gram.in ${LINTLIBS} 98