URL:
  <https://savannah.gnu.org/bugs/?67517>

                 Summary: Inconsistent variable $@ if target has an escaped
wildcard like \*
                   Group: make
               Submitter: joergboe
               Submitted: Mon 15 Sep 2025 06:16:30 PM CEST
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.4.1
        Operating System: POSIX-Based
           Fixed Release: None
           Triage Status: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 15 Sep 2025 06:16:30 PM CEST By: Anonymous
Hello,

When I use files that contain wildcard characters, the content of the variable
$@ is inconsistent, depending on what triggers the corresponding rule.

$ cat Makefile 
name_with_\*.o: name_with_\*.c
        @echo '$$@: $@          $$<: $<'
        touch $@

When the c-file exists and the o-file not exists, the output of $@ is the
target with escaped wildcard.

$ ls
Makefile  name_with_*.c
$ make
$@: name_with_\*.o              $<: name_with_*.c
touch name_with_\*.o

When the o-file exists but is not up-to-date, the output of $@ is the target
name without backslash escapes.

$ touch name_with_\*.c
$ make
$@: name_with_*.o               $<: name_with_*.c
touch name_with_*.o

This makes it impossible to use the variable $@ correctly.
Variable $< contains always the prerequisite without escapes.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67517>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to