bugmake - Bugs: bug #50376, Incompatibility in make versions -...

 
 

bug #50376: Incompatibility in make versions - directory/ dependency no longer match directory goal

Submitted by:  Gur Stavi <gstavi>
Submitted on:  Wed Feb 22 08:06:37 2017  
 
Severity: 3 - NormalItem Group: Bug
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: 4.2.1Operating System: None
Fixed Release: NoneTriage Status: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Sat Feb 25 02:43:25 2017, comment #1:

In 2010's make-3.82, which is where this behavior changed, and later releases, the rule appears like this in make -p:

In make-3.81, it didn't have the trailing slash. $(dir) still produced a trailing slash there. From printf debugging, I think the trailing slash was being removed by the call to multi_glob in parse_prereqs, as it was then called. That was removed by this part:

... of this commit:

2009-09-16 17:07:01 +0000 -unavailable- (8f30b68871bde8687c7fcff8bac66e2b5765129e)

- Add xcalloc() and call it - Fix memory errors found by valgrind - Remove multi_glob() and empower parse_file_seq() to do its job: the goal here is to remove the confusing reverse/re-reverse we do on the file lists: needed for future fixes. - Add a prefix arg to parse_file_seq() - Make concat() variadic so it can take arbitrary #'s of strings

Martin Dorey <mdorey>
Wed Feb 22 08:06:37 2017, original submission:

Consider the makefile below.

OUT_DIR = my_dir
OUT_FILE = $(OUT_DIR)/hello.txt

$(OUT_FILE): | $(dir $(OUT_FILE))
echo Hello World > $@

$(OUT_DIR):
mkdir $@

Running with make v3.81 results in:
mkdir my_dir
echo Hello World > my_dir/hello.txt

Running with Make v4.2.1 results in:
make: *** No rule to make target 'my_dir/', needed by 'my_dir/hello.txt'. Stop.

Is this intentional?

Since $(dir) function keeps slash at the end of the result it mostly forces directory goals to have the slash as well. It may be a good habit but could be a big compatibility issue for existing makefiles. I encountered it when make failed on a colleague's newer system.

Gur Stavi <gstavi>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mdorey (Posted a comment)
  • -unavailable- added by gstavi (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1