Tue 02 Aug 2005 01:57:50 PM UTC, comment #4:
Paul,
I'd love to use 3.81, but it has regressed even farther (Savannah #13881).
As a point of reference, we've got about 6 million lines of code with about 3000 makefiles. Everything works fine in 3.76 -- except that the -jN stuff is crippled. Thus, to get full support for -jN, we want to move forward to 3.8x. Regressions appear on numerous fronts from 3.76 functional levels:
1. :: dependencies are processed differently (Savannah #13976)
2. endef can no longer be preceded by tab (Savannah #13877)
3. line numbering issue (Savannah #9058)
4. :: no longer works in pattern targets (Savannah #13881)
#3 is fixed in 3.81. #1, #2, and #4 are serious regressions over previously supported functionality.
Now regarding #2 -- the '<tab>endef' issue. GNUmake supports conditional structures implemented with 'ifdef', 'ifndef', 'ifeq', 'ifneq', 'else', 'endif'. In addition it supports macro definition using 'define' and 'endef'. All of these are considered to be reserved words in GNUmake. With the notable exeception of 'endef' all of the above can be indented using tabs. I've attached a Makefile to #13877 that illustrates this. It looks like:
<tab>ifdef FOO
<tab>endif
<tab>ifndef BAR
<tab>endif
<tab>ifeq ($(FOO),)
<tab>endif
<tab>ifneq ($(BAR),)
<tab>endif
<tab>define macro
<tab><tab>@echo macro text
endef
all: ; $(macro)
All you can see, everything but 'endef' can be indented with tabs. Thus, the requirement that the 'endef' must appear at start of line makes absolutely no sense. It also makes no sense that the 'define' is allowed to be indented using a tab, but that the matching 'endef' cannot be indented similarly with a tab.
Once, you've entered the 'do_define()' function, the only purpose is to find the matching 'endef'. You are known to be in a 'define' statement and the 'define' statement could not be a part of a rule. 'do_define()' should look for the 'endef' followed by any amount/kind of whitespace.
The documentation states: "The 'define' directive is followed on the same line by the name of the variable and nothing more. ... The end of the value is marked by a line containing just containing the work 'endef'." It is unclear from the documentation whether the 'define' or 'endef' may be indented, but since 'define' may be indented, it follows that 'endef' could be indented as well.
In addition, this is a regression over previously supported functionality in version 3.76. I'm requesting that we revert to that functionality because it is correct.
I've tested this with our makefiles and it works fine.
srmadsen
|