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

 
 

bug #31940: trailing slash dropped from nonphony multicharacter targets

Submitter:  None
Submitted:  Tue 21 Dec 2010 01:45:35 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Duplicate Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.82 Operating System:  Any
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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 Files:
   
   
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
  • -email is unavailable- added by psmith (Updated 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.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-12-21 psmith StatusNone Duplicate
        Open/ClosedOpen Closed
    2010-12-21 None Attached File- Added Makefile, #22251

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code