List Info

Thread: MAKE_RESTARTS design question




MAKE_RESTARTS design question
user name
2006-08-01 15:33:41
Hi!

I would like to use $(MAKE_RESTARTS) to detect infinite
restart loops with
automatically generated dependency files (the dependencies
are quite complex,
not simply C/C++, and the Makefile is still under
development, so this happens
from time to time).

On the other hand, the default make on the system is still
3.80, which does not
yet support $(MAKE_RESTARTS), so I have to check the
version. Currently I use

ifneq (3.81,$(firstword $(sort $(MAKE_VERSION) 3.81)))
  $(error "requires make-3.81 or higher")
endif

because .FEATURES does not tell me if MAKE_RESTARTS is
available.

My question now is:
Why is MAKE_RESTARTS designed as is, i.e. empty before the
first restart, then
1, 2, ...?
Wouldn't it be better to set it to 0 for the first
iteration?
Then it would not be necessary to resort on the literal
check on the version
number to test if it is available at all.

Regards,

Alex
--
Alexander Frink

Debeka Hauptverwaltung
Abteilung IS/Q
Ferdinand-Sauerbruch-Str. 18
56058 Koblenz

Telefon  (0261) 498-1455
Telefax  (0261) 498-1496

E-Mail   Alexander.Frinkdebeka.de
Internet www.debeka.de



_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make
MAKE_RESTARTS design question
user name
2006-08-01 21:48:14
%% "Frink, Alexander " <Alexander.Frinkdebeka.de> writes:

  fa> Why is MAKE_RESTARTS designed as is, i.e. empty
before the first
  fa> restart, then 1, 2, ...?  Wouldn't it be better to
set it to 0 for
  fa> the first iteration?  Then it would not be
necessary to resort on
  fa> the literal check on the version number to test if
it is available
  fa> at all.

I dunno; it never occurred to me.  In GNU make variables, an
empty
variable false, while a variable with any value (even
"0") is true.
It's not easy to do math in GNU make.  I guess I was
anticipating people
would be more likely to do something like:

    ifdef MAKE_RESTARTS
        ... do something different if we've restarted ...
    endif

Of course you could almost as easily use:

    ifeq ($(MAKE_RESTARTS),0)
        ... do something different if we've restarted ...
    endif

to get the same effect if your suggestion were followed.

It's just the way it was done...

-- 
------------------------------------------------------------
-------------------
 Paul D. Smith <psmithgnu.org>          Find
some GNU make tips at:
 http://www.gnu.org        
             http://make.paulandlesl
ey.org
 "Please remain calm...I may be mad, but I am a
professional." --Mad Scientist


_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )