[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how exactly the makefiles are remade ?
From: |
Cristian Zoicas |
Subject: |
Re: how exactly the makefiles are remade ? |
Date: |
Fri, 19 Dec 2003 14:36:05 +0100 (MET) |
> %% Cristian Zoicas <address@hidden> writes:
>
> cz> xxxx: gen.XXXX
>
> cz> gen.XXXX:
> cz> @echo generating xxxx
> cz> @echo 'OBJECTS := a1.o b1.o b3.o' > xxxx;
>
> This set of rules is wrong.
>
Ok. It seems that I must change my makefile, but
it would be very nice if make would report such
errors.
Cristi
> There is no rule to actually update xxxx (from make's perspective) so it
> doesn't re-exec.
>
> You have to write it like this:
>
> xxxx:
> @echo generating $@
> @echo 'OBJECTS := a1.o b1.o b3.o' > $@;
>
> Remember the Second Rule of Makefiles.
>
>
> If you enable debugging with -d you'll see that with your makefile, make
> is never re-exec'd which is why the new value is not seen.
>
> --
> -------------------------------------------------------------------------------
> Paul D. Smith <address@hidden> Find some GNU make tips at:
> http://www.gnu.org http://make.paulandlesley.org
> "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
>