bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #31940] trailing slash dropped from nonphony multicharacter targets


From: anonymous
Subject: [bug #31940] trailing slash dropped from nonphony multicharacter targets
Date: Tue, 21 Dec 2010 01:45:36 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Ubuntu/9.04 Chromium/7.0.519.0 Chrome/7.0.519.0 Safari/534.7

URL:
  <http://savannah.gnu.org/bugs/?31940>

                 Summary: trailing slash dropped from nonphony multicharacter
targets
                 Project: make
            Submitted by: None
            Submitted on: Tue 21 Dec 2010 01:45:35 AM UTC
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 3.82
        Operating System: Any
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

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.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 21 Dec 2010 01:45:35 AM UTC  Name: Makefile  Size: 347B   By: None

<http://savannah.gnu.org/bugs/download.php?file_id=22251>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31940>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]