help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how exactly the makefiles are remade ?


From: Paul D. Smith
Subject: Re: how exactly the makefiles are remade ?
Date: Fri, 19 Dec 2003 08:14:36 -0500

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

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]