From: Tom Tromey Date: Tue, 25 Jan 2022 21:57:18 +0000 (-0700) Subject: Fix flex rule in gdb X-Git-Tag: gdb-12.1-release~445 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=326f526e1b87a2b18d7175c88bdebc418be06ad6;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 3efd2227698..bf19db45343 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