From 672528fa3ddd030a31490fc8415f339580a660af Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Tue, 7 May 2002 01:41:46 +0000 Subject: [PATCH] Make the YACC'ing more bullet proof. --- gnu/usr.bin/cc/cc1plus/Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gnu/usr.bin/cc/cc1plus/Makefile b/gnu/usr.bin/cc/cc1plus/Makefile index 236c3f946e46..6b7c49d4d05d 100644 --- a/gnu/usr.bin/cc/cc1plus/Makefile +++ b/gnu/usr.bin/cc/cc1plus/Makefile @@ -5,7 +5,7 @@ .PATH: ${GCCDIR}/cp ${GCCDIR} PROG= cc1plus -SRCS= parse.c cfns.h +SRCS= parse.y cfns.h SRCS+= main.c cp-lang.c SRCS+= call.c class.c cvt.c decl.c decl2.c error.c except.c expr.c \ friend.c init.c lex.c mangle.c method.c pt.c ptree.c repo.c rtti.c \ @@ -20,14 +20,18 @@ CFLAGS+= -I${GCCDIR}/cp -I. DPADD+= ${LIBCC_INT} LDADD+= ${LIBCC_INT} -.ORDER: parse.c +CLEANFILES+= parse.c parse.h y.tab.c y.tab.h cfns.h + +.ORDER: parse.c parse.h parse.c: parse.y - ${YACC} -o parse.c.in ${.ALLSRC} + ${YACC} ${YFLAGS} ${GCCDIR}/cp/${.TARGET:S/c$/y/} sed -e "s/malloc/xmalloc/g" \ -e "s/realloc/xrealloc/g" \ - parse.c.in >parse.c + y.tab.c >${.TARGET} -CLEANFILES+= parse.c cfns.h +parse.h: parse.c y.tab.h + cp -pf y.tab.h ${.TARGET} + grep '^#define[ ]*YYEMPTY' ${.TARGET:S/h$/c/} >>${.TARGET} cfns.h: gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' \