bugmake - Bugs: bug #31940, trailing slash dropped from...

 
 

bug #31940: trailing slash dropped from nonphony multicharacter targets

Submitted by:  None
Submitted on:  Tue 21 Dec 2010 01:45:35 AM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: DuplicatePrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.82Operating System: Any
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 21 Dec 2010 03:12:51 AM UTC, comment #1:

Oops nevermind, this was fixed in 3.82 after all. I guess I must've not used the newly built version when I checked it.

Anonymous
Tue 21 Dec 2010 01:45:35 AM UTC, original submission:

Background: A pattern rule '%/' would be useful to mean "any directory". However, this only works when the directory name is a single character.

Buggy behavior:
1. If the directory names are explicit instead of using a pattern rule, everything works, except that trailing slashes disappear in the $@ variable.

2. If a target has prerequisites that is multiple characters followed by a slash, the the target name as given is not searched-for. Instead, the name without the slash is looked-for.

Documentation:
POSIX says:
"Applications shall select target names from the set of characters consisting solely of periods, underscores, digits, and alphabetics from the portable character set (see XBD Portable Character Set). Implementations may allow other characters in target names as extensions."
Any use at all of subdirectories is an extension?

The GNU Make Manual makes it clear that subdirectories work, but never mentions trailing slashes.

Workarounds:
1. Explicitly specify every %/ target as .PHONY : (behavior is not exact)
2. In addition to %/, specify %a/ %A/ %b/ %B/ ... (behavior is as intended)

Incompatibility:
Fixing this behavior would break Makefiles that mixed the use of slashed and nonslashed directories. Such Makefiles are unlikely.

Reproduced on:
make 3.81 (Ubuntu)
make 3.81 (Gentoo)
make 3.82 (vanilla)

Summary of attachment:
%/ %t/: mkdir
a/b : | a/ - OK
xxt/f : | xxt/ - works
yy/zz : | yy/ - broken

Output of attached minimal makefile:
mkdir -p a/
touch a/b
mkdir -p xxt
touch xxt/f
make: *** No rule to make target `yy', needed by `yy/zz'. Stop.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #22251:  Makefile added by None (347B)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Updated 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):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 21 Dec 2010 03:19:54 PM UTCpsmithStatusNone=>Duplicate
      Open/ClosedOpen=>Closed
    Tue 21 Dec 2010 01:45:35 AM UTCNoneAttached File-=>Added Makefile, #22251

    Back to the top


    Powered by Savane 3.1-cleanup1