From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 19382385BF81; Tue, 1 Feb 2022 18:43:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19382385BF81 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Fix flex rule in gdb X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: cd393cec3ab21f6e8b984dea5dafe2c7a5aec892 X-Git-Newrev: 326f526e1b87a2b18d7175c88bdebc418be06ad6 Message-Id: <20220201184313.19382385BF81@sourceware.org> Date: Tue, 1 Feb 2022 18:43:13 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2022 18:43:13 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D326f526e1b87= a2b18d7175c88bdebc418be06ad6 commit 326f526e1b87a2b18d7175c88bdebc418be06ad6 Author: Tom Tromey Date: Tue Jan 25 14:57:18 2022 -0700 Fix flex rule in gdb =20 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. =20 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. =20 This fix just updates the Makefile rule to follow the way that the "yacc" rule already works. Diff: --- gdb/Makefile.in | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) 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 $@ =20 # XML rules