Skip to content

Commit

Permalink
* Don't print out HOW we are running Flex unless in verbose mode. We …
Browse files Browse the repository at this point in the history
…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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7571 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lattner committed Aug 4, 2003
1 parent 5d3f1f0 commit a328f88
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
15 changes: 11 additions & 4 deletions Makefile.common
Expand Up @@ -766,19 +766,26 @@ 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
%.h: %.y # Cancel built-in rules for yacc
%.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:
Expand Down
15 changes: 11 additions & 4 deletions Makefile.rules
Expand Up @@ -766,19 +766,26 @@ 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
%.h: %.y # Cancel built-in rules for yacc
%.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:
Expand Down

0 comments on commit a328f88

Please sign in to comment.