Switched from using diff to cmp for two reasons:
[oota-llvm.git] / Makefile.rules
index 9dfbdffe249db04deb0fbcb7fa4c6c6d123108fd..0eb4b885fc447a24b483793a6829f2fe4a0f6e45 100644 (file)
@@ -767,12 +767,13 @@ YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output)
 #
 %.cpp: %.l
        @echo Flex\'ing $<...
-       $(VERB) $(FLEX) -t $< | $(SED) '/^find_rule/d' | \
-                     $(SED) 's/void yyunput/inline void yyunput/' | \
+       $(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)/' \
               > $@.tmp
-       $(VERB) diff -q $@ $@.tmp || ${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
 
@@ -782,8 +783,8 @@ YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output)
 %.cpp %.h : %.y
        @echo Bison\'ing $<...
        $(VERB) $(BISON) -v -d -p $(<:%Parser.y=%) $*.y
-       $(VERB) diff -q $*.tab.c $*.cpp || ${MV} -f $*.tab.c $*.cpp
-       $(VERB) diff -q $*.tab.h $*.h || ${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