#
-# @(#)Makefile 1.6 (Berkeley) %G%
+# @(#)Makefile 1.11 (Berkeley) %G%
#
M=/usr/src/lib/mip
-LOAD1=
-LOAD2=
-CFLAGS=-O -DFLEXNAMES
-LINTLIBS=llib-port.ln llib-lc.ln llib-lm.ln llib-lmp.ln
+P=/usr/src/lib/pcc
+CFLAGS=-O
+LINTLIBS=llib-port.ln llib-lc.ln llib-lcurses.ln llib-ldbm.ln llib-lm.ln \
+ llib-lmp.ln llib-lplot.ln llib-ltermcap.ln
all: lpass1 lpass2 ${LINTLIBS}
-lpass1: cgram.o xdefs.o scan.o comm1.o pftn.o trees.o optim.o lint.o hash.o
- ${CC} cgram.o xdefs.o scan.o comm1.o pftn.o trees.o optim.o \
+lpass1: cgram.o rodata.o comm1.o optim.o pftn.o scan.o trees.o xdefs.o \
+ lint.o hash.o
+ ${CC} cgram.o rodata.o comm1.o optim.o pftn.o scan.o trees.o xdefs.o \
lint.o hash.o -o lpass1
-trees.o: $M/manifest macdefs $M/mfile1 $M/trees.c
- ${CC} -c ${CFLAGS} -I$M -I. $M/trees.c
+cgram.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h cgram.c
+ $(CC) -c $(CFLAGS) -I$M -I. cgram.c
-optim.o: $M/manifest macdefs $M/mfile1 $M/optim.c
- ${CC} -c ${CFLAGS} -I$M -I. $M/optim.c
+rodata.o: rodata.c
+ $(CC) -c $(CFLAGS) -R rodata.c
-pftn.o: $M/manifest macdefs $M/mfile1 $M/pftn.c
- ${CC} -c ${CFLAGS} -I$M -I. $M/pftn.c
+comm1.o: $M/manifest.h $M/pass1.h pcclocal.h $M/common.c macdefs.h
+ ln $M/common.c comm1.c
+ $(CC) -c $(CFLAGS) -I$M -I. -DPASS1COMMON comm1.c
+ rm -f comm1.c
-lint.o: $M/manifest macdefs $M/mfile1 lmanifest
- ${CC} -c ${CFLAGS} -I$M -I. lint.c
+optim.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/optim.c
+ $(CC) -c $(CFLAGS) -I$M -I. $M/optim.c
+
+pftn.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/pftn.c
+ $(CC) -c $(CFLAGS) -I$M -I. $M/pftn.c
-scan.o: $M/manifest macdefs $M/mfile1 $M/scan.c
- ${CC} -c ${CFLAGS} -I$M -I. $M/scan.c
+scan.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/scan.c
+ $(CC) -c $(CFLAGS) -I$M -I. $M/scan.c
-xdefs.o: $M/manifest $M/mfile1 macdefs $M/xdefs.c
- ${CC} -c ${CFLAGS} -I$M -I. $M/xdefs.c
+trees.o: $M/manifest.h macdefs.h $M/pass1.h pcclocal.h $M/trees.c
+ $(CC) -c $(CFLAGS) -I$M -I. $M/trees.c
-cgram.o: $M/manifest $M/mfile1 macdefs cgram.c
- ${CC} -c ${CFLAGS} -I$M -I. cgram.c
+xdefs.o: $M/manifest.h $M/pass1.h pcclocal.h macdefs.h $M/xdefs.c
+ $(CC) -c $(CFLAGS) -I$M -I. $M/xdefs.c
-cgram.c: $M/cgram.y
- yacc $M/cgram.y
+rodata.c cgram.c: $M/cgram.y pcctokens
+ cat pcctokens $M/cgram.y > gram.in
+ $(YACC) gram.in
+ rm -f rodata.c
+ sh ./:yyfix yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef
mv y.tab.c cgram.c
-comm1.o: $M/manifest $M/mfile1 $M/common macdefs $M/comm1.c
- ${CC} -c ${CFLAGS} -I. -I$M $M/comm1.c
+GREP= egrep
+
+pcclocal.h: $P/localdefs.h /usr/include/pcc.h
+ rm -f pcclocal.h
+ 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
+
+pcctokens: $P/localdefs.h /usr/include/pcc.h
+ rm -f pcctokens
+ cat /usr/include/pcc.h $P/localdefs.h | $(GREP) '^#[ ]*define[ ][ ]*PCC_' | sed -e 's/^#[ ]*define[ ][ ]*PCC_/%term /' > pcctokens
+
+lint.o: $M/manifest.h macdefs.h $M/pass1.h lmanifest.h
+ ${CC} -c ${CFLAGS} -I$M -I. lint.c
llib-port.ln: llib-port lpass1
-(/lib/cpp -C -Dlint llib-port | ./lpass1 -puv > llib-port.ln )
+llib-ldbm.ln: llib-ldbm lpass1
+ -(/lib/cpp -C -Dlint llib-ldbm | ./lpass1 -puv > llib-ldbm.ln )
+
llib-lm.ln: llib-lm lpass1
-(/lib/cpp -C -Dlint llib-lm | ./lpass1 -puv > llib-lm.ln )
llib-lmp.ln: llib-lmp lpass1
-(/lib/cpp -C -Dlint llib-lmp | ./lpass1 -puv > llib-lmp.ln )
+llib-lplot.ln: llib-lplot lpass1
+ -(/lib/cpp -C -Dlint llib-lplot | ./lpass1 -puv > llib-lplot.ln )
+
+llib-ltermcap.ln: llib-ltermcap lpass1
+ -(/lib/cpp -C -Dlint llib-ltermcap | ./lpass1 -puv > llib-ltermcap.ln )
+
llib-lc.ln: llib-lc lpass1
-(/lib/cpp -C -Dlint llib-lc | ./lpass1 -v > llib-lc.ln )
+llib-lcurses.ln: llib-lcurses lpass1
+ -(/lib/cpp -C -Dlint llib-lcurses | ./lpass1 -v > llib-lcurses.ln )
+
lpass2: lpass2.o hash.o
${CC} lpass2.o hash.o -o lpass2
-lpass2.o: $M/manifest lmanifest
+lpass2.o: $M/manifest.h lmanifest.h pcclocal.h macdefs.h
${CC} ${CFLAGS} -c -I$M -I. lpass2.c
lintall:
install: all SHELL
install -s lpass1 ${DESTDIR}/usr/lib/lint/lint1
install -s lpass2 ${DESTDIR}/usr/lib/lint/lint2
- cp llib-* ${DESTDIR}/usr/lib/lint
+ for i in llib-*; do install -c -m 644 $$i ${DESTDIR}/usr/lib/lint; done
+ -rm -f ${DESTDIR}/usr/lib/lint/llib-ltermlib*
+ ln -s /usr/lib/lint/llib-ltermcap ${DESTDIR}/usr/lib/lint/llib-ltermlib
+ ln -s /usr/lib/lint/llib-ltermcap.ln ${DESTDIR}/usr/lib/lint/llib-ltermlib.ln
install -c SHELL ${DESTDIR}/usr/bin/lint
shrink:
- rm -f *.o
+ rm -f *.o errs rodata.c pcctokens pcclocal.h
clean: shrink
- rm -f lpass1 lpass2 cgram.c ${LINTLIBS}
+ rm -f lpass1 lpass2 cgram.c gram.in ${LINTLIBS}