This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc/Makefile.in targets 'compare' and 'gnucompare' behave differently


On Fri, Oct 25, 2002 at 06:57:07PM -0400, DJ Delorie wrote:
> 
> >   for file in *.o; do \
> >     test -f stage$stage/$file && (cmp --ignor...bad_compare) || true; \
> >   done
> 
> That adds back in some of the overhead, unless we assume that the
> shell is running the test command internally.

I think that's a safe assumption with any modern shell

> Otherwise, I can't think of a better way, unless we can check for
> cmp's exit code being exactly 1 (it returns 2 if one of the files is
> missing).

for file in *.o; do \
  cmp ...
  if [ $? -eq 1 ] ; then
    # bad
  fi
done

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]