MFC: tidy up YACCing.

This commit is contained in:
David E. O'Brien 2002-04-04 19:44:34 +00:00
parent fda035bb2c
commit 93c646073d
3 changed files with 13 additions and 15 deletions

View File

@ -22,13 +22,12 @@ LDADD+= ${LIBCC_INT}
.ORDER: c-parse.c c-parse.h
c-parse.c c-parse.h: c-parse.in
sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
-e "/^ifc$$/d" -e "/^end ifc$$/d" \
${GCCDIR}/c-parse.in > c-parse.y
-e "/^ifc$$/d" \
-e "/^end ifc$$/d" \
${.ALLSRC} > c-parse.y
${YACC} -d -o c-parse.c c-parse.y
mv c-parse.y c-parse.y.out
CLEANFILES+= c-parse.c c-parse.h \
c-parse.y c-parse.y.out # insurance
CLEANFILES+= c-parse.c c-parse.h c-parse.y # insurance
#-----------------------------------------------------------------------

View File

@ -5,7 +5,7 @@
.PATH: ../cc_tools ${GCCDIR}/objc ${GCCDIR}
PROG= cc1obj
SRCS= objc-parse.c objc-parse.h objc-parse.h objc-act.c
SRCS= objc-parse.c c-parse.h objc-act.c
# Ugh, compiled twice...
SRCS+= c-decl.c c-lex.c c-typeck.c
BINDIR= /usr/libexec
@ -19,17 +19,16 @@ LDADD+= ${LIBCC_INT}
#-----------------------------------------------------------------------
# objc parser
.ORDER: objc-parse.c objc-parse.h
objc-parse.c objc-parse.h: c-parse.in
.ORDER: objc-parse.c c-parse.h
objc-parse.c c-parse.h: c-parse.in
sed -e "/^ifc$$/,/^end ifc$$/d" \
-e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \
${GCCDIR}/c-parse.in > objc-parse.y
-e "/^ifobjc$$/d" \
-e "/^end ifobjc$$/d" \
${.ALLSRC} > objc-parse.y
${YACC} -d -o objc-parse.c objc-parse.y
ln -sf objc-parse.h c-parse.h
mv objc-parse.y objc-parse.y.out
mv objc-parse.h c-parse.h
CLEANFILES+= objc-parse.c objc-parse.h c-parse.h \
objc-parse.y objc-parse.y.out # insurance
CLEANFILES+= objc-parse.c c-parse.h objc-parse.y # insurance
#-----------------------------------------------------------------------

View File

@ -21,7 +21,7 @@ LDADD+= ${LIBCC_INT}
.ORDER: parse.c parse.h
parse.c parse.h: parse.y
${YACC} -d -o parse.c ${GCCDIR}/cp/parse.y
${YACC} -d -o parse.c ${.ALLSRC}
grep '^#define[ ]*YYEMPTY' parse.c >>parse.h
CLEANFILES+= parse.c parse.h cfns.h