This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: "./contrib/gcc_update --touch" doesn't work with make
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 2 Jul 2002 13:12:52 -0700
- Subject: Re: "./contrib/gcc_update --touch" doesn't work with make
- References: <20020629235458.A23337@lucon.org> <Pine.BSF.4.44.0207022156210.48936-100000@pulcherrima.dbai.tuwien.ac.at>
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.