aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnu/usr.bin/cc/cc1plus/Makefile14
1 files changed, 9 insertions, 5 deletions
diff --git a/gnu/usr.bin/cc/cc1plus/Makefile b/gnu/usr.bin/cc/cc1plus/Makefile
index 236c3f946e462..6b7c49d4d05d7 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' \