This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC vs. `make' on Solaris
On Fri, May 11, 2001 at 11:44:36PM -0300, Alexandre Oliva wrote:
> But what we generally have is:
>
> foo.o: foo.c
> gcc -c foo.c
> foo.c: s-foo; @true
> s-foo: bar
> bar > tmp-foo
> move-if-change tmp-foo foo.c
> touch s-foo
>
> Even if foo.c is older than s-foo, GNU make is smart enough to figure
> @true hasn't changed it, so it doesn't proceed to rebuilding foo.o.
(While I'm on this thread ...)
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?
(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.)
Andrew