aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-01-25 14:57:18 -0700
committerTom Tromey <tromey@adacore.com>2022-02-01 11:39:24 -0700
commit326f526e1b87a2b18d7175c88bdebc418be06ad6 (patch)
tree16cf60009b7a1f842c498dd1780b4446b4d0037d
parentcd393cec3ab21f6e8b984dea5dafe2c7a5aec892 (diff)
downloadgdb-326f526e1b87a2b18d7175c88bdebc418be06ad6.zip
gdb-326f526e1b87a2b18d7175c88bdebc418be06ad6.tar.gz
gdb-326f526e1b87a2b18d7175c88bdebc418be06ad6.tar.bz2
Fix flex rule in gdb
Currently, if flex fails, it will leave the resulting .c file in the tree. This will cause a cascade of errors, and requires the manual deletion of the .c file in order to recreate the problem. It's better for the rule to fail such that the .c file is not updated. This way, 'make' will fail the same way every time -- which is much handier for debugging syntax errors. This fix just updates the Makefile rule to follow the way that the "yacc" rule already works.
-rw-r--r--gdb/Makefile.in27
1 files changed, 13 insertions, 14 deletions
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 3efd222..bf19db4 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2456,20 +2456,19 @@ po/$(PACKAGE).pot: force
rm -f $@.tmp && \
mv $@.new $@
%.c: %.l
- $(ECHO_LEX) $(FLEX) -t $< \
- | sed -e '/extern.*malloc/d' \
- -e '/extern.*realloc/d' \
- -e '/extern.*free/d' \
- -e '/include.*malloc.h/d' \
- -e 's/\([^x]\)malloc/\1xmalloc/g' \
- -e 's/\([^x]\)realloc/\1xrealloc/g' \
- -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \
- -e 's/\([ \t;,(]\)free$$/\1xfree/g' \
- -e 's/yy_flex_xrealloc/yyxrealloc/g' \
- > $@.new && \
- mv $@.new $@
-
-.PRECIOUS: ada-lex.c
+ $(ECHO_LEX) $(FLEX) -t $< > $@.tmp || (rm -f $@.tmp; false)
+ @sed -e '/extern.*malloc/d' \
+ -e '/extern.*realloc/d' \
+ -e '/extern.*free/d' \
+ -e '/include.*malloc.h/d' \
+ -e 's/\([^x]\)malloc/\1xmalloc/g' \
+ -e 's/\([^x]\)realloc/\1xrealloc/g' \
+ -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \
+ -e 's/\([ \t;,(]\)free$$/\1xfree/g' \
+ -e 's/yy_flex_xrealloc/yyxrealloc/g' \
+ < $@.tmp > $@.new && \
+ rm -f $@.tmp && \
+ mv $@.new $@
# XML rules