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 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.  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.

> (I'm not very familiar with GCC's makefiles; I'm assuming the idea
> is that bar is really the source file you want to compile, and that
> it may be spuriously written to even when its content is not
> changed.)

It's a little bit more than that.  We generate a number of source
files out of md files.  When you tweak a small part of the md file,
sometimes it only affects the output routines; sometimes it only
affects the insn matcher, etc, so we don't want to needlessly
recompile all of them.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


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