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

Submitted by:  None
Submitted on:  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

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


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:

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

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

Paul D. Smith <psmith>
Project 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>
Project Administrator
Thu 10 Jun 2010 05:06:53 PM UTC, original submission:

I stubled across this apparent bug today.

ifeq (yes,yes)
FOO = foo # leading tab inteferes!
@echo FOO is $(FOO)
FOO is



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

Attach Files:

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)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

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