"./contrib/gcc_update --touch" doesn't work with make
H. J. Lu
hjl@lucon.org
Tue Jul 2 13:43:00 GMT 2002
On Tue, Jul 02, 2002 at 09:58:05PM +0200, Gerald Pfeifer wrote:
> On Sat, 29 Jun 2002, H. J. Lu wrote:
> > ./contrib/gcc_update has
> >
> > while ${MAKE-make} -f Makefile.$$ all | grep . > /dev/null; do
> > sleep 1
> > done 2>&1
> >
> > It won't work at all if you run it inside a makefile. You will get
> >
> > make[1]: Leaving directory `...'
> > make[1]: Entering directory `...'
> >
> > instead of empty line. For gnu make, I think you can use
> >
> > while ${MAKE-make} -s -f Makefile.$$ all | grep . > /dev/null; do
>
> If you just want to add -s to make, this is portable, as far as I can
> see, so please go ahead and commit your change with a proper ChangeLog.
It turns out that -s still doesn't work in all cases. I didn't bother
to track it down. I just put a break in the while loop. A different
approach may be to compare the outputs between 2 runs, like
old=
new=`${MAKE-make} -s -f Makefile.$$ all 2>&1`
while test "$old" != "$new"; do
sleep 1
old="$new"
new=`${MAKE-make} -s -f Makefile.$$ all 2>&1`
done 2>&1
H.J.
More information about the Gcc
mailing list