bugmake - Bugs: bug #42270, Make needs to canonicalise paths


bug #42270: Make needs to canonicalise paths

Submitted by:  Robert Bogomip <bobbogo>
Submitted on:  Fri 02 May 2014 09:39:02 PM UTC  
Severity:  3 - Normal Item Group:  Enhancement
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  4.0 Operating System:  Any
Fixed Release:  None Triage Status:  Medium Effort

Add a New Comment(Rich Markup)

You are not logged in

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


Mon 08 Sep 2014 12:48:48 AM UTC, comment #1:

Every version of make I've ever encountered has always worked this way: they all use string comparison to match up prerequisite and target names, not some intrinsic of the operating system (absolute path, device/inode number, etc.) I've checked the POSIX spec and it seems to imply this behavior although I don't see a specific requirement.

In any event, a change like this will need a lot of thought and consideration of possible ramifications. For example, what about files which are symbolic links to each other? Should make be able to determine that? Using absolute paths may or may not be able to tell the difference, depending on the algorithm used to compute the absolute path. What about a file with two different paths hard-linked?

In your example you use $(abspath ...) but that's not necessarily always correct. Also, how would something like this interact with VPATH? It's obviously wrong to apply $(abspath ...) to targets that make is intended to locate via VPATH lookup.

Paul D. Smith <psmith>
Project Administrator
Fri 02 May 2014 09:39:02 PM UTC, original submission:

Consider this makefile:

We get

Plainly AA and $(abspath AA) are the same file, but make doesn't think so. Make seems just to use string matching (other relative paths to the same file are seen as different files (_subdir/../A.. for instance)).

This is playing havoc with auto-generated dependencies, some of which are built by make rules.

Tested on SuSE make 3.82 and cygwin 4.0.

Robert Bogomip <bobbogo>


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

Attach Files:

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 bobbogo (Submitted the item)

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

    Date Changed by Updated Field Previous Value => Replaced by
    2014-09-08 psmith Item GroupBug => Enhancement
        Triage StatusNone => Medium Effort

    Back to the top

    Powered by Savane 3.3