mainmake - Support: sr #106082, make doesn't recognize the same...


You are not allowed to post comments on this tracker with your current authentication level.

sr #106082: make doesn't recognize the same dir built during the process, with/without trailing slash

Submitter:  None
Submitted:  Mon 12 Nov 2007 02:07:56 AM UTC
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  POSIX-Based

Mon 12 Nov 2007 02:07:56 AM UTC, original submission:  

Given the Makefile below,  parent/a.o parent/b.o
$(CC) -shared -o $@ $^

parent/%.o: %.c | parent/ parent/child
$(CC) -c $< -o $@

mkdir -p $@
mkdir -p $@

Make (v3.81, built for i486-pc-linux-gnu) successfully built the directories `parent/' and `parent/child/', the object file `parent/a.o', but failed to build `parent/b.o' with the error message:

* No rule to make target `parent/b.o', needed by `'.  Stop.

After analyzing how make actually works, I think the problem is that make didn't recognize the `parent/' in the prereqs list of `parent/b.o' as the directory it had just built, which was actually `parent' as another target.

In my opinion, make should not make distinctions between directory names with or without trailing slashes. If all directory names are with/without the trailing slash, all will be fine (hopefully).

The patch attached below fixed this problem on my Linux box.



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

Attached Files
file #14361:  linux-make.patch added by None (808B - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by None (Submitted the item)

    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.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-11-12 None Attached File- Added linux-make.patch, #14361

    Back to the top

    Powered by Savane 3.13-3cd0.
    Corresponding source code