bugmake - Bugs: bug #47960, Adding variable assignment and new...

 
 

bug #47960: Adding variable assignment and new rule in else, break execution.

Submitter:  Gianpiero Errigo <javier4>
Submitted:  Thu 19 May 2016 01:10:54 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  None Operating System:  None
Fixed Release:  4.2 Triage Status:  Small Effort
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 21 May 2016 07:19:08 PM UTC, comment #3: 

I fixed the original bug.  I verified that Brian's behavior is present: make doesn't terminate rules on include statements.  I think this is a bug but I'm not going to fix it right now: it's a behavior-changing fix.

Paul D. Smith <psmith>
Group administrator
Thu 19 May 2016 07:09:26 PM UTC, comment #2: 

My understanding is that the end of a makefile should always end any "in progress" rule definitions and it should never be possible to have a rule starting in one makefile continue past the end of that makefile.  I even think it should be an error to continue a rule definition from one makefile into an included makefile.

But the subject of this bug, which is if-conditionals all within a single makefile, should absolutely be allowed... this is definitely a bug.

Paul D. Smith <psmith>
Group administrator
Thu 19 May 2016 01:50:21 PM UTC, comment #1: 

If anything I think it would be best to avoid allowing this sort of thing.  I'm having trouble reproducing a situation I ran into a year or so ago, but it looked something like this:


# As you might guess targets.mk has targets in it
include rules/paths.mk rules/tools.mk rules/flags.mk rules/targets.mk

include /a/list/of/makefile/stubs/for/various/projects


... then in one of the makefile stubs:


# some assignments
a=a
b=b
#...
z=z

# vpath stuff
#...

ifeq "something" "${something else}"
# note the tab; my editor decided to be "helpful"
        some valid make statement
#^^^^^^^
# This caused it to associate the line with a recipe that came from targets.mk
else
# in here there's spaces
        some other valid make statement
endif


Brian Vandenberg <phantal>
Thu 19 May 2016 01:10:54 PM UTC, original submission:  

A makefile working with make 3.82 gives an error with 4.1

This is a simple test-case

ifneq ($(FOO),yes)
foobar:
else
BAR = bar
foobar:
endif
        @echo one


3.41

$ make
Makefile:7: * recipe commences before first target.  Stop.

$ make FOO=yes
one



3.82

$ ~/bin/make-3.82
one


This is the complete answer of the guy who identified the problem
http://stackoverflow.com/a/37306577/6350583

Gianpiero Errigo <javier4>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by phantal (Posted a comment)
  • -email is unavailable- added by javier4 (Submitted the item)
  • -email is unavailable- added by javier4
  •  

    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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-05-21 psmith Item GroupNone Bug
        StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.2
        Triage StatusNone Small Effort
    2016-05-19 javier4 Carbon-Copy- Added javier4

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code