bugmake - Bugs: bug #30105, Recipes defined for special...

 
 

bug #30105: Recipes defined for special targets like .SUFFIXES are silently ignored: make should warn about them

Submitter:  None
Submitted:  Thu 10 Jun 2010 05:06:53 PM UTC
   
 
Severity:  3 - Normal Item Group:  Enhancement
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  3.81 Operating System:  Any
Fixed Release:  None Triage Status:  Small Effort
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 12 Jun 2010 12:54:25 AM UTC, comment #4: 

(That explanation is clear, thanks.  That'll teach me to search for TAB in capitals, as is used sometimes elsewhere in the manual.)

Martin Dorey <mdorey>
Sat 12 Jun 2010 12:45:57 AM UTC, comment #3: 

Make preprocessor lines like ifdef, etc. also do not count as stopping a recipe, of course, otherwise code like:

all:
ifdef DEBUG
        : do some debug thing
else
        : do some non-debug thing
endif


would not work.  I didn't mean my description below to be a complete definition.

The make manual says (in the section "Command Syntax"):

   Each command line must start with a tab, except that the first
command line may be attached to the target-and-prerequisites line with a
semicolon in between.  _Any_ line in the makefile that begins with a
tab and appears in a "rule context" (that is, after a rule has been
started until another rule or variable definition) will be considered a
command line for that rule.


Paul D. Smith <psmith>
Group administrator
Sat 12 Jun 2010 12:35:07 AM UTC, comment #2: 

So ifeq (yes, yes) counts a "a blank line" because it evaluates to nothing?  "a blank line" would be consistent with "next line that does not begin with a TAB", so that wording's not optimal.  "next line that begins with something other than a TAB" might be OK but the subtle distinction would be lost on most readers, me included.  This is news to me (well, apart from the SUFFIXES bit) and I'm not seeing a clear explanation of it in the manual (3.81 or CVS).

Martin Dorey <mdorey>
Sat 12 Jun 2010 12:10:42 AM UTC, comment #1: 

This is not a bug.  .SUFFIXES is a target (it's a special target, but a target nonetheless).

The makefile syntax is, and has always been, that any lines following a target that begin with a TAB are considered recipe lines for that target, up until the next line that does not begin with a TAB.  Intervening blank lines, comment lines, etc. are not considered to "finish" a target recipe.

It's probably worthwhile to consider an enhancement that displays a warning if recipes are defined for special targets where they have no meaning.  I'm retargeting this as an enhancement request.

Paul D. Smith <psmith>
Group administrator
Thu 10 Jun 2010 05:06:53 PM UTC, original submission:  

I stubled across this apparent bug today.

.SUFFIXES: ;
ifeq (yes,yes)
FOO = foo # leading tab inteferes!
endif
all:
@echo FOO is $(FOO)
FOO is

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #20730:  makefile added by None (96B - application/octet-stream - test case)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mdorey (Posted a comment)
  • -email is unavailable- added by psmith (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-06-12 psmith Item GroupBug Enhancement
        Triage StatusNone Small Effort
        SummaryVariables set immediately after .SUFFIXES: ; are not set when leading tabs are used Recipes defined for special targets like .SUFFIXES are silently ignored: make should warn about them
    2010-06-10 None Attached File- Added makefile, #20730

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code