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. --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Makefile') 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