From e19df24ea8f88e8795f139267a675035c11bbd90 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 2 Mar 2014 23:38:39 -0800 Subject: * Makefile (lex.yy.c): Remove lex.yy.c before trying to regenerate it. (y.tab.c, y.tab.h): Remove y.tab.c before running yacc. Write-protect y.tab.c, not $@, which could expand to the y.tab.h target if that is what triggered the rule. --- ChangeLog | 7 +++++++ Makefile | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d39cc8a1..bbc66d65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-03-02 Kaz Kylheku + + * Makefile (lex.yy.c): Remove lex.yy.c before trying to regenerate it. + (y.tab.c, y.tab.h): Remove y.tab.c before running yacc. Write-protect + y.tab.c, not $@, which could expand to the y.tab.h target if that is + what triggered the rule. + 2014-03-02 Kaz Kylheku * txr.1: Incorporating more corrections from Roman Mishin. diff --git a/Makefile b/Makefile index 10871021..628bb5e8 100644 --- a/Makefile +++ b/Makefile @@ -61,11 +61,13 @@ VPATH := $(top_srcdir) -include $(top_srcdir)/dep.mk lex.yy.c: parser.l + rm -f $@ $(LEX) $(LEX_DBG_FLAGS) $< chmod a-w $@ y.tab.c y.tab.h: parser.y - if $(YACC) -v -d $< ; then chmod a-w $@ ; true ; else rm $@ ; false ; fi + rm -f y.tab.c + if $(YACC) -v -d $< ; then chmod a-w y.tab.c ; true ; else rm y.tab.c ; false ; fi # Suppress useless sccs id array and unused label warning in byacc otuput. # Bison-generated parser also tests for this lint define. -- cgit v1.2.3