forked from Imagelibrary/binutils-gdb
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.
This commit is contained 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user