make - 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 |
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
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 |
Given the Makefile below,
libblah.so: parent/a.o parent/b.o
$(CC) -shared -o $@ $^
parent/%.o: %.c | parent/ parent/child
$(CC) -c $< -o $@
parent:
mkdir -p $@
parent/child/:
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 `libblah.so'. 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.