This is the mail archive of the gcc@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]

Re: GCC vs. `make' on Solaris


On Sun, May 13, 2001 at 08:44:15PM -0300, Alexandre Oliva wrote:
> On May 13, 2001, andrew@pimlott.ne.mediaone.net (Andrew Pimlott) wrote:
> 
> > What is the point of the middle rule and s-foo?  Isn't
> 
> > foo.o: foo.c
> >         gcc -c foo.c
> > foo.c: bar
> >         bar > tmp-foo
> >         move-if-change tmp-foo foo.c
> 
> > the same?
> 
> Nope.  Consider if bar generates a `tmp-foo' identical to the
> previously-existing foo.c.

Ok, then the timestamp of foo.c doesn't change, so foo.o is newer
than foo.c, so make doesn't remake foo.o.  (This is exactly the nice
behavior you pointed out earlier.)

> We want to avoid having to rebuild foo.o
> if foo.c doesn't change, but we also want to avoid running `bar' again
> every time.

bar will be run again iff bar changes, in both your example and
mine.

I'm either being dense, or relying on some peculiarity of GNU make,
because your Makefile works out the same as mine in every case I've
tried.

Andrew


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