From 08f4aa071bdabc2156d2de34243818aaae95e681 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 4 Aug 2003 19:47:06 +0000 Subject: [PATCH] * Don't print out HOW we are running Flex unless in verbose mode. We already hide the bison command line. * If running flex or bison gives us the files we already have, don't overwrite the ones we have, which cause unnecessary compilation. I demand the ability to make meaningless changes without penalty! llvm-svn: 7571 --- Makefile.common | 15 +++++++++++---- Makefile.rules | 15 +++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Makefile.common b/Makefile.common index 2612e6fc656..9dfbdffe249 100644 --- a/Makefile.common +++ b/Makefile.common @@ -766,10 +766,15 @@ YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output) # FIXME. (f.e. char Buffer[10000]; ) # %.cpp: %.l - $(FLEX) -t $< | $(SED) '/^find_rule/d' | \ + @echo Flex\'ing $<... + $(VERB) $(FLEX) -t $< | $(SED) '/^find_rule/d' | \ $(SED) 's/void yyunput/inline void yyunput/' | \ $(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \ - $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' > $@ + $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \ + > $@.tmp + $(VERB) diff -q $@ $@.tmp || ${MV} -f $@.tmp $@ + @# remove the output of flex if it didn't get moved over... + @rm -f $@.tmp # Rule for building the bison parsers... %.c: %.y # Cancel built-in rules for yacc @@ -777,8 +782,10 @@ YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output) %.cpp %.h : %.y @echo Bison\'ing $<... $(VERB) $(BISON) -v -d -p $(<:%Parser.y=%) $*.y - $(VERB) ${MV} -f $*.tab.c $*.cpp - $(VERB) ${MV} -f $*.tab.h $*.h + $(VERB) diff -q $*.tab.c $*.cpp || ${MV} -f $*.tab.c $*.cpp + $(VERB) diff -q $*.tab.h $*.h || ${MV} -f $*.tab.h $*.h + @# If the files were not updated, don't leave them lying around... + @rm -f $*.tab.c $*.tab.h # To create the directories... %/.dir: diff --git a/Makefile.rules b/Makefile.rules index 2612e6fc656..9dfbdffe249 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -766,10 +766,15 @@ YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output) # FIXME. (f.e. char Buffer[10000]; ) # %.cpp: %.l - $(FLEX) -t $< | $(SED) '/^find_rule/d' | \ + @echo Flex\'ing $<... + $(VERB) $(FLEX) -t $< | $(SED) '/^find_rule/d' | \ $(SED) 's/void yyunput/inline void yyunput/' | \ $(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \ - $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' > $@ + $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \ + > $@.tmp + $(VERB) diff -q $@ $@.tmp || ${MV} -f $@.tmp $@ + @# remove the output of flex if it didn't get moved over... + @rm -f $@.tmp # Rule for building the bison parsers... %.c: %.y # Cancel built-in rules for yacc @@ -777,8 +782,10 @@ YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output) %.cpp %.h : %.y @echo Bison\'ing $<... $(VERB) $(BISON) -v -d -p $(<:%Parser.y=%) $*.y - $(VERB) ${MV} -f $*.tab.c $*.cpp - $(VERB) ${MV} -f $*.tab.h $*.h + $(VERB) diff -q $*.tab.c $*.cpp || ${MV} -f $*.tab.c $*.cpp + $(VERB) diff -q $*.tab.h $*.h || ${MV} -f $*.tab.h $*.h + @# If the files were not updated, don't leave them lying around... + @rm -f $*.tab.c $*.tab.h # To create the directories... %/.dir: