1# 2# @(#)Makefile 1.28 (Berkeley) 02/21/90 3# 4M=../../libexec/mip 5P=../../libexec/pcc 6CFLAGS=-O 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 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 12MAN= lint.0 13 14all: lpass1 lpass2 ${LINTLIBS} 15 16lpass1: 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 21cgram.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h cgram.c 22 $(CC) -c $(CFLAGS) -I$M -I. cgram.c 23 24rodata.o: rodata.c 25 $(CC) -c $(CFLAGS) -R rodata.c 26 27comm1.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 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 37 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 40 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 43 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 46 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 yylhs yylen yydefred yydgoto yysindex yyrindex \ 52 yygindex yytable yycheck 53 mv y.tab.c cgram.c 54 55GREP= egrep 56 57pcclocal.h: $P/localdefs.h /usr/include/pcc.h 58 rm -f pcclocal.h 59 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 60 61pcctokens: $P/localdefs.h /usr/include/pcc.h 62 rm -f pcctokens 63 cat /usr/include/pcc.h $P/localdefs.h | $(GREP) '^#[ ]*define[ ][ ]*PCC_' | sed -e 's/^#[ ]*define[ ][ ]*PCC_/%term /' > pcctokens 64 65lint.o: $M/manifest.h macdefs.h $M/pass1.h lmanifest.h 66 ${CC} -c ${CFLAGS} -I$M -I. lint.c 67 68llib-port.ln: llib-port lpass1 69 -(/usr/bin/cpp -C -Dlint llib-port | ./lpass1 -puv > llib-port.ln ) 70 71llib-ldbm.ln: llib-ldbm lpass1 72 -(/usr/bin/cpp -C -Dlint llib-ldbm | ./lpass1 -uv > llib-ldbm.ln ) 73 74llib-lm.ln: llib-lm lpass1 75 -(/usr/bin/cpp -C -Dlint llib-lm | ./lpass1 -uv > llib-lm.ln ) 76 77llib-lmp.ln: llib-lmp lpass1 78 -(/usr/bin/cpp -C -Dlint llib-lmp | ./lpass1 -uv > llib-lmp.ln ) 79 80llib-lplot.ln: llib-lplot lpass1 81 -(/usr/bin/cpp -C -Dlint llib-lplot | ./lpass1 -uv > llib-lplot.ln ) 82 83llib-ltermcap.ln: llib-ltermcap lpass1 84 -(/usr/bin/cpp -C -Dlint llib-ltermcap | ./lpass1 -uv > llib-ltermcap.ln ) 85 86llib-lc.ln: llib-lc lpass1 87 -(/usr/bin/cpp -C -Dlint llib-lc | ./lpass1 -v > llib-lc.ln ) 88 89llib-lcurses.ln: llib-lcurses lpass1 90 -(/usr/bin/cpp -C -Dlint -D__void__=__curses__ llib-lcurses | ./lpass1 -v > llib-lcurses.ln ) 91 92lpass2: lpass2.o hash.o 93 ${CC} ${CFLAGS} lpass2.o hash.o -o lpass2 94 95lpass2.o: $M/manifest.h lmanifest.h pcclocal.h macdefs.h 96 ${CC} ${CFLAGS} -c -I$M -I. lpass2.c 97 98hash.o: hash.c 99 ${CC} ${CFLAGS} -c -I$M -I. hash.c 100 101lintall: 102 lint -hpv -I. -I$M $M/cgram.c $M/xdefs.c $M/scan.c \ 103 $M/pftn.c $M/trees.c $M/optim.c lint.c 104 105install: all SHELL ${MAN} 106 install -s -o bin -g bin -m 755 lpass1 /usr/libexec/lintpass1 107 install -s -o bin -g bin -m 755 lpass2 /usr/libexec/lintpass2 108 install -c -o bin -g bin -m 444 llib-* /usr/libdata/lint 109 rm -f /usr/libdata/lint/llib-ltermlib* 110 ln -s llib-ltermcap /usr/libdata/lint/llib-ltermlib 111 ln -s llib-ltermcap.ln /usr/libdata/lint/llib-ltermlib.ln 112 install -c -o bin -g bin -m 755 SHELL ${DESTDIR}/usr/bin/lint 113 install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1 114 115shrink: 116 rm -f *.o errs rodata.c pcctokens pcclocal.h 117 118clean: shrink 119 rm -f lpass1 lpass2 cgram.c gram.in tags ${LINTLIBS} 120 121cleandir: clean 122 rm -f ${MAN} tags .depend 123 124tags: ${SRCS} 125 ctags -w ${SRCS} 126 127depend lint: 128