o Not all versions of diff have the -q option
o The cmp program is probably faster than diff
Fixed the logic that only copies the file over if no differences are found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7615
91177308-0d34-0410-b5e6-
96231b3b80d8
$(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
$(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \
> $@.tmp
$(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
$(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \
> $@.tmp
- $(VERB) diff -q $@ $@.tmp > /dev/null || ${MV} -f $@.tmp $@
+ $(VERB) cmp $@ $@.tmp > /dev/null && ${MV} -f $@.tmp $@
@# remove the output of flex if it didn't get moved over...
@rm -f $@.tmp
@# remove the output of flex if it didn't get moved over...
@rm -f $@.tmp
%.cpp %.h : %.y
@echo Bison\'ing $<...
$(VERB) $(BISON) -v -d -p $(<:%Parser.y=%) $*.y
%.cpp %.h : %.y
@echo Bison\'ing $<...
$(VERB) $(BISON) -v -d -p $(<:%Parser.y=%) $*.y
- $(VERB) diff -q $*.tab.c $*.cpp > /dev/null || ${MV} -f $*.tab.c $*.cpp
- $(VERB) diff -q $*.tab.h $*.h > /dev/null || ${MV} -f $*.tab.h $*.h
+ $(VERB) cmp $*.tab.c $*.cpp > /dev/null && ${MV} -f $*.tab.c $*.cpp
+ $(VERB) cmp $*.tab.h $*.h > /dev/null && ${MV} -f $*.tab.h $*.h
@# If the files were not updated, don't leave them lying around...
@rm -f $*.tab.c $*.tab.h
@# If the files were not updated, don't leave them lying around...
@rm -f $*.tab.c $*.tab.h
$(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
$(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \
> $@.tmp
$(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
$(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \
> $@.tmp
- $(VERB) diff -q $@ $@.tmp > /dev/null || ${MV} -f $@.tmp $@
+ $(VERB) cmp $@ $@.tmp > /dev/null && ${MV} -f $@.tmp $@
@# remove the output of flex if it didn't get moved over...
@rm -f $@.tmp
@# remove the output of flex if it didn't get moved over...
@rm -f $@.tmp
%.cpp %.h : %.y
@echo Bison\'ing $<...
$(VERB) $(BISON) -v -d -p $(<:%Parser.y=%) $*.y
%.cpp %.h : %.y
@echo Bison\'ing $<...
$(VERB) $(BISON) -v -d -p $(<:%Parser.y=%) $*.y
- $(VERB) diff -q $*.tab.c $*.cpp > /dev/null || ${MV} -f $*.tab.c $*.cpp
- $(VERB) diff -q $*.tab.h $*.h > /dev/null || ${MV} -f $*.tab.h $*.h
+ $(VERB) cmp $*.tab.c $*.cpp > /dev/null && ${MV} -f $*.tab.c $*.cpp
+ $(VERB) cmp $*.tab.h $*.h > /dev/null && ${MV} -f $*.tab.h $*.h
@# If the files were not updated, don't leave them lying around...
@rm -f $*.tab.c $*.tab.h
@# If the files were not updated, don't leave them lying around...
@rm -f $*.tab.c $*.tab.h