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

 
 

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

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

Submitted by:  None
Submitted on:  Mon 12 Nov 2007 02:07:56 AM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 3 - NormalStatus: None
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open
Operating System: POSIX-Based

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

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.

Anonymous

 

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
  • -unavailable- added by None (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):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 12 Nov 2007 02:07:56 AM UTCNoneAttached File-=>Added linux-make.patch, #14361

    Back to the top


    Powered by Savane 3.1-cleanup