This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Minimize yacc and lex output
- From: Tom Tromey <tromey at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 9 Jul 2018 14:04:48 -0000
- Subject: [binutils-gdb] Minimize yacc and lex output
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e5fd1493fd9c2d8d55fd15b9bd6539781ee56209
commit e5fd1493fd9c2d8d55fd15b9bd6539781ee56209
Author: Tom Tromey <tom@tromey.com>
Date: Mon Jul 2 07:29:03 2018 -0600
Minimize yacc and lex output
This minimizes the "make" output from the yacc and lex rules,
following the same technique as the rest of the Makefile.
The lex rule had a special case to deal with the situation where flex
is not available. I don't think this is needed, so I removed it. If
flex is truly unavailable, the person building gdb can simply "touch"
the output file.
gdb/ChangeLog
2018-07-09 Tom Tromey <tom@tromey.com>
* Makefile.in (%.c: %.y): Use ECHO_YACC.
(%.c: %.l): Use ECHO_LEX. Just fail if flex not available.
* silent-rules.mk (ECHO_YACC, ECHO_LEX): New variables.
Diff:
---
gdb/ChangeLog | 6 ++++++
gdb/Makefile.in | 17 +++++------------
gdb/silent-rules.mk | 2 ++
3 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b8bc5cf..d0902c7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-07-09 Tom Tromey <tom@tromey.com>
+ * Makefile.in (%.c: %.y): Use ECHO_YACC.
+ (%.c: %.l): Use ECHO_LEX. Just fail if flex not available.
+ * silent-rules.mk (ECHO_YACC, ECHO_LEX): New variables.
+
+2018-07-09 Tom Tromey <tom@tromey.com>
+
* Makefile.in (ALLDEPFILES): Remove exec.c.
(COMMON_OBS): Remove exec.o.
(COMMON_SFILES): Add exec.c.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 047d06b..36d2c44 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2477,9 +2477,9 @@ po/$(PACKAGE).pot: force
# Makefile.in, but that was a pretty big annoyance.
%.c: %.y
- $(SHELL) $(YLWRAP) $< y.tab.c $@.tmp -- $(YACC) $(YFLAGS) \
- || (rm -f $@.tmp; false)
- sed -e '/extern.*malloc/d' \
+ $(ECHO_YACC) $(SHELL) $(YLWRAP) $< y.tab.c $@.tmp -- \
+ $(YACC) $(YFLAGS) || (rm -f $@.tmp; false)
+ @sed -e '/extern.*malloc/d' \
-e '/extern.*realloc/d' \
-e '/extern.*free/d' \
-e '/include.*malloc.h/d' \
@@ -2493,8 +2493,7 @@ po/$(PACKAGE).pot: force
rm -f $@.tmp && \
mv $@.new $@
%.c: %.l
- if [ "$(FLEX)" ] && $(FLEX) --version >/dev/null 2>&1; then \
- $(FLEX) -t $< \
+ $(ECHO_LEX) $(FLEX) -t $< \
| sed -e '/extern.*malloc/d' \
-e '/extern.*realloc/d' \
-e '/extern.*free/d' \
@@ -2505,13 +2504,7 @@ po/$(PACKAGE).pot: force
-e 's/\([ \t;,(]\)free$$/\1xfree/g' \
-e 's/yy_flex_xrealloc/yyxrealloc/g' \
> $@.new && \
- mv $@.new $@; \
- elif [ -f $@ ]; then \
- echo "Warning: $*.c older than $*.l and flex not available."; \
- else \
- echo "$@ missing and flex not available."; \
- false; \
- fi
+ mv $@.new $@
.PRECIOUS: ada-lex.c
diff --git a/gdb/silent-rules.mk b/gdb/silent-rules.mk
index ade77ad..7ed73a7 100644
--- a/gdb/silent-rules.mk
+++ b/gdb/silent-rules.mk
@@ -11,5 +11,7 @@ ECHO_GEN_XML_BUILTIN_GENERATED = \
@echo " GEN xml-builtin-generated.c";
ECHO_INIT_C = echo " GEN init.c" ||
ECHO_SIGN = @echo " SIGN gdb";
+ECHO_YACC = @echo " YACC $@";
+ECHO_LEX = @echo " LEX $@";
SILENCE = @
endif